From 0450410946f3fb7df63f3e6bdf4e2e20e7d910f3 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期三, 16 八月 2023 11:19:41 +0800
Subject: [PATCH] 工作任务汇报:查询结果顺序更改
---
DAL/基础资料/其他基础资料/ClsGy_MateMould_Ctl.cs | 72 +++++++++++++++++++++++++++++-------
1 files changed, 58 insertions(+), 14 deletions(-)
diff --git "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MateMould_Ctl.cs" "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MateMould_Ctl.cs"
index 1a11afe..7118b63 100644
--- "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MateMould_Ctl.cs"
+++ "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\266\344\273\226\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MateMould_Ctl.cs"
@@ -1,4 +1,5 @@
-锘縰sing System;
+锘縰sing DBUtility;
+using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
@@ -57,15 +58,35 @@
try
{
oCn.BeginTran();
- //鎻掑叆瀛愯〃
+
+
+ //鎻掑叆琛�
foreach (Model.ClsGy_MateMould_Model oSub in DetailColl)
{
+ DataSet Ds;
+ Int64 HInterID = 1;
+ Ds = oCn.RunProcReturn("select MAX(HInterID) HInterID from Gy_MateMouldInfo", "Gy_MateMouldInfo");
+ if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0)
+ {
+ HInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString());
+ HInterID += 1;
+ }
+
+ DataSet Cs;
+ Int64 HEntryID = 1;
+ Cs = oCn.RunProcReturn("select MAX(HEntryID) HEntryID from Gy_MateMouldInfo", "Gy_MateMouldInfo");
+ if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0)
+ {
+ HEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString());
+ HEntryID += 1;
+ }
+
oCn.RunProc("Insert into Gy_MateMouldInfo " +
- " (HMaterID,HRelationID,HUnitID" +
+ " (HInterID,HEntryID,HMaterID,HRelationID,HUnitID" +
",HBeginDate,HEndDate" +
- ",HUsed,HRemark,HMaker,HMakeDate)" +
- " values(" + oSub.HMaterID.ToString() + "," + oSub.HRelationID.ToString() + "," + oSub.HUnitID.ToString() +
- ",'" + oSub.HBeginDate.ToShortDateString() + "','" + oSub.HEndDate.ToShortDateString() + "'," + Convert.ToString(oSub.HUsed ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HMaker + "','" + oSub.HMakeDate + "') ");
+ ",HUsed,HRemark,HMaker,HMakeDate,HType,HMouldQty,HProcID)" +
+ " values(" + HInterID + "," + HEntryID + "," + oSub.HMaterID.ToString() + "," + oSub.HRelationID.ToString() + "," + oSub.HUnitID.ToString() +
+ ",'" + oSub.HBeginDate.ToShortDateString() + "','" + oSub.HEndDate.ToShortDateString() + "'," + Convert.ToString(oSub.HUsed ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HMaker + "','" + oSub.HMakeDate + "','" + 1 + "','" + 1 + "','" + 1 + "') ");
}
oCn.Commit();
return true;
@@ -83,17 +104,40 @@
try
{
oCn.BeginTran();
- DeleteByID(sItemID); //鍒犻櫎璁板綍
- //鎻掑叆琛�
+ //DeleteByID(sItemID); //鍒犻櫎璁板綍
+ ////鎻掑叆琛�
foreach (Model.ClsGy_MateMould_Model oSub in DetailColl)
{
- oCn.RunProc("Insert into Gy_MateMouldInfo " +
- " (HMaterID,HRelationID,HUnitID" +
- ",HBeginDate,HEndDate" +
- ",HUsed,HRemark,HMaker,HMakeDate)" +
- " values(" + oSub.HMaterID.ToString() + "," + oSub.HRelationID.ToString() + "," + oSub.HUnitID.ToString() +
- ",'" + oSub.HBeginDate.ToShortDateString() + "','" + oSub.HEndDate.ToShortDateString() + "'," + Convert.ToString(oSub.HUsed ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HMaker + "','" + oSub.HMakeDate + "') ");
+ // oCn.RunProc("Insert into Gy_MateMouldInfo " +
+ // " (HMaterID,HRelationID,HUnitID" +
+ // ",HBeginDate,HEndDate" +
+ // ",HUsed,HRemark,HMaker,HMakeDate)" +
+ // " values(" + oSub.HMaterID.ToString() + "," + oSub.HRelationID.ToString() + "," + oSub.HUnitID.ToString() +
+ // ",'" + oSub.HBeginDate.ToShortDateString() + "','" + oSub.HEndDate.ToShortDateString() + "'," + Convert.ToString(oSub.HUsed ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HMaker + "','" + oSub.HMakeDate + "') ");
+ oCn.RunProc("Update Gy_MateMouldInfo set " +
+ "HRemark='" + oSub.HRemark + "'" +
+ ",HMaterID='" + oSub.HMaterID + "'" +
+ ",HRelationID='" + oSub.HRelationID + "'" +
+ ",HUnitID='" + oSub.HUnitID + "'" +
+ //",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) +
+ //",HUseFlag=" + Convert.ToString(HUseFlag ? 1 : 0) +
+ //",HMakeTime= getdate()" +
+ //",HMakeEmp='" + HMakeEmp + "'" +
+ /*",HRemark='" + HRemark + */"Where HItemID ='" + sItemID + "'", ref DBUtility.ClsPub.sExeReturnInfo);
}
+ //oCn.RunProc("Update Gy_MateMouldInfo set " +
+ // " HMaterID='" + oSub.HMaterID.ToString() + "'" +
+ // ",HRelationID='" + oSub.HRelationID.ToString() + "'" +
+ // ",HUnitID='" + oSub.HUnitID.ToString() + "'" +
+ // ",HTechParamID='" + HTechParamID + "'" +
+ // ",HTechParamUnitID='" + HTechParamUnitID + "'" +
+ // ",HDeptID='" + HDeptID + "'" +
+ // ",HRemark='" + oSub.HRemark + "'" +
+ // //",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) +
+ // //",HUseFlag=" + Convert.ToString(HUseFlag ? 1 : 0) +
+ // //",HMakeTime= getdate()" +
+ // //",HMakeEmp='" + HMakeEmp + "'" +
+ // /*",HRemark='" + HRemark + */"Where HItemID ='" + sItemID + "'", ref DBUtility.ClsPub.sExeReturnInfo);
oCn.Commit();
return true;
}
--
Gitblit v1.9.1