using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RMYY_CallCenter_Api.Bll
{
///
/// 休息日表
///
public partial class T_Sys_WorkOffDays
{
private readonly RMYY_CallCenter_Api.Dal.T_Sys_WorkOffDays dal = new RMYY_CallCenter_Api.Dal.T_Sys_WorkOffDays();
public T_Sys_WorkOffDays()
{ }
#region Method
///
/// 增加一条数据
///
public int Add(RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model)
{
return dal.Add(model);
}
///
/// 更新一条数据
///
public bool Update(RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model)
{
return dal.Update(model);
}
public bool UpdateState(RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model)
{
return dal.UpdateState(model);
}
///
/// 删除一条数据
///
public bool Delete(int F_OffID)
{
return dal.Delete(F_OffID);
}
public bool DeleteByDate(string date, string usercode, DateTime nowdate)
{
return dal.DeleteByDate(date, usercode,nowdate);
}
///
/// 删除一条数据
///
public bool DeleteList(string F_OffIDlist)
{
return dal.DeleteList(F_OffIDlist);
}
///
/// 得到一个对象实体
///
public RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays GetModel(int F_OffID)
{
return dal.GetModel(F_OffID);
}
public RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays GetModel(string date)
{
return dal.GetModel(date);
}
///
/// 获得数据列表
///
public DataSet GetList(string strWhere)
{
return dal.GetList(strWhere);
}
///
/// 获得前几行数据
///
public DataSet GetList(int Top, string strWhere, string filedOrder)
{
return dal.GetList(Top, strWhere, filedOrder);
}
///
/// 获得数据列表
///
public List GetModelList(string strWhere)
{
DataSet ds = dal.GetList(strWhere);
return DataTableToList(ds.Tables[0]);
}
///
/// 获得数据列表
///
public List DataTableToList(DataTable dt)
{
List modelList = new List();
int rowsCount = dt.Rows.Count;
if (rowsCount > 0)
{
RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays model;
for (int n = 0; n < rowsCount; n++)
{
model = new RMYY_CallCenter_Api.Model.T_Sys_WorkOffDays();
if (dt.Rows[n]["F_OffID"] != null && dt.Rows[n]["F_OffID"].ToString() != "")
{
model.F_OffID = int.Parse(dt.Rows[n]["F_OffID"].ToString());
}
if (dt.Rows[n]["F_OffDate"] != null && dt.Rows[n]["F_OffDate"].ToString() != "")
{
model.F_OffDate = DateTime.Parse(dt.Rows[n]["F_OffDate"].ToString());
}
if (dt.Rows[n]["F_OffState"] != null && dt.Rows[n]["F_OffState"].ToString() != "")
{
model.F_OffState = int.Parse(dt.Rows[n]["F_OffState"].ToString());
}
if (dt.Rows[n]["F_remark"] != null && dt.Rows[n]["F_remark"].ToString() != "")
{
model.F_remark = dt.Rows[n]["F_remark"].ToString();
}
if (dt.Rows[n]["F_CreateBy"] != null && dt.Rows[n]["F_CreateBy"].ToString() != "")
{
model.F_CreateBy = dt.Rows[n]["F_CreateBy"].ToString();
}
if (dt.Rows[n]["F_CreateOn"] != null && dt.Rows[n]["F_CreateOn"].ToString() != "")
{
model.F_CreateOn = DateTime.Parse(dt.Rows[n]["F_CreateOn"].ToString());
}
if (dt.Rows[n]["F_DeleteBy"] != null && dt.Rows[n]["F_DeleteBy"].ToString() != "")
{
model.F_DeleteBy = dt.Rows[n]["F_DeleteBy"].ToString();
}
if (dt.Rows[n]["F_DeleteOn"] != null && dt.Rows[n]["F_DeleteOn"].ToString() != "")
{
model.F_DeleteOn = DateTime.Parse(dt.Rows[n]["F_DeleteOn"].ToString());
}
modelList.Add(model);
}
}
return modelList;
}
///
/// 获得数据列表
///
public DataSet GetAllList()
{
return GetList("");
}
///
/// 分页获取数据列表
///
public int GetRecordCount(string strWhere)
{
return dal.GetRecordCount(strWhere);
}
#endregion Method
}
}