| | |
| | | { |
| | | 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()" + |
| | |
| | | } |
| | | else |
| | | { |
| | | bResult = BillNew.ModifyByID(DBUtility.ClsPub.isLong(mainList[0].HItemID)); |
| | | bResult = BillNew.ModifyByID(DBUtility.ClsPub.isLong(subList[0].HItemID)); |
| | | } |
| | | //æç¤º |
| | | if (bResult == true) |
| | |
| | | // " left join Gy_Material c on a.HMaterID = c.HItemID " + |
| | | // " left join Gy_Unit d on a.HUnitID = d.HItemID where a.HItemID = " + HItemID, "Gy_MateMouldInfo"); |
| | | ds = oCN.RunProcReturn("select " + |
| | | "a.HItemID,a.模å
·äº§å对åºè¡¨ä»£ç ,a.HUnitID,b.HName 模å
·åç§°" + |
| | | ",b.HNumber 模å
·ä»£ç ,a.HMaterID HMaterIDCol,c.HNumber ç©æä»£ç ,c.HName ç©æåç§°,c.HModel è§æ ¼åå·" + |
| | | "a.HItemID,a.模å
·äº§å对åºè¡¨ä»£ç ,a.HUnitID,b.hitemid HMouldIDCol,b.HNumber 模å
·ä»£ç " + |
| | | ",b.HName 模å
·åç§°,a.HMaterID HMaterIDCol,c.HNumber ç©æä»£ç ,c.HName ç©æåç§°,c.HModel è§æ ¼åå·" + |
| | | ",a.HRelationID HRelationIDCol,d.HNumber åä½ä»£ç ,d.HName åä½åç§°" + |
| | | ",a.HUnitID HUnitIDCol" + |
| | | ",a.å¼å§æ¥æ,a.ç»ææ¥æ" + |
| | |
| | | string sql = "select * from h_v_Sc_ProcessExchangeBillQuerySub where hmainid = "; |
| | | string sql1 = sql + sWhere; |
| | | ds = oCN.RunProcReturn(sql1 + " order by cast(å·¥åºå· as int)", "h_v_Sc_ProcessExchangeBillQuerySub"); |
| | | return GetObjectJson(ds); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | return GetObjectJson(ds); |
| | | } |
| | | |
| | | #region å·¥åºæµè½¬å¡ï¼ä¸è¾¾ï¼ |
| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillList where HitemID=" + HInterID, "h_v_IF_SeOrderBillList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillList where hmainid =" + HInterID, "h_v_IF_SeOrderBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |