| DAL/基础资料/公用基础资料/ClsGy_CostAverageType_Ctl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Model/Model.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Model/基础资料/基础资料/ClsGy_CostAverageTypeSub_Model.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/Controllers/基础资料/基础资料/Gy_CostAverageTypeController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_CostAverageType_Ctl.cs
@@ -11,6 +11,7 @@ //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_CostAverageType_Model oModel = new Model.ClsGy_CostAverageType_Model(); public List<Model.ClsGy_CostAverageTypeSub_Model> DetailColl = new List<Model.ClsGy_CostAverageTypeSub_Model>(); //æ°å¢ public override bool AddNew(ref string sReturn) { @@ -31,6 +32,34 @@ ", ref sReturn); //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref sReturn); DataSet dss= oCn.RunProcReturn("select MAX(HItemID) as HInterID from Gy_CostAverageType", "Gy_CostAverageType"); int HInterID = Convert.ToInt32(dss.Tables[0].Rows[0]["HInterID"]); oCn.RunProc("Delete From " + "Gy_CostAverageTypeSub" + " where HInterID=" + HInterID); //æå ¥å表 if (DetailColl != null && DetailColl.Count > 0) { foreach (Model.ClsGy_CostAverageTypeSub_Model oSub in DetailColl) { if (oSub == null) continue; string subSql = "insert into Gy_CostAverageTypeSub" + "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + ",HWeight,HMaterTypeID" + ")" + " values(" + HInterID + "," + (oSub.HEntryID != null ? oSub.HEntryID.ToString() : "0") + "," + (oSub.HSourceInterID != null && oSub.HSourceInterID != 0 ? oSub.HSourceInterID.ToString() : "0") + "," + (oSub.HSourceEntryID != null && oSub.HSourceEntryID != 0 ? oSub.HSourceEntryID.ToString() : "0") + ",'" + (oSub.HSourceBillNo ?? "") + "','" + (oSub.HSourceBillType ?? "") + "'," + (oSub.HWeight != null && oSub.HWeight != 0 ? oSub.HWeight.ToString() : "0") + "," + (oSub.HMaterTypeID != null && oSub.HMaterTypeID != 0 ? oSub.HMaterTypeID.ToString() : "0") + ")"; oCn.RunProc(subSql); } } oCn.Commit(); return true; } @@ -71,6 +100,32 @@ //å°ä¸çº§ ä¸ºéæ«çº§ oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref sReturn); // oCn.RunProc("Delete From " + "Gy_CostAverageTypeSub" + " where HInterID=" + oModel.HItemID); //æå ¥å表 if (DetailColl != null && DetailColl.Count > 0) { foreach (Model.ClsGy_CostAverageTypeSub_Model oSub in DetailColl) { if (oSub == null) continue; string subSql = "insert into Gy_CostAverageTypeSub" + "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + ",HWeight,HMaterTypeID" + ")" + " values(" + oModel.HItemID + "," + (oSub.HEntryID != null ? oSub.HEntryID.ToString() : "0") + "," + (oSub.HSourceInterID != null && oSub.HSourceInterID != 0 ? oSub.HSourceInterID.ToString() : "0") + "," + (oSub.HSourceEntryID != null && oSub.HSourceEntryID != 0 ? oSub.HSourceEntryID.ToString() : "0") + ",'" + (oSub.HSourceBillNo ?? "") + "','" + (oSub.HSourceBillType ?? "") + "'," + (oSub.HWeight != null && oSub.HWeight != 0 ? oSub.HWeight.ToString() : "0") + "," + (oSub.HMaterTypeID != null && oSub.HMaterTypeID != 0 ? oSub.HMaterTypeID.ToString() : "0") + ")"; oCn.RunProc(subSql); } } oCn.Commit(); return true; } Model/Model.csproj
@@ -106,6 +106,7 @@ <Compile Include="ä»åºç®¡ç\ClsKf_TrolleyPositionBillSub.cs" /> <Compile Include="åºç¡èµæ\å ¶ä»åºç¡èµæ\ClsGy_PurPrice_Model.cs" /> <Compile Include="åºç¡èµæ\å ¶ä»åºç¡èµæ\ClsGy_MatePrice_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CostAverageTypeSub_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Gy_CostItemAverageType_Model_2.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CostItemFixRate_Model_2.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CostCenter_Model_2.cs" /> Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_CostAverageTypeSub_Model.cs
New file @@ -0,0 +1,13 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_CostAverageTypeSub_Model : DBUtility.ClsXt_BaseBillSub { public int HWeight; //quanzhong public int HMaterTypeID; //ç©æç±»å } } WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_CostAverageTypeController.cs
@@ -171,7 +171,8 @@ string msg3 = _value.ToString(); string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg1 = sArray[0].ToString(); string msg2 = sArray[1].ToString(); string msg2 = sArray[2].ToString(); string msg4 = sArray[1].ToString();//å表 //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_CostAverageType_Edit", 1, false, msg2)) @@ -190,10 +191,16 @@ { DAL.ClsGy_CostAverageType_Ctl oBill = new DAL.ClsGy_CostAverageType_Ctl(); List<Model.ClsGy_CostAverageType_Model> lsmain = new List<Model.ClsGy_CostAverageType_Model>(); List<Model.ClsGy_CostAverageTypeSub_Model> lssub = new List<Model.ClsGy_CostAverageTypeSub_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); //\n msg1 = "[" + msg1.ToString() + "]"; msg4 = msg4.Substring(1, msg4.Length - 2); msg4 = msg4.Replace("\\", ""); msg4 = msg4.Replace("\n", ""); //\n msg4 = "[" + msg4.ToString() + "]"; lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_CostAverageType_Model>>(msg1); lssub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_CostAverageTypeSub_Model>>(msg4); foreach (Model.ClsGy_CostAverageType_Model oItem in lsmain) { if (oItem.HNumber.Trim() == "") @@ -308,7 +315,19 @@ oItem.HMakeEmp = msg2;//å建人 oBill.oModel = oItem; } int i = 0; foreach (Model.ClsGy_CostAverageTypeSub_Model oItemSub in lssub) { i++; oItemSub.HEntryID = i; oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç bool bResult;