| | |
| | | { |
| | | public Model.ClsSc_MouldDotCheckBillMain omodel = new Model.ClsSc_MouldDotCheckBillMain(); |
| | | public List<Model.ClsSc_MouldDotCheckBillSub> DetailColl = new List<Model.ClsSc_MouldDotCheckBillSub>(); |
| | | public List<Model.ClsSc_MouldDotCheckBillSub_Item> DetailCol = new List<Model.ClsSc_MouldDotCheckBillSub_Item>(); |
| | | |
| | | public ClsSc_MouldDotCheckBill() |
| | | { |
| | | base.MvarItemKeySub = "Sc_MouldDotCheckBillSub"; |
| | | base.MvarItemKeySub2 = ""; |
| | | base.MvarItemKeySub2 = "Sc_MouldDotCheckBillSub_Item"; |
| | | base.MvarItemKeySub3 = ""; |
| | | base.MvarItemKeySub4 = ""; |
| | | base.MvarItemKey="Sc_MouldDotCheckBillMain"; |
| | |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Sc_MouldDotCheckBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== |
| | | ",HDate='" + omodel.HDate + "'" + |
| | | ",HYear='" + omodel.HYear.ToString() + "'" + |
| | | ",HPeriod='" + omodel.HPeriod.ToString() + "'" + |
| | | //",HStockType='" + omodel.HStockType + "'" + |
| | |
| | | //======================================== |
| | | ",HPlanNo='" + omodel.HPlanNo + "'" + |
| | | ",HPlanInterID=" + omodel.HPlanInterID.ToString() + |
| | | ",HMouldDotCheckRuleID=" + omodel.HMouldDotCheckRuleID.ToString() + |
| | | |
| | | |
| | | ",HMouldID=" + omodel.HMouldID.ToString() + |
| | |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | //å é¤å表 |
| | | DeleteBillSub(lngBillKey); |
| | | DeleteBillSub2(lngBillKey); |
| | | //æå
¥å表 |
| | | omodel.HInterID = lngBillKey; |
| | | //æå
¥å表 |
| | |
| | | ",'" + 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.ClsSc_MouldDotCheckBillSub_Item oSub in DetailCol) |
| | | { |
| | | oCn.RunProc("Insert into Sc_MouldDotCheckBillSub_Item " + |
| | | " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HUnitID" + |
| | | ",HQty,HQtyMust" + |
| | | ") values(" |
| | | + 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.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + |
| | | "," + oSub.HQty.ToString() + "," + oSub.HQtyMust.ToString() + |
| | | ") "); |
| | | } |
| | | // |
| | | //foreach (Model.ClsSc_MouldDotCheckBillSub oSub in DetailColl) |
| | |
| | | ",HYear,HPeriod,HRemark" + |
| | | ",HMouldID,HBeginDate"+ |
| | | ",HEndDate,HPlanNo,HPlanInterID" + |
| | | ",HInnerBillNo,HExplanation" + |
| | | ",HInnerBillNo,HExplanation,HMouldDotCheckRuleID" + |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+ |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" + |
| | | "," + omodel.HMouldID.ToString() + ",'" + omodel.HBeginDate + "'" + |
| | | ",'" + omodel.HEndDate + "','" + omodel.HPlanNo + "'," + omodel.HPlanInterID.ToString() + |
| | | ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" + |
| | | ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'," + omodel.HMouldDotCheckRuleID + |
| | | ") "); |
| | | //æå
¥å表 |
| | | foreach (Model.ClsSc_MouldDotCheckBillSub oSub in DetailColl) |
| | |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | ") "); |
| | | } |
| | | |
| | | //é
ä»¶é¡¹ç® |
| | | foreach (Model.ClsSc_MouldDotCheckBillSub_Item oSub in DetailCol) |
| | | { |
| | | oCn.RunProc("Insert into Sc_MouldDotCheckBillSub_Item " + |
| | | " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HUnitID" + |
| | | ",HQty,HQtyMust" + |
| | | ") values(" |
| | | + 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.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + |
| | | "," + oSub.HQty.ToString() + "," + oSub.HQtyMust.ToString() + |
| | | ") "); |
| | | } |
| | | // |
| | | //foreach (Model.ClsSc_MouldDotCheckBillSub oSub in DetailColl) |
| | | //{ |
| | |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Sc_MouldDotCheckRuleBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== |
| | | ",HDate='" + omodel.HDate + "'" + |
| | | ",HYear='" + omodel.HYear.ToString() + "'" + |
| | | ",HPeriod='" + omodel.HPeriod.ToString() + "'" + |
| | | ",HRemark='" + omodel.HRemark + "'" + |
| | |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldDotCheckBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldDotCheckBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldDotCheckPlanBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldDotCheckBillSub_Item.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldDotCheckPlanBillSub_Item.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldDotCheckPlanBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldDotCheckRuleBillMain.cs" /> |
| | |
| | | public string HEndDate;// datetime --ç¹æ£ç»ææ¥æ |
| | | public string HExplanation;// varchar(500) --ÕªÒª |
| | | public string HInnerBillNo;// varchar(50) --å
é¨åæ®å· |
| | | public string HMouldDotCheckRuleID;// å¨å
·ç¹æ£è§ç¨ID |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSc_MouldDotCheckBillSub_Item : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | //============ |
| | | |
| | | |
| | | public Int64 HMaterID;// int --é
ä»¶ID |
| | | public Int64 HUnitID;// int --计éåä½ |
| | | public double HQty;// dec(18,8) --ç¨é |
| | | public double HQtyMust;// dec(18,8) --æ åç¨é(ææ¶éè) |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | |
| | | objJsonResult.list = columnNameList; |
| | | |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "æ æ°æ®"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | string msg5 = sArray[3].ToString(); |
| | | |
| | | string UserName = ""; |
| | | ListModels oListModels = new ListModels(); |
| | |
| | | { |
| | | //oItem.HMaker = ""; |
| | | UserName = oItem.HMaker; //å¶å人 |
| | | oItem.HMaker = msg4; |
| | | oItem.HBillType = "3821"; |
| | | oItem.HBillSubType = "3821"; |
| | | |
| | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | |
| | | //é
ä»¶é¡¹è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | msg5 = msg5.Substring(1, msg5.Length - 2); |
| | | msg5 = msg5.Replace("\\", ""); |
| | | msg5 = msg5.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "â"); |
| | | List<Model.ClsSc_MouldDotCheckBillSub_Item> ls1 = new List<Model.ClsSc_MouldDotCheckBillSub_Item>(); |
| | | ls1 = oListModels.getObjectByJson_Sc_MouldDotCheckBillSub_Item(msg5); |
| | | int j = 0; |
| | | foreach (Model.ClsSc_MouldDotCheckBillSub_Item oItemSub in ls1) |
| | | { |
| | | |
| | | j++; |
| | | oItemSub.HEntryID = j; |
| | | //oItemSub.HCloseMan = ""; //è¡å
³é |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | |
| | | oItemSub.HSourceInterID = 0; // æºå主å
ç |
| | | oItemSub.HSourceEntryID = 0; //æºååå
ç |
| | | |
| | | oItemSub.HRelationQty = 0; //å
³èæ°é |
| | | oBill.DetailCol.Add(oItemSub); |
| | | } |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | |
| | | [HttpGet] |
| | | public object Sc_MouldDotCheckBillListProjectDetai(string sqlWhere) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds, ds1; |
| | | List<object> list = new List<object>(); |
| | | string Swhere = ""; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sqlWhere == null || sqlWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select HDotCheckItemID,ç¹æ£é¡¹ç® HDotCheckItem,ç¹æ£é¨ä½ HDotCheckPart,å
·ä½è¦æ± HClaim,表ä½å¤æ³¨ HRemark,HManagerID,è´è´£äººä»£ç HManagerNumber,è´è´£äºº HManagerName from h_v_Sc_MouldDotCheckBillList", "h_v_Sc_MouldDotCheckBillList"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select HDotCheckItemID,ç¹æ£é¡¹ç® HDotCheckItem,ç¹æ£é¨ä½ HDotCheckPart,å
·ä½è¦æ± HClaim,表ä½å¤æ³¨ HRemark,HManagerID,è´è´£äººä»£ç HManagerNumber,è´è´£äºº HManagerName from h_v_Sc_MouldDotCheckBillList where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckBillList"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | //è·åç¹æ£é¡¹ç®ç¼è¾æ°æ® |
| | | ds = oCN.RunProcReturn("select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID where 1=1 " + sqlWhere, "Sc_MouldDotCheckBillSub"); |
| | | //è·åé
件项ç®ç¼è¾æ°æ® |
| | | ds1 = oCN.RunProcReturn(@"select b.HMaterID, mt.Hnumber HMaterNumber ,mt.HName HMaterName, b.HUnitID |
| | | ,u2.hnumber HUnitNumber,u2.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark |
| | | from Sc_MouldDotCheckBillSub_Item b |
| | | left join Gy_Material mt on b.HMaterID=mt.HItemID |
| | | left join h_v_IF_Unit u2 on b.HUnitID=u2.HItemID where 1=1 " + sqlWhere, "Sc_MouldDotCheckBillSub_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) |
| | | { |
| | |
| | | ,u2.hnumber HUnitNumber,u2.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark |
| | | from Sc_MouldDotCheckPlanBillSub_Item b |
| | | left join Gy_Material mt on b.HMaterID=mt.HItemID |
| | | left join h_v_IF_Unit u2 on b.HUnitID=u2.HItemID where 1=1 " + sqlWhere, "Sc_MouldDotCheckPlanBillSub"); |
| | | left join h_v_IF_Unit u2 on b.HUnitID=u2.HItemID where 1=1 " + sqlWhere, "Sc_MouldDotCheckPlanBillSub_Item"); |
| | | list.Add(ds.Tables[0]); |
| | | list.Add(ds1.Tables[0]); |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ¨¡å
·ç¹æ£è®°å½è¡¨å表çjson |
| | | /// å¤çæ°å¢æ¨¡å
·ç¹æ£è®°å½è¡¨å表 ç¹æ£é¡¹ç® çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ¨¡å
·ç¹æ£è®°å½è¡¨å表 é
ä»¶ä¿¡æ¯ çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsSc_MouldDotCheckBillSub_Item> getObjectByJson_Sc_MouldDotCheckBillSub_Item(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsSc_MouldDotCheckBillSub_Item> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldDotCheckBillSub_Item>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ¨¡å
·ç¹æ£è®¡å表主表çjson |
| | | /// ClsSc_MouldDotCheckPlanBillMain |
| | | /// </summary> |