| | |
| | | <ItemGroup> |
| | | <Compile Include="APS\ClsSc_WorkBillMonthSortBill.cs" /> |
| | | <Compile Include="APS\ClsSc_ICMOChangeBill.cs" /> |
| | | <Compile Include="ä»åºç®¡ç\å°è½¦éå®\ClsKf_TrolleyPositionBill.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_PatrolCheckItemMethod_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_PatrolCheckItemClass_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_MaintainClass_Ctl.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsKf_TrolleyPositionBill : DBUtility.ClsXt_BaseBill |
| | | { |
| | | public Model.ClsKf_TrolleyPositionBillMain omodel = new Model.ClsKf_TrolleyPositionBillMain(); |
| | | public List<Model.ClsKf_TrolleyPositionBillSub> DetailColl = new List<Model.ClsKf_TrolleyPositionBillSub>(); |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | |
| | | public ClsKf_TrolleyPositionBill() |
| | | { |
| | | base.MvarItemKeySub = "Kf_TrolleyPositionBillSub"; |
| | | base.MvarItemKeySub2 = ""; |
| | | base.MvarItemKeySub3 = ""; |
| | | base.MvarItemKeySub4 = ""; |
| | | base.MvarItemKey = "Kf_TrolleyPositionBillMain"; |
| | | base.MvarReportTitle = "å°è½¦éå®"; |
| | | base.BillType = "10004"; |
| | | base.HBillSubType = "10004"; |
| | | |
| | | } |
| | | |
| | | #region åºå®ä»£ç |
| | | |
| | | ~ClsKf_TrolleyPositionBill() |
| | | { |
| | | DetailColl = null; |
| | | } |
| | | |
| | | #endregion èªå®ä¹æ¹æ³ |
| | | |
| | | |
| | | //æ°å¢åæ® |
| | | public override bool AddBill(ref string sReturn) |
| | | { |
| | | string sErr = ""; |
| | | try |
| | | { |
| | | //å¾å°mainid |
| | | if (omodel.HInterID == 0 || omodel.HInterID.ToString() == null || omodel.HInterID.ToString() == "undefined") |
| | | { |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Kf_TrolleyPositionBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Kf_TrolleyPositionBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | |
| | | oCn.BeginTran(); |
| | | //æå
¥ä¸»è¡¨ |
| | | oCn.RunProc("Insert Into Kf_TrolleyPositionBillMain " + |
| | | "(HInterID,HBillNo,HBillType,HBillSubType,HDate,HRemark" + |
| | | ",HYear,HPeriod,HMaker,HMakeDate,HStockOrgID" + |
| | | ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" + |
| | | ",HWHID,HSPID,HSCWHID,HSCSPID" + |
| | | ") " + |
| | | " values(" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HBillType + "','" + omodel.HBillSubType + "','" + omodel.HDate.ToShortDateString() + "','" + omodel.HRemark + "'" + |
| | | ", " + omodel.HYear + "," + omodel.HPeriod + ",'" + omodel.HMaker + "',getdate()," + omodel.HSTOCKORGID.ToString() + |
| | | ",'" + omodel.HMainSourceBillType + "'," + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo + "'" + |
| | | ", " + omodel.HWHID.ToString() + "," + omodel.HSPID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HSCSPID.ToString() + |
| | | ") "); |
| | | |
| | | |
| | | sErr = sErr + "1;"; |
| | | //æå
¥å表 |
| | | foreach (Model.ClsKf_TrolleyPositionBillSub oSub in DetailColl) |
| | | { |
| | | string sql1 = string.Format(@"Insert into Kf_TrolleyPositionBillSub " + |
| | | " (HInterID,HEntryID,HBillNo_bak,HRemark," + |
| | | "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType," + |
| | | "HRelationQty,HRelationMoney," + |
| | | "HMaterID,HUnitID,HWhID,HSCWHID,HSPID,HSCSPID,HCarBarCode,HEquipID,HEquipBarCode," + |
| | | "HICMOInterID,HICMOEntryID,HICMOBillNo,HProcessExchangeInterID,HProcessExchangeEntryID,HProcessExchangeBillNo,HStockOrgID" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + omodel.HBillNo + "'" + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," |
| | | + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HMaterID + "," + oSub.HUnitID + "," + oSub.HWhID + "," |
| | | + oSub.HSCWHID + "," + oSub.HSPID + "," + oSub.HSCSPID + ",'" + oSub.HCarBarCode + "'," + oSub.HEquipID + ",'" + oSub.HEquipBarCode + "'," + oSub.HICMOInterID + "," + oSub.HICMOEntryID + ",'" |
| | | + oSub.HICMOBillNo + "'," + oSub.HProcessExchangeInterID + "," + oSub.HProcessExchangeEntryID + ",'" + oSub.HProcessExchangeBillNo + "'," |
| | | + omodel.HSTOCKORGID + |
| | | ") "); |
| | | sErr = sErr + sql1 + "2;"; |
| | | oCn.RunProc(sql1); |
| | | |
| | | sErr = sErr + "3;"; |
| | | } |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Kf_TrolleyPositionBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Kf_TrolleyPositionBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = sErr + "," + e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | //æ¾ç¤ºåæ® |
| | | public override bool ShowBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | //æ¥è¯¢ä¸»è¡¨ |
| | | DataSet Ds; |
| | | Ds = oCn.RunProcReturn("Select * from Kf_TrolleyPositionBillMain Where HInterID=" + lngBillKey.ToString() , "Kf_TrolleyPositionBillMain"); |
| | | if (Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "åæ®æªæ¾å°ï¼"; |
| | | return false; |
| | | } |
| | | //åºå®èµå¼=========================================== |
| | | omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); |
| | | omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); |
| | | omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); |
| | | omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); |
| | | omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); |
| | | omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); |
| | | omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); |
| | | omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); |
| | | omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); |
| | | omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); |
| | | omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); |
| | | omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); |
| | | omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); |
| | | omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); |
| | | omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); |
| | | omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); |
| | | omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); |
| | | omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); |
| | | omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); |
| | | omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); |
| | | omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); |
| | | omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); |
| | | omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); |
| | | omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); |
| | | //======================================================== |
| | | |
| | | // |
| | | //å¾ªç¯ |
| | | DataSet DsSub; |
| | | DsSub = oCn.RunProcReturn("Select * from Kf_TrolleyPositionBillSub Where HInterID=" + lngBillKey.ToString() , "Kf_TrolleyPositionBillSub"); |
| | | DetailColl.Clear();//æ¸
空 |
| | | for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) |
| | | { |
| | | Model.ClsKf_TrolleyPositionBillSub oSub = new Model.ClsKf_TrolleyPositionBillSub(); |
| | | // åºå®èµå¼=============================================== |
| | | oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); |
| | | oSub.HBillNo_bak = DsSub.Tables[0].Rows[i]["HBillNo_bak"].ToString().Trim(); |
| | | oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); |
| | | oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); |
| | | oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); |
| | | oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); |
| | | oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); |
| | | oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); |
| | | oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); |
| | | oSub.HRelationQty_In = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_In"]); |
| | | oSub.HRelationQty_Out = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_Out"]); |
| | | oSub.HRelationQty_WWOrder = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_WWOrder"]); |
| | | oSub.HRelationQty_Bad = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_Bad"]); |
| | | oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); |
| | | oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); |
| | | oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); |
| | | oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); |
| | | //=================================================== |
| | | |
| | | DetailColl.Add(oSub); |
| | | } |
| | | sReturn = "æ¾ç¤ºåæ®æåï¼"; |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | throw (e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <Compile Include="APS\ClsSc_ICMOChangeBillMain.cs" /> |
| | | <Compile Include="APS\ClsSc_ICMOChangeBillSub.cs" /> |
| | | <Compile Include="ClsGy_PatrolCheckItemMethod_Model.cs" /> |
| | | <Compile Include="ä»åºç®¡ç\ClsKf_TrolleyPositionBillMain.cs" /> |
| | | <Compile Include="ä»åºç®¡ç\ClsKf_TrolleyPositionBillSub.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_PatrolCheckItemClass_Model.cs" /> |
| | | <Compile Include="ä»åºç®¡ç\ClsKf_WorkShopICStockBillMain.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_MaintainClass_Model.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsKf_TrolleyPositionBillMain : DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | public Int64 HWHID; // int --è°å
¥ä»åº |
| | | public Int64 HSPID; // int --è°å
¥ä»ä½ |
| | | public Int64 HSCWHID; // int --è°åºä»åº |
| | | public Int64 HSCSPID; // int --è°åºä»ä½ |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsKf_TrolleyPositionBillSub : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public Int64 HMaterID; |
| | | public Int64 HUnitID; |
| | | public Int64 HWhID; |
| | | public Int64 HSCWHID; |
| | | public Int64 HSPID; |
| | | public Int64 HSCSPID; |
| | | public string HCarBarCode; |
| | | public Int64 HEquipID; |
| | | public string HEquipBarCode; |
| | | public Int64 HICMOInterID; |
| | | public Int64 HICMOEntryID; |
| | | public string HICMOBillNo; |
| | | public Int64 HProcessExchangeInterID; |
| | | public Int64 HProcessExchangeEntryID; |
| | | public string HProcessExchangeBillNo; |
| | | public Int64 HStockOrgID; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.Message = "ä¿å失败errï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | |
| | | var HEmpID = list[i]["HEmpID"].ToString(); |
| | | var HWorkQty = list[i]["å°æ¶äº§è½"].ToString(); |
| | | var HSourceName = list[i]["çäº§èµæº"].ToString(); |
| | | var HMouldID = list[i]["HMouldID"].ToString(); |
| | | //var HWorkQty_ProdLine = list[i]["产线æ»äº§è½"].ToString(); |
| | | |
| | | LogService.CustomWriteLog("2.05:" + i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | |
| | | " HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," + |
| | | "HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," + |
| | | "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" + |
| | | ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty,HSourceName)values" + |
| | | ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty,HSourceName,HMouldID)values" + |
| | | $"({HInterID},'{HBillNo}',{DateTime.Now.Year},{DateTime.Now.Month},'{BillType}'," + |
| | | $"'{BillType}',GETDATE(),1,'{user}',getdate(),'{HICMOBillNo}','{HOrderType}'," + |
| | | $"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID == "" ? 0.ToString() : HSourceID)}, {(HYX == "" ? 0.ToString() : HYX)}, {(HProdORGID == "" ? 0.ToString() : HProdORGID)}," + |
| | |
| | | $" 0, {(HSplitQty == "" ? 0.ToString() : HSplitQty)}, {(HDayPlanSumQty == "" ? 0.ToString() : HDayPlanSumQty)},'{HPlanBeginDate}'," + |
| | | $"'{HSeOrderBillNo}','{HICMOBillType}',{(HSourceStockInQty == "" ? 0.ToString() : HSourceStockInQty)},{(HLeftPlanQty == "" ? 0.ToString() : HLeftPlanQty)},'{HOrderLev}',getdate()," + |
| | | $"{HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty}," + |
| | | $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}','{HSourceName}')"; |
| | | $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}','{HSourceName}','{HMouldID}')"; |
| | | |
| | | //LogService.Write("sql:" + sql); |
| | | //主表 |
| | |
| | | var HOrderLev = list[i]["订åç级"].ToString(); |
| | | var HPlanQty = list[i]["è®¡åæ°é"].ToString(); |
| | | var HEmpID = list[i]["HEmpID"].ToString(); |
| | | var HMouldID = list[i]["HMouldID"].ToString(); |
| | | |
| | | LogService.CustomWriteLog("2.1:"+i, DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | |
| | | |
| | | oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX}" + |
| | | $",HWorkQty={HWorkQty},HProdTimes={HProdTimes},HReadyTimes={HReadyTimes},HLastBeginDate='{HLastBeginDate}'" + |
| | | $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty},HSourceName='{HSourceName}',HWorkQty_ProdLine={HWorkQty_ProdLine}" + |
| | | $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty},HSourceName='{HSourceName}',HWorkQty_ProdLine={HWorkQty_ProdLine},HMouldID={HMouldID}" + |
| | | $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["åæ®å·"].ToString()}'"); |
| | | } |
| | | } |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region å°è½¦éå®å ä¸ä¼ çå |
| | | |
| | | /// <summary> |
| | | /// å°è½¦éå®åæ°å¢ä¸ä¼ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SaveTrolleyPositionBill_Json2")] |
| | | [HttpPost] |
| | | public object set_SaveTrolleyPositionBill_Json([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string UserName = sArray[2].ToString(); |
| | | string OperationType = sArray[3].ToString(); |
| | | DBUtility.ClsPub.CurUserName = UserName; |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | DAL.ClsKf_TrolleyPositionBill oBill = new DAL.ClsKf_TrolleyPositionBill(); |
| | | List<Model.ClsKf_TrolleyPositionBillMain> lsmain = new List<Model.ClsKf_TrolleyPositionBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Kf_TrolleyPositionBillMain(msg2); |
| | | |
| | | foreach (Model.ClsKf_TrolleyPositionBillMain oItem in lsmain) |
| | | { |
| | | DBUtility.ClsPub.CurUserName = oItem.HMaker; |
| | | oItem.HBillType = "10004"; |
| | | oItem.HBillSubType = "10004"; |
| | | oItem.HBillStatus = 1; //åæ®ç¶æï¼1æªå®¡ï¼2å®¡æ ¸éè¿ï¼3å
³éï¼4ä½åºï¼5å®¡æ ¸éå,6å®¡æ ¸ä¸,7å·²é
ï¼8å·²åå¤ï¼9ç»æ¡ï¼10éªè¯,11ä¸è¾¾ï¼12å¼å·¥,13ç³è¯·å®¡æ¹,15ç³è¯·æ£éªï¼16 å¤å®åæ ¼ï¼17å¤å®ä¸åæ ¼ï¼ |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | |
| | | // è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | List<Model.ClsKf_TrolleyPositionBillSub> ls = new List<Model.ClsKf_TrolleyPositionBillSub>(); |
| | | ls = oListModels.getObjectByJson_Kf_TrolleyPositionBillSub(msg3); |
| | | int i = 0; |
| | | foreach (Model.ClsKf_TrolleyPositionBillSub oItemSub in ls) |
| | | { |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | } |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (OperationType == "1") |
| | | { |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.Verify = "N"; |
| | | } |
| | | |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å°è½¦éå®åä¸ä¼ 失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") |
| | | { |
| | | LogService.Write("çäº§æ±æ¥åä¿å失败åå ï¼" + ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | |
| | | , "h_p_Sc_ICMOReportBill_ReverseWriteQty"); |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") |
| | | { |
| | | LogService.Write("çäº§æ±æ¥åä¿å失败åå ï¼" + ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") |
| | | { |
| | | LogService.Write("çäº§æ±æ¥åä¿å失败åå ï¼" + ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LogService.Write("çäº§æ±æ¥åä¿å失败åå ï¼" + e.Message); |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 车é´å®ä½å°è½¦éå®ä¸»è¡¨json |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsKf_TrolleyPositionBillMain> getObjectByJson_Kf_TrolleyPositionBillMain(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsKf_TrolleyPositionBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_TrolleyPositionBillMain>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 车é´å®ä½å°è½¦éå®å表json |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsKf_TrolleyPositionBillSub> getObjectByJson_Kf_TrolleyPositionBillSub(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsKf_TrolleyPositionBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_TrolleyPositionBillSub>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥å·¥å¹³å°è¿å·¥å主表json |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |