using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using System.Data;
|
|
namespace DAL
|
{
|
/// <summary>
|
/// 资源能力
|
/// </summary>
|
public class ClsGy_PlanShifts_Ctl
|
{
|
public string MvarItemKey;
|
public string MvarReportTitle;
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
public Model.ClsGy_PlanShifts_Model oModel = new Model.ClsGy_PlanShifts_Model();
|
//新增
|
public bool AddNew()
|
{
|
|
try
|
{
|
oCn.BeginTran();
|
Delete(oModel.HSourceID,oModel.HDate.ToShortDateString());
|
oCn.RunProc("Insert into " + MvarItemKey + " " +
|
" (HDate,HSourceID,HShiftsID,HOverTimes,HRemark) " +
|
" Values('" + oModel.HDate.ToShortDateString() + "'," + oModel.HSourceID.ToString() + "," + oModel.HShiftsID.ToString() +
|
"," + oModel.HOverTimes.ToString()+",'"+ oModel.HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo);
|
oCn.Commit();
|
return true;
|
}
|
catch (Exception e)
|
{
|
oCn.RollBack();
|
throw (e);
|
}
|
}
|
|
//删除
|
public bool Delete(Int64 sItemID,string sDate)
|
{
|
try
|
{
|
oCn.RunProc("Delete From Gy_PlanShifts where HSourceID=" + sItemID.ToString() + " and HDate='" + sDate + "'");
|
return true;
|
}
|
catch (Exception e)
|
{
|
throw (e);
|
}
|
}
|
|
//构造函数
|
public ClsGy_PlanShifts_Ctl()
|
{
|
MvarItemKey = "Gy_PlanShifts";
|
MvarReportTitle = "资源能力设置";
|
oModel = new Model.ClsGy_PlanShifts_Model();
|
}
|
}
|
}
|