| | |
| | | { |
| | | oCn.BeginTran(); |
| | | |
| | | 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; |
| | | } |
| | | |
| | | //æå
¥è¡¨ |
| | | 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 " + |
| | | " (HInterID,HEntryID,HMaterID,HRelationID,HUnitID" + |
| | | ",HBeginDate,HEndDate" + |
| | |
| | | // ",'" + 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()" + |