From 9a33fec0d0192ee41fac7d258b01468fe1c4483f Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 18 七月 2024 09:41:42 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
DBUtility/业务单据/ClsXt_BaseBill.cs | 348 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 336 insertions(+), 12 deletions(-)
diff --git "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs" "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs"
index c98eef1..63af819 100644
--- "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs"
+++ "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs"
@@ -120,15 +120,15 @@
DataSet ds = oCn.RunProcReturn("select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString(), MvarItemKey);
if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
{
- oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=4 Where HInterID=" + lngBillKey.ToString());
+ oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=4,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
}
else if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
{
- oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=2 Where HInterID=" + lngBillKey.ToString());
+ oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=2,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
}
else
{
- oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString());
+ oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=1,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
}
sReturn = "";
@@ -149,15 +149,15 @@
DataSet ds = oCn.RunProcReturn("select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString(), MvarItemKey);
if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
{
- oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=4 Where HInterID=" + lngBillKey.ToString());
+ oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=4,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
}
else if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
{
- oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=2 Where HInterID=" + lngBillKey.ToString());
+ oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=2,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
}
else
{
- oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString());
+ oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=1,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
}
//鍐欏叆鏃ュ織
@@ -178,10 +178,47 @@
throw (e);
}
}
+ //琛屽弽鍏抽棴鍗曟嵁(鍖呭惈鍐欏叆鏃ュ織) 2024-01-31
+ public bool CancelRow(Int64 lngBillKey,Int64 HEntryID, string HBillNo, string sUser, ref string sReturn)
+ {
+ try
+ {
+ //oCn.BeginTran();
+ string sql = "select * from " + MvarItemKeySub + " where HInterID=" + lngBillKey.ToString() + " and HEntryID = " + HEntryID;
+ DataSet ds = oCn.RunProcReturn(sql, MvarItemKeySub);
+ if(ds==null || ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "琛岃褰曚笉瀛樺湪锛�";
+ return false;
+ }
+ else
+ {
+ sql = " Update " + MvarItemKeySub + " set HCloseMan='',HEntryCloseDate='',HCloseType=0 Where HInterID=" + lngBillKey.ToString() + " and HEntryID = " + HEntryID;
+ oCn.RunProc(sql);
+ }
+
+ //鍐欏叆鏃ュ織
+ string WorkList = "琛屽弽鍏抽棴锛屽崟鎹彿锛�" + HBillNo + "锛涘瓙琛ㄥ唴鐮侊細" + HEntryID;
+ string SystemName = "LMES-" + MvarReportTitle + "妯″潡";
+ oCn.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+ "(getdate(),'" + sUser + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','琛屽弽鍏抽棴')"
+ );
+
+ sReturn = "琛屽弽鍏抽棴鎴愬姛锛�";
+ //oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
//鍙嶅鏍�
public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
{
-
+ string sql = "";
if (isUse(lngBillKey, ref sReturn))
{
return false;
@@ -201,7 +238,21 @@
{
oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString());
}
-
+
+ //鍙嶅鏍稿悗 鏇存柊鍙婃椂搴撳瓨琛� 鍑忓皯搴撳瓨
+ sql = "select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString();
+ ds = oCn.RunProcReturn(sql, MvarItemKey);
+ if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBillType = ds.Tables[0].Rows[0]["HBillType"].ToString();
+ if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1204")
+ {
+ //鍙嶅鏍告洿鏂� 鍙婃椂搴撳瓨琛� 澧炲姞搴撳瓨 1201 1202 1203 1247 1244 1251 1210
+ //鍙嶅鏍告洿鏂� 鍙婃椂搴撳瓨琛� 鍑忓皯搴撳瓨 1204 1202 1203 1247 1244 1251 1210
+ ds = oCn.RunProcReturn("exec h_KF_UPDateICinventory '" + lngBillKey.ToString() + "','" + HBillType + "','2'", "h_KF_UPDateICinventory");
+ }
+ }
+
sReturn = "";
return true;
}
@@ -255,6 +306,19 @@
oCn.RollBack();
return false;
}
+ //鍙嶅鏍稿悗 鏇存柊鍙婃椂搴撳瓨琛� 鍑忓皯搴撳瓨
+ sql = "select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString();
+ ds = oCn.RunProcReturn(sql, MvarItemKey);
+ if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBillType = ds.Tables[0].Rows[0]["HBillType"].ToString();
+ if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1205" || HBillType == "1250" || HBillType == "1206" || HBillType == "1245" || HBillType == "1239")
+ {
+ //鍙嶅鏍告洿鏂� 鍙婃椂搴撳瓨琛� 澧炲姞搴撳瓨 1201 1202 1203 1247 1244 1251 1210
+ //鍙嶅鏍告洿鏂� 鍙婃椂搴撳瓨琛� 鍑忓皯搴撳瓨 1205 1250 1206 1245 1239
+ ds = oCn.RunProcReturn("exec h_KF_UPDateICinventory '" + lngBillKey.ToString() + "','" + HBillType + "','2'", "h_KF_UPDateICinventory");
+ }
+ }
//鍐欏叆鏃ュ織
string WorkList = "鍙嶅鏍稿崟鎹紝鍗曟嵁鍙凤細" + HBillNo;
string SystemName = "LMES-" + MvarReportTitle + "妯″潡";
@@ -274,15 +338,98 @@
}
}
+ //瀹℃壒娴�-鍙嶅鏍�(鍖呭惈鍙嶅鏍稿悗鎺у埗銆佸啓鍏ユ棩蹇�) 2024-01-31
+ public bool AbandonCheck(SQLHelper.ClsCN oCN,Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn)
+ {
+ string sql = "";
+ DataSet ds;
+
+ if (isUse(lngBillKey, ref sReturn))
+ {
+ return false;
+ }
+ try
+ {
+ ds = oCN.RunProcReturn("select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString(), MvarItemKey);
+ if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
+ {
+ oCN.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=4 Where HInterID=" + lngBillKey.ToString());
+ }
+ else if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
+ {
+ oCN.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=3 Where HInterID=" + lngBillKey.ToString());
+ }
+ else
+ {
+ oCN.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString());
+ }
+
+ //鍙嶅鏍稿悗鎺у埗
+ sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
+ ds = oCN.RunProcReturn(sql, procName);
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "鍙嶅鏍歌繃绋嬩腑鍑洪敊锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ return false;
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
+ return false;
+ }
+ //鍙嶅鏍稿悗 鏇存柊鍙婃椂搴撳瓨琛� 鍑忓皯搴撳瓨
+ sql = "select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString();
+ ds = oCN.RunProcReturn(sql, MvarItemKey);
+ if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBillType = ds.Tables[0].Rows[0]["HBillType"].ToString();
+ if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1205" || HBillType == "1250" || HBillType == "1206" || HBillType == "1245" || HBillType == "1239")
+ {
+ //鍙嶅鏍告洿鏂� 鍙婃椂搴撳瓨琛� 澧炲姞搴撳瓨 1201 1202 1203 1247 1244 1251 1210
+ //鍙嶅鏍告洿鏂� 鍙婃椂搴撳瓨琛� 鍑忓皯搴撳瓨 1205 1250 1206 1245 1239
+ ds = oCN.RunProcReturn("exec h_KF_UPDateICinventory '" + lngBillKey.ToString() + "','" + HBillType + "','2'", "h_KF_UPDateICinventory");
+ }
+ }
+ //鍐欏叆鏃ュ織
+ string WorkList = "鍙嶅鏍稿崟鎹紝鍗曟嵁鍙凤細" + HBillNo;
+ string SystemName = "LMES-" + MvarReportTitle + "妯″潡";
+ oCN.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+ "(getdate(),'" + sUser + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','鍙嶅鏍�')"
+ );
+
+ sReturn = "鍙嶅鏍稿崟鎹垚鍔燂紒";
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
+
//瀹℃牳
public bool CheckBill(Int64 lngBillKey, ref string sReturn)
{
-
+ string sql = "";
+ DataSet ds;
try
{
string HChecker = ClsPub.CurUserName ;
string HCheckDate =ClsPub.GetServerDate(-1);
oCn.RunProc(" Update " + MvarItemKey + " set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "',HBillStatus=2 Where HInterID=" + lngBillKey.ToString());
+ //瀹℃牳鍚� 鏇存柊鍙婃椂搴撳瓨琛� 澧炲姞搴撳瓨
+ sql = "select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString();
+ ds = oCn.RunProcReturn(sql, MvarItemKey);
+ if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBillType = ds.Tables[0].Rows[0]["HBillType"].ToString();
+ if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1204")
+ {
+ //瀹℃牳鏇存柊 鍙婃椂搴撳瓨琛� 澧炲姞搴撳瓨 1201 1202 1203 1247 1244 1251 1210
+ //瀹℃牳鏇存柊 鍙婃椂搴撳瓨琛� 鍑忓皯搴撳瓨 1204
+ ds = oCn.RunProcReturn("exec h_KF_UPDateICinventory '" + lngBillKey.ToString() + "','" + HBillType + "','1'", "h_KF_UPDateICinventory");
+ }
+ }
sReturn = "";
return true;
}
@@ -319,7 +466,7 @@
{
string HChecker = sUser;
string HCheckDate = ClsPub.GetServerDate(-1);
-
+
//寮�鍚簨鍔�
oCn.BeginTran();
@@ -341,6 +488,19 @@
oCn.RollBack();
return false;
}
+ //瀹℃牳鍚� 鏇存柊鍙婃椂搴撳瓨琛� 澧炲姞搴撳瓨
+ sql = "select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString();
+ ds = oCn.RunProcReturn(sql, MvarItemKey);
+ if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBillType = ds.Tables[0].Rows[0]["HBillType"].ToString();
+ if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1250" || HBillType == "1206" || HBillType == "1245" || HBillType == "1239")
+ {
+ //瀹℃牳鏇存柊 鍙婃椂搴撳瓨琛� 澧炲姞搴撳瓨 1201 1202 1203 1247 1244 1251 1210
+ //瀹℃牳鏇存柊 鍙婃椂搴撳瓨琛� 鍑忓皯搴撳瓨 1204 1250 1206 1245 1239
+ ds = oCn.RunProcReturn("exec h_KF_UPDateICinventory '" + lngBillKey.ToString() + "','" + HBillType + "','1'", "h_KF_UPDateICinventory");
+ }
+ }
//鍐欏叆鏃ュ織
string WorkList = "瀹℃牳鍗曟嵁锛屽崟鎹彿锛�" + HBillNo;
string SystemName = "LMES-" + MvarReportTitle + "妯″潡";
@@ -359,6 +519,63 @@
throw (e);
}
}
+
+ //瀹℃壒娴�-瀹℃牳(鍖呭惈瀹℃牳鍚庢帶鍒躲�佸啓鍏ユ棩蹇�) 2024-01-31
+ public bool CheckBill(SQLHelper.ClsCN oCN,Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn)
+ {
+ string sql = "";
+ DataSet ds;
+ try
+ {
+ string HChecker = sUser;
+ string HCheckDate = ClsPub.GetServerDate(-1);
+
+ //鏇存柊鍗曟嵁鐘舵��
+ oCN.RunProc(" Update " + MvarItemKey + " set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "',HBillStatus=2 Where HInterID=" + lngBillKey.ToString());
+
+ //瀹℃牳鍚庢帶鍒�
+ sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
+ ds = oCN.RunProcReturn(sql, procName);
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "瀹℃牳杩囩▼涓嚭閿欙紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ return false;
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
+ return false;
+ }
+ //瀹℃牳鍚� 鏇存柊鍙婃椂搴撳瓨琛� 澧炲姞搴撳瓨
+ sql = "select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString();
+ ds = oCN.RunProcReturn(sql, MvarItemKey);
+ if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBillType = ds.Tables[0].Rows[0]["HBillType"].ToString();
+ if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1250" || HBillType == "1206" || HBillType == "1245" || HBillType == "1239")
+ {
+ //瀹℃牳鏇存柊 鍙婃椂搴撳瓨琛� 澧炲姞搴撳瓨 1201 1202 1203 1247 1244 1251 1210
+ //瀹℃牳鏇存柊 鍙婃椂搴撳瓨琛� 鍑忓皯搴撳瓨 1204 1250 1206 1245 1239
+ ds = oCN.RunProcReturn("exec h_KF_UPDateICinventory '" + lngBillKey.ToString() + "','" + HBillType + "','1'", "h_KF_UPDateICinventory");
+ }
+ }
+ //鍐欏叆鏃ュ織
+ string WorkList = "瀹℃牳鍗曟嵁锛屽崟鎹彿锛�" + HBillNo;
+ string SystemName = "LMES-" + MvarReportTitle + "妯″潡";
+ oCN.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+ "(getdate(),'" + sUser + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','瀹℃牳')"
+ );
+
+ sReturn = "瀹℃牳鍗曟嵁鎴愬姛锛�";
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
+
//鍏抽棴
public bool CloseBill(Int64 lngBillKey, ref string sReturn)
{
@@ -367,7 +584,7 @@
{
string HCloseMan = ClsPub.CurUserName;
string HCloseDate = ClsPub.GetServerDate(-1);
- oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate='" + HCloseDate + "',HBillStatus=3 Where HInterID=" + lngBillKey.ToString());
+ oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate='" + HCloseDate + "',HBillStatus=3,HCloseType = 1 Where HInterID=" + lngBillKey.ToString());
sReturn = "";
return true;
}
@@ -385,7 +602,7 @@
oCn.BeginTran();
string HCloseMan = sUser;
string HCloseDate = ClsPub.GetServerDate(-1);
- oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate='" + HCloseDate + "',HBillStatus=3 Where HInterID=" + lngBillKey.ToString());
+ oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate='" + HCloseDate + "',HBillStatus=3,HCloseType = 1 Where HInterID=" + lngBillKey.ToString());
//鍐欏叆鏃ュ織
string WorkList = "鍏抽棴鍗曟嵁锛屽崟鎹彿锛�" + HBillNo;
@@ -405,6 +622,113 @@
throw (e);
}
}
+
+ //琛屽叧闂崟鎹紙琛屽叧闂悗鎺у埗锛�(鍖呭惈鍐欏叆鏃ュ織) 2024-01-31
+ public bool CloseRow(Int64 lngBillKey, Int64 HEntryID, string HBillNo, string sUser, string procName, ref string sReturn)
+ {
+ DataSet ds;
+ try
+ {
+ oCn.BeginTran();
+ string HCloseMan = sUser;
+ string HEntryCloseDate = ClsPub.GetServerDate(-1);
+ //鍙樻洿琛屽叧闂姸鎬�
+ string sql = " Update " + MvarItemKeySub + " set HCloseMan='" + HCloseMan + "',HEntryCloseDate='" + HEntryCloseDate + "',HCloseType=1 Where HInterID=" + lngBillKey.ToString() + " and HEntryID = " + HEntryID;
+ oCn.RunProc(sql);
+
+ //妫�鏌ュ崟鎹瓙琛ㄦ墍鏈夎鏄惁閮藉叧闂紝鑻ラ兘鍏抽棴鍒欒嚜鍔ㄥ叧闂崟鎹�
+ //sql = "select * from " + MvarItemKeySub + " where HInterID=" + lngBillKey + " and HCloseMan=''";
+ //ds = oCn.RunProcReturn(sql, MvarItemKeySub);
+ //if(ds!=null && ds.Tables[0].Rows.Count == 0)
+ //{
+ // sql = " Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate=getdate(),HBillStatus=3,HCloseType = 0 Where HInterID=" + lngBillKey.ToString();
+ // oCn.RunProc(sql);
+ //}
+
+ //鍐欏叆鏃ュ織
+ string WorkList = "琛屽叧闂紝鍗曟嵁鍙凤細" + HBillNo + "锛涘瓙琛ㄥ唴鐮侊細" + HEntryID;
+ string SystemName = "LMES-" + MvarReportTitle + "妯″潡";
+ oCn.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+ "(getdate(),'" + sUser + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','琛屽叧闂�')"
+ );
+
+
+
+ //琛屽叧闂悗鎺у埗=========================================
+ string sql_afterClose = "exec " + procName + " " + lngBillKey + "," + HEntryID + ",'" + HBillNo + "','" + sUser + "'";
+ DataSet ds_afterClose = oCn.RunProcReturn(sql_afterClose, procName);
+ if (ds_afterClose == null || ds_afterClose.Tables[0].Rows.Count <= 0)
+ {
+ sReturn = "琛屽叧闂け璐ワ紝鍘熷洜锛氳鍏抽棴鍚庢帶鍒堕敊璇紝璇疯仈绯荤綉缁滅鐞嗕汉鍛橈紒";
+
+ oCn.RollBack();
+
+ return false;
+ }
+ else
+ {
+ if (ds_afterClose.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ sReturn = "鍏抽棴澶辫触锛屽師鍥狅細" + ds_afterClose.Tables[0].Rows[0]["HRemark"].ToString();
+ oCn.RollBack();
+
+ return false;
+ }
+ }
+ //=========================================
+
+
+ sReturn = "琛屽叧闂垚鍔燂紒";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+ //琛屽叧闂崟鎹�(鍖呭惈鍐欏叆鏃ュ織) 2024-01-31
+ public bool CloseRow(Int64 lngBillKey,Int64 HEntryID, string HBillNo, string sUser, ref string sReturn)
+ {
+ DataSet ds;
+ try
+ {
+ oCn.BeginTran();
+ string HCloseMan = sUser;
+ string HEntryCloseDate = ClsPub.GetServerDate(-1);
+ //鍙樻洿琛屽叧闂姸鎬�
+ string sql = " Update " + MvarItemKeySub + " set HCloseMan='" + HCloseMan + "',HEntryCloseDate='" + HEntryCloseDate + "',HCloseType=1 Where HInterID=" + lngBillKey.ToString() + " and HEntryID = " + HEntryID;
+ oCn.RunProc(sql);
+
+ //妫�鏌ュ崟鎹瓙琛ㄦ墍鏈夎鏄惁閮藉叧闂紝鑻ラ兘鍏抽棴鍒欒嚜鍔ㄥ叧闂崟鎹�
+ //sql = "select * from " + MvarItemKeySub + " where HInterID=" + lngBillKey + " and HCloseMan=''";
+ //ds = oCn.RunProcReturn(sql, MvarItemKeySub);
+ //if(ds!=null && ds.Tables[0].Rows.Count == 0)
+ //{
+ // sql = " Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate=getdate(),HBillStatus=3,HCloseType = 0 Where HInterID=" + lngBillKey.ToString();
+ // oCn.RunProc(sql);
+ //}
+
+ //鍐欏叆鏃ュ織
+ string WorkList = "琛屽叧闂紝鍗曟嵁鍙凤細" + HBillNo + "锛涘瓙琛ㄥ唴鐮侊細" + HEntryID;
+ string SystemName = "LMES-" + MvarReportTitle + "妯″潡";
+ oCn.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+ "(getdate(),'" + sUser + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','琛屽叧闂�')"
+ );
+
+ sReturn = "琛屽叧闂垚鍔燂紒";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
//浣滃簾
public bool Cancelltion(Int64 lngBillKey, ref string sReturn)
{
--
Gitblit v1.9.1