修改
This commit is contained in:
90
CleanMachine.BLL/CM/DayWorkTimeBLL.cs
Normal file
90
CleanMachine.BLL/CM/DayWorkTimeBLL.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using CleanMachine.DAL.CM;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace CleanMachine.BLL.CM
|
||||
{
|
||||
public class DayWorkTimeBLL
|
||||
{
|
||||
public DayWorkTimeBLL()
|
||||
{
|
||||
|
||||
}
|
||||
#region 一般方法
|
||||
/// <summary>
|
||||
/// 存在
|
||||
/// </summary>
|
||||
public bool Exists(DateTime Date)
|
||||
{
|
||||
return new DayWorkTimeDAL().Exists(Date);
|
||||
}
|
||||
|
||||
public bool UpdateTime(DateTime date, int value)
|
||||
{
|
||||
var _dal = new DayWorkTimeDAL();
|
||||
|
||||
if (!_dal.Exists(date))
|
||||
{
|
||||
return _dal.Add(new Model.CM.DayWorkTime() { Date = date, StartValue = value, EndValue = 0 });
|
||||
}
|
||||
else
|
||||
{
|
||||
return _dal.UpdateEndValue(new Model.CM.DayWorkTime() { Date = date, StartValue = 0, EndValue = value });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加一个数据
|
||||
/// </summary>
|
||||
public bool Add(CleanMachine.Model.CM.DayWorkTime model)
|
||||
{
|
||||
return new DayWorkTimeDAL().Add(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新一个数据
|
||||
/// </summary>
|
||||
public bool Update(CleanMachine.Model.CM.DayWorkTime model)
|
||||
{
|
||||
return new DayWorkTimeDAL().Update(model);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除一个数据
|
||||
/// </summary>
|
||||
public bool Delete(string strWhere, object Params = null)
|
||||
{
|
||||
return new DayWorkTimeDAL().Delete(strWhere, Params);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除一个数据
|
||||
/// </summary>
|
||||
public bool Delete(DateTime Date)
|
||||
{
|
||||
return new DayWorkTimeDAL().Delete(Date);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得数据列表
|
||||
/// </summary>
|
||||
public IEnumerable<CleanMachine.Model.CM.DayWorkTime> GetList(string strWhere, object Params = null)
|
||||
{
|
||||
return new DayWorkTimeDAL().GetList(strWhere, Params);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个对象
|
||||
/// </summary>
|
||||
public CleanMachine.Model.CM.DayWorkTime GetModel(DateTime Date)
|
||||
{
|
||||
return new DayWorkTimeDAL().GetModel(Date);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user