器具维修记录单 源单类型 (手工录入 维修派工单 故障登记单 ) 根据类型去选择相对应的单据 带出数据
器具维修记录单 子表两个 页签 (维修信息 配件信息)--参考设备维修记录单
| | |
| | | { |
| | | public Model.ClsSb_MouldRepairWorkBillMain omodel = new Model.ClsSb_MouldRepairWorkBillMain(); |
| | | public List<Model.ClsSb_MouldRepairWorkBillSub> DetailColl = new List<Model.ClsSb_MouldRepairWorkBillSub>(); |
| | | public List<Model.ClsSb_MouldRepairWorkBillSub_Item> DetailCol = new List<Model.ClsSb_MouldRepairWorkBillSub_Item>(); |
| | | |
| | | public ClsSb_MouldRepairWorkBill() |
| | | { |
| | |
| | | base.MvarItemKeySub3 = ""; |
| | | base.MvarItemKeySub4 = ""; |
| | | base.MvarItemKey="Sc_MouldRepairWorkBillMain"; |
| | | base.MvarReportTitle = "模å
·ç»´ä¿®å·¥å"; |
| | | base.MvarReportTitle = "模å
·ç»´ä¿®è®°å½å·¥å"; |
| | | base.BillType = "3807"; |
| | | base.HBillSubType = "3807"; |
| | | |
| | |
| | | " where HInterID=" + lngBillKey.ToString()); |
| | | //å é¤å
³è |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | oCn.RunProc("delete from Sc_MouldRepairWorkBillSub_Item where HInterID=" + lngBillKey); |
| | | //å é¤å表 |
| | | DeleteBillSub(lngBillKey); |
| | | //æå
¥å表 |
| | |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HRepairID.ToString() + ",'" + oSub.HRepairExplanation + "'," + oSub.HManagerID.ToString() + "," + oSub.HMoney.ToString() + |
| | | ") "); |
| | | } |
| | | //æå
¥å表é
ä»¶ä¿¡æ¯ |
| | | foreach (Model.ClsSb_MouldRepairWorkBillSub_Item oSub in DetailCol) |
| | | { |
| | | oCn.RunProc("Insert into Sc_MouldRepairWorkBillSub_Item " + |
| | | " (HInterID,HEntryID,HMaterID" + |
| | | ",HQty,HUnitID,HQtyMust" + |
| | | ",HCloseMan,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + |
| | | "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + |
| | | ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | ") "); |
| | | } |
| | | // |
| | |
| | | "," + oSub.HRepairID.ToString() + ",'" + oSub.HRepairExplanation + "'," + oSub.HManagerID.ToString() + "," + oSub.HMoney.ToString() + |
| | | ") "); |
| | | } |
| | | //æå
¥å表é
ä»¶ä¿¡æ¯ |
| | | foreach (Model.ClsSb_MouldRepairWorkBillSub_Item oSub in DetailCol) |
| | | { |
| | | oCn.RunProc("Insert into Sc_MouldRepairWorkBillSub_Item " + |
| | | " (HInterID,HEntryID,HMaterID" + |
| | | ",HQty,HUnitID,HQtyMust" + |
| | | ",HCloseMan,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + |
| | | "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + |
| | | ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | ") "); |
| | | } |
| | | // |
| | | //foreach (Model.ClsSb_MouldRepairWorkBillSub oSub in DetailColl) |
| | | //{ |
| | |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsGy_MouldRoutingBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsGy_MouldRoutingBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSb_MouldRepairWorkBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSb_MouldRepairWorkBillSub_Item.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSb_MouldRepairWorkBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldBorrowInBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldBorrowInBillSub.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSb_MouldRepairWorkBillSub_Item : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public long HMaterID;// int --é
ä»¶ID |
| | | public long HUnitID;// int --计éåä½ |
| | | public double HQty;// dec(18,8) --ç¨é |
| | | public double HQtyMust;// dec(18,8) --æ åç¨é(ææ¶éè) |
| | | } |
| | | } |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region 模å
·ç»´ä¿®åä¿å/ç¼è¾ |
| | | #region 模å
·ç»´ä¿®è®°å½åä¿å/ç¼è¾ |
| | | /// <summary> |
| | | /// ä¿å模å
·ç»´ä¿®å |
| | | /// </summary> |
| | |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | string msg5 = sArray[3].ToString(); |
| | | |
| | | |
| | | string UserName = ""; |
| | |
| | | List<Model.ClsSb_MouldRepairWorkBillSub> ls = new List<Model.ClsSb_MouldRepairWorkBillSub>(); |
| | | ls = oListModels.getObjectByJson_Gy_MouldRepairWorkBillSub(msg3); |
| | | int i = 0; |
| | | foreach (Model.ClsSb_MouldRepairWorkBillSub oItemSub in ls) |
| | | foreach (Model.ClsSb_MouldRepairWorkBillSub oItem in ls) |
| | | { |
| | | |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | oItem.HEntryID = i; |
| | | //oItemSub.HCloseMan = ""; //è¡å
³é |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | oItem.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItem.HCloseType = false; //å
³éç±»å |
| | | //oItemSub.HRemark = ""; //夿³¨ |
| | | oItemSub.HRelationQty = 0; //å
³èæ°é |
| | | oItem.HRelationQty = 0; //å
³èæ°é |
| | | //oItemSub.HRelationMoney = 0; //å
³èéé¢ |
| | | //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® |
| | | //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± |
| | | //oItemSub.HManagerID = 0; //è´è´£äººID |
| | | //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ |
| | | oBill.DetailColl.Add(oItemSub); |
| | | oBill.DetailColl.Add(oItem); |
| | | |
| | | } |
| | | |
| | | //é
ä»¶æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | msg5 = msg5.Substring(1, msg5.Length - 2); |
| | | msg5 = msg5.Replace("\\", ""); |
| | | msg5 = msg5.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "â"); |
| | | List<Model.ClsSb_MouldRepairWorkBillSub_Item> ls1 = new List<Model.ClsSb_MouldRepairWorkBillSub_Item>(); |
| | | ls1 = oListModels.getObjectByJson_Gy_MouldRepairWorkBillSub_Item(msg5); |
| | | int j = 0; |
| | | foreach (Model.ClsSb_MouldRepairWorkBillSub_Item oItemSub in ls1) |
| | | { |
| | | |
| | | j++; |
| | | oItemSub.HEntryID = j; |
| | | //oItemSub.HCloseMan = ""; //è¡å
³é |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | //oItemSub.HRemark = ""; //夿³¨ |
| | | oItemSub.HSourceInterID = 0; // æºå主å
ç |
| | | oItemSub.HSourceEntryID = 0; //æºååå
ç |
| | | //oItemSub.HSourceBillNo = ""; //æºååå· |
| | | //oItemSub.HSourceBillType = ""; //æºåç±»å |
| | | oItemSub.HRelationQty = 0; //å
³èæ°é |
| | | //oItemSub.HRelationMoney = 0; //å
³èéé¢ |
| | | //HMaterID = "";//é
件代ç |
| | | //HUnitID = "";//åä½ä»£ç |
| | | //HQty = "";//å®é
ç¨é |
| | | //HQtyMust = "";//åä½ç¨é |
| | | //HRemark = "";//夿³¨ |
| | | //oItemSub.HRepairID = 0; //ç»´ä¿®é¡¹ç® |
| | | //oItemSub.HRepairExplanation =""; //ç»´ä¿®è¦æ± |
| | | //oItemSub.HManagerID = 0; //è´è´£äººID |
| | | //oItemSub.HMoney = 0; //ç»´ä¿®è´¹ç¨ |
| | | oBill.DetailCol.Add(oItemSub); |
| | | |
| | | } |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | |
| | | [HttpGet] |
| | | public object Sb_MouldRepairWorkBillListProjectDetai(string sqlWhere) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds, ds1; |
| | | List<object> list = new List<object>(); |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sqlWhere == null || sqlWhere.Equals("")) |
| | | { |
| | | //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub"); |
| | | ds = oCN.RunProcReturn("select HRepairID, å维修项ç®ä»£ç HRepairCode,åç»´ä¿®é¡¹ç® HRepairName,åç»´ä¿®è¦æ± HRepairExplanation,HManagerSonID HManagerID,åè´è´£äººä»£ç HManagerCode,åè´è´£äºº HManagerName,ç»´ä¿®è´¹ç¨ HMoney,表ä½å¤æ³¨ HRemark,æºå主å
ç HSourceInterID,æºååå
ç HSourceEntryID,æºååå· HSourceBillNo,æºåç±»å HSourceBillType from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | else |
| | | { |
| | | //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub where 1 = 1 "; |
| | | string sql1 = "select HRepairID,å维修项ç®ä»£ç HRepairCode,åç»´ä¿®é¡¹ç® HRepairName,åç»´ä¿®è¦æ± HRepairExplanation,HManagerSonID HManagerID,åè´è´£äººä»£ç HManagerCode,åè´è´£äºº HManagerName,ç»´ä¿®è´¹ç¨ HMoney,表ä½å¤æ³¨ HRemark,æºå主å
ç HSourceInterID,æºååå
ç HSourceEntryID,æºååå· HSourceBillNo,æºåç±»å HSourceBillType from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | |
| | | string sql = "select HRepairID,å维修项ç®ä»£ç HRepairCode,åç»´ä¿®é¡¹ç® HRepairName,åç»´ä¿®è¦æ± HRepairExplanation,HManagerSonID HManagerID,åè´è´£äººä»£ç HManagerCode,åè´è´£äºº HManagerName,ç»´ä¿®è´¹ç¨ HMoney,表ä½å¤æ³¨ HRemark,æºå主å
ç HSourceInterID,æºååå
ç HSourceEntryID,æºååå· HSourceBillNo,æºåç±»å HSourceBillType from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "+ sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit"); |
| | | |
| | | string sql1 = "select é
ä»¶ID HMaterID, é
件代ç HMaterNumber,é
ä»¶åç§° HMaterName,è§æ ¼åå· HMaterSpec,åä½ID HUnitID,计éåä½ä»£ç HUnitNumber,计éåä½åç§° HUnitName,ç¨é HQty,æ åç¨é HQtyMust,å夿³¨1 HRemark,è§æ ¼åå· HMaterSpec from h_v_Sc_MouldRepairWorkBillSub_Item where 1 = 1 " + sqlWhere ; |
| | | ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldRepairWorkBillSub_Item"); |
| | | |
| | | list.Add(ds.Tables[0]); |
| | | list.Add(ds1.Tables[0]); |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = null; |
| | | objJsonResult.list = list; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ¨¡å
·ç»´ä¿®å表çjson |
| | | /// å¤çæ°å¢æ¨¡å
·ç»´ä¿®å表ä¿å
»ä¿¡æ¯çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ¨¡å
·ç»´ä¿®å表é
ä»¶ä¿¡æ¯çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsSb_MouldRepairWorkBillSub_Item> getObjectByJson_Gy_MouldRepairWorkBillSub_Item(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsSb_MouldRepairWorkBillSub_Item> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_MouldRepairWorkBillSub_Item>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ¨¡å
·ç»´ä¿®éªæ¶å主表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |