using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using System.Data;
|
|
namespace SCM
|
{
|
public class ClsGy_UserJiTaiRelation_Ctl : DBUtility.ClsGy_Base_Ctl
|
{
|
//SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
//原代码 用于 替换子项目
|
public string HOldNumber;
|
public List<SCM.ClsGy_UserJiTaiRelation_Model> DetailColl = new List<SCM.ClsGy_UserJiTaiRelation_Model>();
|
|
public SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
|
|
|
//反审核
|
public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
|
{
|
try
|
{
|
|
oWeb.Url = ClsPub1.WEBSURL;
|
oWeb.getRunProc(" Update Gy_UserJiTaiRelation set HChecker='',HCheckDate=null Where HItemID=" + lngBillKey.ToString(),ref DBUtility.ClsPub.sExeReturnInfo);
|
sReturn = "";
|
return true;
|
}
|
catch (Exception e)
|
{
|
sReturn = e.Message;
|
return false;
|
}
|
}
|
|
//审核
|
public bool CheckBill(Int64 lngBillKey, ref string sReturn)
|
{
|
|
try
|
{
|
oWeb.Url = ClsPub1.WEBSURL;
|
oWeb.getRunProc(" Update Gy_UserJiTaiRelation set HStopflag=0,HChecker='" + DBUtility.ClsPub.CurUserName + "',HCheckDate='" + DBUtility.ClsPub.GetServerDate(-1) + "' Where HItemID=" + lngBillKey.ToString(), ref DBUtility.ClsPub.sExeReturnInfo);
|
//将其他 工价设置为 停用
|
oWeb.getRunProc(" exec h_p_Gy_UserJiTaiRelationStopflag " + lngBillKey.ToString(), ref DBUtility.ClsPub.sExeReturnInfo);
|
//
|
sReturn = "";
|
return true;
|
}
|
catch (Exception e)
|
{
|
sReturn = e.Message;
|
return false;
|
}
|
}
|
|
|
//新增
|
public override bool AddNew()
|
{
|
|
try
|
{
|
//oCn.BeginTran();
|
oWeb.Url = ClsPub1.WEBSURL;
|
//插入子表
|
foreach (SCM.ClsGy_UserJiTaiRelation_Model oSub in DetailColl)
|
{
|
oWeb.getRunProc("Insert into Gy_UserJiTaiRelation " +
|
" (HJTID,HUserID)" +
|
" values('" + oSub.HJiTaiID.ToString() + "','" + oSub.HUserID.ToString() + "'" +
|
") ", ref DBUtility.ClsPub.sExeReturnInfo);
|
}
|
//oCn.Commit();
|
return true;
|
}
|
catch (Exception e)
|
{
|
oCn.RollBack();
|
throw (e);
|
}
|
}
|
|
//修改
|
public bool ModifyByID(string sItemID)
|
{
|
try
|
{
|
oWeb.Url = ClsPub1.WEBSURL;
|
if (DetailColl.Count == 0) return false;
|
//oCn.BeginTran();
|
//DeleteByID(sItemID); //删除记录
|
oWeb.getRunProc(" DELETE FROM Gy_UserJiTaiRelation Where HUserID='" + sItemID.ToString() + "'", ref DBUtility.ClsPub.sExeReturnInfo);
|
//插入表
|
foreach (SCM.ClsGy_UserJiTaiRelation_Model oSub in DetailColl)
|
{
|
oWeb.getRunProc("Insert into Gy_UserJiTaiRelation " +
|
" (HJTID,HUserID)" +
|
|
" values('" + oSub.HJiTaiID.ToString() + "','" + oSub.HUserID.ToString() + "'" +
|
") ", ref DBUtility.ClsPub.sExeReturnInfo);
|
}
|
//oCn.Commit();
|
return true;
|
}
|
catch (Exception e)
|
{
|
//oCn.RollBack();
|
throw (e);
|
}
|
}
|
|
//显示单据
|
public bool ShowBill(string lngBillKey, ref string sReturn)
|
{
|
try
|
{
|
//查询主表
|
oWeb.Url = ClsPub1.WEBSURL;
|
DataSet DsSub = new DataSet();
|
DsSub = oWeb.getDataSetBySQL("Select * from Gy_UserJiTaiRelation Where HUserID='" + lngBillKey.ToString() + "'", "Gy_UserJiTaiRelation", ref DBUtility.ClsPub.sExeReturnInfo);
|
DetailColl.Clear();//清空
|
if (DsSub == null || DsSub.Tables[0].Rows.Count == 0)
|
{
|
return false;
|
}
|
for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
|
{
|
SCM.ClsGy_UserJiTaiRelation_Model oSub = new SCM.ClsGy_UserJiTaiRelation_Model();
|
oSub.HJiTaiID = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HJTID"]);
|
oSub.HUserID = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HUserID"]);
|
|
DetailColl.Add(oSub);
|
}
|
sReturn = "显示单据成功!";
|
return true;
|
}
|
catch (Exception e)
|
{
|
sReturn = e.Message;
|
return false;
|
}
|
}
|
|
//批改单据
|
public bool BatchModifyBill(Int64 lngBillKey, double sPrice, ref string sReturn)
|
{
|
try
|
{
|
//oCn.BeginTran();
|
//oCn.RunProc(" Update Gy_UserJiTaiRelation set HPrice=" + sPrice.ToString() + " Where HItemID=" + lngBillKey.ToString());
|
//sReturn = "修改单据成功!";
|
//oCn.Commit();
|
return true;
|
}
|
catch (Exception e)
|
{
|
sReturn = e.Message;
|
//oCn.RollBack();
|
return false;
|
}
|
}
|
|
|
|
//构造函数
|
public ClsGy_UserJiTaiRelation_Ctl()
|
{
|
MvarItemKey = "Gy_UserJiTaiRelation";
|
MvarReportTitle = "用户机台权限表";
|
}
|
}
|
}
|