using CleanMachine.DAL.CM;
using System;
using System.Collections.Generic;
using System.Text;
namespace CleanMachine.BLL.CM
{
public class DayWorkTimeBLL
{
public DayWorkTimeBLL()
{
}
#region 一般方法
///
/// 存在
///
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 });
}
}
///
/// 添加一个数据
///
public bool Add(CleanMachine.Model.CM.DayWorkTime model)
{
return new DayWorkTimeDAL().Add(model);
}
///
/// 更新一个数据
///
public bool Update(CleanMachine.Model.CM.DayWorkTime model)
{
return new DayWorkTimeDAL().Update(model);
}
///
/// 删除一个数据
///
public bool Delete(string strWhere, object Params = null)
{
return new DayWorkTimeDAL().Delete(strWhere, Params);
}
///
/// 删除一个数据
///
public bool Delete(DateTime Date)
{
return new DayWorkTimeDAL().Delete(Date);
}
///
/// 获得数据列表
///
public IEnumerable GetList(string strWhere, object Params = null)
{
return new DayWorkTimeDAL().GetList(strWhere, Params);
}
///
/// 获取一个对象
///
public CleanMachine.Model.CM.DayWorkTime GetModel(DateTime Date)
{
return new DayWorkTimeDAL().GetModel(Date);
}
#endregion
}
}