From 06ba191527da42feb3eb243f75c5a7e57444e322 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期五, 12 十一月 2021 18:03:48 +0800
Subject: [PATCH] 新增器具档案初始化按钮新增采购入库记录
---
WebAPI/DLL/ClsSc_ICMOReportBill.cs | 86 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 85 insertions(+), 1 deletions(-)
diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
index 45c7003..937b973 100644
--- a/WebAPI/DLL/ClsSc_ICMOReportBill.cs
+++ b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -159,7 +159,7 @@
") " +
" values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker+ "',getdate()" +
"," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HEmpID.ToString() + "','" + omodel.HEmpNumber +
- "','" + omodel.HGroupID.ToString() + "'," + omodel.HDeptID.ToString() + ",'" + omodel.HDeptNumber + "'"+
+ "','" + omodel.HGroupID.ToString() + "'," + omodel.HDeptID.ToString() + ",'" + omodel.HDeptNumber +
"','" + omodel.HMainSourceBillNo.ToString() + "'," + omodel.HMainSourceInterID.ToString() + ",'" + omodel.HMainSourceEntryID + "','" + omodel.HMainSourceBillType + "'" +
") ");
//鎻掑叆瀛愯〃
@@ -307,6 +307,90 @@
}
}
+ //瀹℃牳
+ public bool CheckBill(Int64 lngBillKey, ref string sReturn)
+ {
+
+ try
+ {
+ string HChecker = DBUtility.ClsPub.CurUserName;
+ string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+ oCn.BeginTran();
+ oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
+
+ sReturn = "瀹℃牳鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+
+ sReturn = "";
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
+
+ //鍙嶅鏍�
+ public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
+ {
+
+ try
+ {
+ string HChecker = DBUtility.ClsPub.CurUserName;
+ string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+ oCn.BeginTran();
+ //杩樺師鍗曟嵁鐘舵�佷负鏈鏍哥姸鎬�
+ oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1',HChecker='',HCheckDate='' Where HInterID=" + lngBillKey.ToString());
+ sReturn = "鍙嶅鏍稿崟鎹垚鍔燂紒";
+ oCn.Commit();
+ sReturn = "";
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
+
+ //鍒犻櫎鍗曟嵁
+ public virtual bool DeleteBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ oCn.BeginTran();
+ //鏌ヨ鐢熶骇姹囨姤鍗曡〃鏁伴噺
+ DataSet ds = oCn.RunProcReturn("select a.HBillNo,b.HSourceInterID,b.HSourceEntryID from Sc_ICMOReportBillMain a inner join Sc_ICMOReportBillSub b on a.HInterID = b.HInterID where a.HInterID = '" + lngBillKey + "'", "Sc_ICMOReportBillMain");
+ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+ string HSourceInterID = ds.Tables[0].Rows[0]["HSourceInterID"].ToString();
+ string HSourceEntryID = ds.Tables[0].Rows[0]["HSourceEntryID"].ToString();
+ //
+ //鏇存柊浜ч噺姹囨姤涓存椂琛ㄦ槸鍚︽姤妫�鐢宠鐘舵��
+ string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set HRelationInterID='0' where HICMOReportBillNo='"+ HBillNo + "' and HICMOInterID='"+ HSourceInterID + "' and HICMOEntryID='"+ HSourceEntryID + "'");
+ oCn.RunProc(sql1);
+
+ //鍒犻櫎鍏宠仈
+ DeleteRelation(ref sReturn, lngBillKey);
+ //鍒犻櫎鏄庣粏琛�
+ DeleteBillSub(lngBillKey);
+ //鍒犻櫎涓昏〃
+ DeleteBillMain(lngBillKey);
+
+ sReturn = "鍒犻櫎鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+
+
+
//鎵爜鐢熸垚浜ч噺姹囨姤鍗曪紙鏃犳潯鐮佸嚭鍏ュ簱璁板綍锛�
public bool AddBill_PDA2(ref string sReturn)
{
--
Gitblit v1.9.1