| | |
| | | <Compile Include="ä»åºç®¡ç\æ¡ç 管ç\ClsKF_BarCodeStatusChangeBill.cs" /> |
| | | <Compile Include="åºç¡èµæ\InterFaceåºç¡èµæ\ClsIF_ORGANIZATIONS_View.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_CustLocation_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_EquipStatus_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_MouldStatus_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_Operator_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_RateType_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_Staff_Ctl.cs" /> |
| | |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldProdOutInBill.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldRepairInBill.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldRepairOutBill.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldStatusChangeBill.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipSparepartsBill.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipSparepartsChangeBill.cs" /> |
| | | <Compile Include="è´¨æ£ç®¡ç\ClsQC_FirstPieceCheckBill.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_EquipStatus_Ctl : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_EquipStatus_Model oModel = new Model.ClsGy_EquipStatus_Model(); |
| | | //æ°å¢ |
| | | public override bool AddNew() |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc($@"insert into Gy_EquipStatus(HNumber,HName ,HShortNumber ,HParentID ,HLevel |
| | | ,HEndFlag ,HStopflag ,HRemark ,HHelpCode ,HUseFlag |
| | | ,HMakeTime ,HMakeEmp ,HCheckEmp ,HCheckTime ,HModifyEmp |
| | | ,HModifyTime ,HStopEmp ,HStopTime ,HUSEORGID,HCREATEORGID) |
| | | values('{oModel.HNumber}','{oModel.HName}','{oModel.HShortNumber}',{oModel.HParentID},{oModel.HLevel} |
| | | ,{(oModel.HEndFlag == true ? 1 : 0)},{(oModel.HStopflag == true ? 1 : 0)},'{oModel.HRemark}','{oModel.HHelpCode}','{oModel.HUseFlag}' |
| | | ,GETDATE(),'{oModel.HMakeEmp}','','','' |
| | | ,'','','',{oModel.HUSEORGID},{oModel.HCREATEORGID})" |
| | | , ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //ä¿®æ¹ |
| | | public override bool ModifyByID(Int64 sItemID) |
| | | { |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc("Update " + MvarItemKey + " set " + |
| | | " HNumber='" + oModel.HNumber + "'" + |
| | | ",HName='" + oModel.HName + "'" + |
| | | ",HShortNumber='" + oModel.HShortNumber + "'" + |
| | | ",HParentID=" + oModel.HParentID.ToString() + |
| | | ",HLevel=" + oModel.HLevel.ToString() + |
| | | ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + |
| | | ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + |
| | | ",HRemark= '" + oModel.HRemark + "'" + |
| | | ",HHelpCode='" + oModel.HHelpCode + "'" + |
| | | ",HModifyEmp ='" + oModel.HMakeEmp + "'" + |
| | | ",HModifyTime =getdate()" + |
| | | " Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | //æ ¹æ®ä»£ç å¤æä¿¡æ¯ |
| | | public override bool HavParentCode(string sCode, Int64 sItemID) |
| | | { |
| | | DataSet DS; |
| | | try |
| | | { |
| | | DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo); |
| | | if (DS.Tables[0].Rows.Count == 0) |
| | | return false; |
| | | else |
| | | { |
| | | oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]); |
| | | return true; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | //æé 彿° |
| | | public ClsGy_EquipStatus_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_EquipStatus"; |
| | | MvarReportTitle = "设å¤ç¶æ"; |
| | | oModel = new Model.ClsGy_EquipStatus_Model(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_MouldStatus_Ctl : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_MouldStatus_Model oModel = new Model.ClsGy_MouldStatus_Model(); |
| | | //æ°å¢ |
| | | public override bool AddNew() |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc($@"insert into Gy_MouldStatus(HNumber,HName ,HShortNumber ,HParentID ,HLevel |
| | | ,HEndFlag ,HStopflag ,HRemark ,HHelpCode ,HUseFlag |
| | | ,HMakeTime ,HMakeEmp ,HCheckEmp ,HCheckTime ,HModifyEmp |
| | | ,HModifyTime ,HStopEmp ,HStopTime ,HUSEORGID,HCREATEORGID) |
| | | values('{oModel.HNumber}','{oModel.HName}','{oModel.HShortNumber}',{oModel.HParentID},{oModel.HLevel} |
| | | ,{(oModel.HEndFlag == true ? 1 : 0)},{(oModel.HStopflag == true ? 1 : 0)},'{oModel.HRemark}','{oModel.HHelpCode}','{oModel.HUseFlag}' |
| | | ,GETDATE(),'{oModel.HMakeEmp}','','','' |
| | | ,'','','',{oModel.HUSEORGID},{oModel.HCREATEORGID})" |
| | | , ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //ä¿®æ¹ |
| | | public override bool ModifyByID(Int64 sItemID) |
| | | { |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc("Update " + MvarItemKey + " set " + |
| | | " HNumber='" + oModel.HNumber + "'" + |
| | | ",HName='" + oModel.HName + "'" + |
| | | ",HShortNumber='" + oModel.HShortNumber + "'" + |
| | | ",HParentID=" + oModel.HParentID.ToString() + |
| | | ",HLevel=" + oModel.HLevel.ToString() + |
| | | ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + |
| | | ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + |
| | | ",HRemark= '" + oModel.HRemark + "'" + |
| | | ",HHelpCode='" + oModel.HHelpCode + "'" + |
| | | ",HModifyEmp ='" + oModel.HMakeEmp + "'" + |
| | | ",HModifyTime =getdate()" + |
| | | " Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | //æ ¹æ®ä»£ç å¤æä¿¡æ¯ |
| | | public override bool HavParentCode(string sCode, Int64 sItemID) |
| | | { |
| | | DataSet DS; |
| | | try |
| | | { |
| | | DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo); |
| | | if (DS.Tables[0].Rows.Count == 0) |
| | | return false; |
| | | else |
| | | { |
| | | oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]); |
| | | return true; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | //æé 彿° |
| | | public ClsGy_MouldStatus_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_MouldStatus"; |
| | | MvarReportTitle = "å¨å
·ç¶æ"; |
| | | oModel = new Model.ClsGy_MouldStatus_Model(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Text; |
| | | |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsSc_MouldStatusChangeBill : DBUtility.ClsXt_BaseBill |
| | | { |
| | | public Model.ClsSc_MouldStatusChangeBillMain omodel = new Model.ClsSc_MouldStatusChangeBillMain(); |
| | | public List<Model.ClsSc_MouldStatusChangeBillSub> DetailColl = new List<Model.ClsSc_MouldStatusChangeBillSub>(); |
| | | |
| | | public ClsSc_MouldStatusChangeBill() |
| | | { |
| | | base.MvarItemKeySub = "Sc_MouldStatusChangeBillSub"; |
| | | base.MvarItemKeySub2 = ""; |
| | | base.MvarItemKeySub3 = ""; |
| | | base.MvarItemKeySub4 = ""; |
| | | base.MvarItemKey = "Sc_MouldStatusChangeBillMain"; |
| | | base.MvarReportTitle = "å¨å
·ç¶æåæ´å"; |
| | | base.BillType = "3844"; |
| | | base.HBillSubType = "3844"; |
| | | } |
| | | |
| | | //ä¿®æ¹åæ® |
| | | public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | // |
| | | oCn.BeginTran(); |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Sc_MouldStatusChangeBillMain set " + |
| | | " HReason='" + omodel.HReason + "'" + //åºå®èµå¼=============== |
| | | ",HExplanation='" + omodel.HExplanation + "'" + |
| | | ",HYear='" + omodel.HYear.ToString() + "'" + |
| | | ",HPeriod='" + omodel.HPeriod.ToString() + "'" + |
| | | ",HBillStatus=" + omodel.HBillStatus.ToString() + |
| | | ",HRemark='" + omodel.HRemark + "'" + |
| | | ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + |
| | | ",HUpDateDate=getdate()" + |
| | | //======================================== |
| | | ",HEmpID=" + omodel.HEmpID.ToString() + |
| | | ",HDeptID=" + omodel.HDeptID.ToString() + |
| | | " where HInterID=" + lngBillKey.ToString()); |
| | | //å é¤å
³è |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | //å é¤å表 |
| | | DeleteBillSub(lngBillKey); |
| | | //æå
¥å表 |
| | | omodel.HInterID = lngBillKey; |
| | | foreach (Model.ClsSc_MouldStatusChangeBillSub oSub in DetailColl) |
| | | { |
| | | oCn.RunProc("Insert into Sc_MouldStatusChangeBillSub " + |
| | | " (HInterID,HEntryID,HBillNo_bak,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HUnitID,HQtyMust,HQty,HStatusID_Old,HStatusID_New" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HBillNo_bak + "','" + oSub.HRemark + "'," |
| | | + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HMaterID + "," + oSub.HUnitID + "," + 0 + "," + oSub.HQty + "," + oSub.HStatusID_Old + "," + oSub.HStatusID_New + ") "); |
| | | } |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //æ°å¢åæ® |
| | | public override bool AddBill(ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | //å¾å°mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID)) |
| | | { |
| | | omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | } |
| | | if (IsExistMainID(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HInterID, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew)) |
| | | { |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | // |
| | | oCn.BeginTran(); |
| | | //主表 |
| | | //oCN.RunProc(@"Insert Into Sc_MouldStatusChangeBillMain |
| | | // (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | // ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID |
| | | // ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HEmpID,HDeptID,HReason,HExplanation,HInnerBillNo) |
| | | //",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + |
| | | |
| | | oCn.RunProc("Insert Into Sc_MouldStatusChangeBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HYear,HPeriod,HDate,HBillNo,HBillStatus" + |
| | | ",HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID" + |
| | | ",HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HEmpID,HDeptID,HReason,HExplanation,HInnerBillNo" + |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HDate + "','" + omodel.HBillNo + |
| | | "'," + omodel.HBillStatus + ",'" + omodel.HRemark + "','" + omodel.HBackRemark + "','" + omodel.HMaker + |
| | | "','" + omodel.HMakeDate + "','" + omodel.HMainSourceBillType + "'," + omodel.HMainSourceInterID + |
| | | "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "'," + omodel.HPrintQty + |
| | | "," + omodel.HEmpID + "," + omodel.HDeptID + ",'" + omodel.HReason + "','" + omodel.HExplanation + |
| | | "','" + omodel.HInnerBillNo + "'" + ") "); |
| | | //æå
¥å表 |
| | | foreach (Model.ClsSc_MouldStatusChangeBillSub oSub in DetailColl) |
| | | { |
| | | oCn.RunProc("Insert into Sc_MouldStatusChangeBillSub " + |
| | | " (HInterID,HEntryID,HBillNo_bak,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HUnitID,HQtyMust,HQty,HStatusID_Old,HStatusID_New" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HBillNo_bak + "','" + oSub.HRemark + "'," |
| | | + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HMaterID + "," + oSub.HUnitID + "," + 0 + "," + oSub.HQty + "," + oSub.HStatusID_Old + "," + oSub.HStatusID_New + ") "); |
| | | } |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //æ¾ç¤ºåæ® |
| | | public override bool ShowBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | //æ¥è¯¢ä¸»è¡¨ |
| | | DataSet Ds; |
| | | Ds = oCn.RunProcReturn("Select * from Sc_MouldStatusChangeBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MouldStatusChangeBillMain"); |
| | | if (Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "åæ®æªæ¾å°ï¼"; |
| | | return false; |
| | | } |
| | | //åºå®èµå¼=========================================== |
| | | omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); |
| | | omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); |
| | | omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); |
| | | omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); |
| | | omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); |
| | | omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); |
| | | omodel.HBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]); |
| | | omodel.HBillStatus = 1; |
| | | 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 = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | omodel.HBackDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBackDate"]); |
| | | omodel.HBacker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBacker"]); |
| | | omodel.HCheckDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckDate"]); |
| | | omodel.HChecker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HChecker"]); |
| | | omodel.HMaker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaker"]); |
| | | omodel.HMakeDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMakeDate"]); |
| | | omodel.HUpDateDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDateDate"]); |
| | | omodel.HUpDater = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDater"]); |
| | | omodel.HCloseDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseDate"]); |
| | | omodel.HCloseMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseMan"]); |
| | | omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); |
| | | omodel.HDeleteDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteDate"]); |
| | | omodel.HDeleteMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteMan"]); |
| | | omodel.HMainSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillType"]); |
| | | omodel.HMainSourceInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMainSourceInterID"]); |
| | | omodel.HMainSourceEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMainSourceEntryID"]); |
| | | omodel.HMainSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillNo"]); |
| | | omodel.HPrintQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPrintQty"]); |
| | | //======================================================== |
| | | omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); |
| | | omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); |
| | | omodel.HReason = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HReason"]); |
| | | omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); |
| | | omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); |
| | | |
| | | |
| | | //å¾ªç¯ |
| | | DataSet DsSub; |
| | | DsSub = oCn.RunProcReturn("Select * from Sc_MouldStatusChangeBillSub Where HInterID=" + lngBillKey.ToString(), "Sc_MouldStatusChangeBillSub"); |
| | | DetailColl.Clear();//æ¸
空 |
| | | for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) |
| | | { |
| | | Model.ClsSc_MouldStatusChangeBillSub oSub = new Model.ClsSc_MouldStatusChangeBillSub(); |
| | | // åºå®èµå¼=============================================== |
| | | oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); |
| | | 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 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillType"]); |
| | | oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillNo"]); |
| | | oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); |
| | | oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); |
| | | 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 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HRemark"]); |
| | | oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBillNo_bak"]); |
| | | //=================================================== |
| | | oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); |
| | | oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]); |
| | | oSub.HQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQty"]); |
| | | oSub.HStatusID_Old = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HStatusID_Old"]); |
| | | oSub.HStatusID_New = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HStatusID_New"]); |
| | | |
| | | DetailColl.Add(oSub); |
| | | } |
| | | sReturn = "æ¾ç¤ºåæ®æåï¼"; |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | throw (e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CareFor_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CheckToolsType_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CustLocation_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_EquipStatus_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_MouldStatus_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Operator_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_RateType_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Staff_Model.cs" /> |
| | |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldEntrustOutPlanBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldLifeChangeBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldLifeChangeBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldLifeUseBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldLifeUseBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldMaintainBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldMaintainBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldMaintainPlanBillMain.cs" /> |
| | |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldReportBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldScrapRequestBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldScrapRequestBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldStatusChangeBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldStatusChangeBillSub.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldStockBillMain.cs" /> |
| | | <Compile Include="ç产管ç\模å
·ç®¡ç\ClsSc_MouldStockBillSub.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipConkBookBillMain.cs" /> |
| | |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipSparepartsBillSub.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipSparepartsChangeBillMain.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipSparepartsChangeBillSub.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipStatusChangeBillMain.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipStatusChangeBillSub.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSc_EquipMaintainBillSub_Item.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSc_EquipMaintainPlanBillSub_Item.cs" /> |
| | | <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSc_ICMOBillMain.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsGy_EquipStatus_Model : DBUtility.ClsGy_Base_Model |
| | | { |
| | | public DateTime HMakeTime { get; set; } |
| | | public DateTime HCheckTime { get; set; } |
| | | public DateTime HModifyTime { get; set; } |
| | | public DateTime HStopTime { get; set; } |
| | | public string HMakeEmp { get; set; } |
| | | public string HCheckEmp { get; set; } |
| | | public string HModifyEmp { get; set; } |
| | | public string HStopEmp { get; set; } |
| | | public int HUSEORGID { get; set; } |
| | | public int HCREATEORGID { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsGy_MouldStatus_Model : DBUtility.ClsGy_Base_Model |
| | | { |
| | | public DateTime HMakeTime { get; set; } |
| | | public DateTime HCheckTime { get; set; } |
| | | public DateTime HModifyTime { get; set; } |
| | | public DateTime HStopTime { get; set; } |
| | | public string HMakeEmp { get; set; } |
| | | public string HCheckEmp { get; set; } |
| | | public string HModifyEmp { get; set; } |
| | | public string HStopEmp { get; set; } |
| | | public int HUSEORGID { get; set; } |
| | | public int HCREATEORGID { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSc_MouldLifeUseBillMain : DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | public Int64 HPrintQty; //æå°æ¬¡æ° |
| | | public Int64 HMangerID; //è´è´£äºº |
| | | public Int64 HDeptID; //é¨é¨ |
| | | public string HReason; //è°æ´åå |
| | | public string HExplanation; //æè¦ |
| | | public string HInnerBillNo; //å
é¨åæ®å· |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSc_MouldLifeUseBillSub : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public string HBillNo_bak; //åæ®å·ï¼å¤ä»½ï¼ä»¥å
å
ç ä¸¢å¤±ï¼æ¾ä¸å°å¯¹åºä¸»è¡¨ï¼ |
| | | public Int64 HItemSubID; //èªå¢å(GUID) |
| | | public Int64 HMaterID; //å¨å
· |
| | | public Int64 HUnitID; //æ°å¨å
· |
| | | public double HDesignLife; // --è®¾è®¡å¯¿å½ |
| | | public double HLeaveLife; //--åå©ä½å¯¿å½ |
| | | public double HUseLife; // --æ¬æ¬¡èç¨ |
| | | public double HNewLeaveLife;// --æ¬æ¬¡å©ä½å¯¿å½ |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSc_MouldStatusChangeBillMain : DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | public Int64 HPrintQty; //æå°æ¬¡æ° |
| | | public Int64 HEmpID; //ç³è¯·äºº |
| | | public Int64 HDeptID; //é¨é¨ |
| | | public string HReason; //åæ´åå |
| | | public string HExplanation; //æè¦ |
| | | public string HInnerBillNo; //å
é¨åæ®å· |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSc_MouldStatusChangeBillSub : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public string HBillNo_bak; //åæ®å·ï¼å¤ä»½ï¼ä»¥å
å
ç ä¸¢å¤±ï¼æ¾ä¸å°å¯¹åºä¸»è¡¨ï¼ |
| | | public Int64 HItemSubID; //èªå¢å(GUID) |
| | | public Int64 HMaterID; |
| | | public Int64 HUnitID; |
| | | public decimal HQtyMust; |
| | | public decimal HQty; |
| | | public Int64 HStatusID_Old; |
| | | public Int64 HStatusID_New; |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSb_EquipStatusChangeBillMain : DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | public Int64 HPrintQty; //æå°æ¬¡æ° |
| | | public Int64 HEmpID; //ç³è¯·äºº |
| | | public Int64 HDeptID; //é¨é¨ |
| | | public string HReason; //åæ´åå |
| | | public string HExplanation; //æè¦ |
| | | public string HInnerBillNo; //å
é¨åæ®å· |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsSb_EquipStatusChangeBillSub : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public string HBillNo_bak; //åæ®å·ï¼å¤ä»½ï¼ä»¥å
å
ç ä¸¢å¤±ï¼æ¾ä¸å°å¯¹åºä¸»è¡¨ï¼ |
| | | public Int64 HItemSubID; //èªå¢å(GUID) |
| | | public Int64 HEquipID; |
| | | public Int64 HUnitID; |
| | | public decimal HQtyMust; |
| | | public decimal HQty; |
| | | public Int64 HStatusID_Old; |
| | | public Int64 HStatusID_New; |
| | | } |
| | | } |
New file |
| | |
| | | using DBUtility; |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Converters; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.MJGL |
| | | { |
| | | public class Sc_MouldLifeUseBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region [å¨å
·å¯¿å½èç¨åå表] |
| | | [Route("Sc_MouldLifeUseBill/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_MouldLifeUseBillList order by HMainID asc", "h_v_Sc_MouldLifeUseBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldLifeUseBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by HMainID asc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldLifeUseBillList"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [æ ¹æ®IDæ¥æ¾è®°å½] |
| | | [Route("Sc_MouldLifeUseBill/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_MouldLifeUseBillList where HMainID =" + HInterID, "h_v_Sc_MouldLifeUseBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å¨å
·å¯¿å½èç¨å ä¿å/ç¼è¾åè½ |
| | | [Route("Sc_MouldLifeUseBill/MouldLifeUseBillEdit")] |
| | | [HttpPost] |
| | | public object MouldLifeUseBillEdit([FromBody] JObject sMainSub) |
| | | { |
| | | try |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | oCN.BeginTran(); |
| | | //ä¿å主表 |
| | | objJsonResult = AddBillMain(msg1); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®ä¿åæåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillMain(string msg1) |
| | | { |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); //ä¸»è¡¨æ°æ® |
| | | string msg3 = sArray[1].ToString(); //åè¡¨æ°æ® |
| | | int OperationType = int.Parse(sArray[2].ToString()); // æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ |
| | | string user = sArray[3].ToString(); |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsSc_MouldLifeUseBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldLifeUseBillMain>>(msg2); |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | long HBillStatus = 1;//åæ®ç¶æ |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | | string HRemark = mainList[0].HRemark;//夿³¨ |
| | | long HMangerID = mainList[0].HMangerID;//è´è´£äºº |
| | | long HDeptID = mainList[0].HDeptID;//é¨é¨ |
| | | string HReason = mainList[0].HReason;//åæ´åå |
| | | string HExplanation = mainList[0].HExplanation;//æè¦ |
| | | string HMaker = user;//å¶å人 |
| | | |
| | | DateTime dt = DateTime.Now; |
| | | |
| | | |
| | | |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_POOrderBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2))//æ°å¢ && ds.Tables[0].Rows.Count == 0 |
| | | { |
| | | //DataSet Ds; |
| | | //Int64 NewHInterID = 1; |
| | | //Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_POOrderBillMain", "Cg_POOrderBillMain"); |
| | | //if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0) |
| | | //{ |
| | | // NewHInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()); |
| | | // NewHInterID += 1; |
| | | //} |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Sc_MouldLifeUseBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID |
| | | ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HMangerID,HDeptID,HReason,HExplanation,HInnerBillNo) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3845 + "','" + |
| | | mainList[0].HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + mainList[0].HRemark + |
| | | "','" + mainList[0].HBackRemark + "','" + mainList[0].HMaker + "','" + dt + "','" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID + |
| | | "," + mainList[0].HMainSourceEntryID + ",'" + mainList[0].HMainSourceBillNo + "'," + mainList[0].HPrintQty + "," + mainList[0].HMangerID + "," + mainList[0].HDeptID + ",'" + HReason + "','" + HExplanation + "','" + mainList[0].HInnerBillNo + "'" + ")"); |
| | | } |
| | | else if (OperationType == 3)//|| ds.Tables[0].Rows.Count != 0 |
| | | { //ä¿®æ¹ |
| | | oCN.RunProc("update Sc_MouldLifeUseBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + ",HReason='" + HReason + |
| | | "',HExplanation='" + HExplanation + "',HMangerID=" + HMangerID + ",HDeptID=" + HDeptID + " where HInterID=" + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Sc_MouldLifeUseBillSub where HInterID='" + HInterID + "'"); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType, HBillNo); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg3, long HInterID, int OperationType, string HBillNo) |
| | | { |
| | | List<ClsSc_MouldLifeUseBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldLifeUseBillSub>>(msg3); |
| | | |
| | | |
| | | |
| | | int i = 0; |
| | | foreach (ClsSc_MouldLifeUseBillSub oSub in DetailColl) |
| | | { |
| | | i++; |
| | | |
| | | DataSet Cs; |
| | | Int64 NewHEntryID = 1; |
| | | Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Sc_MouldLifeUseBillSub", "Sc_MouldLifeUseBillSub"); |
| | | if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0) |
| | | { |
| | | NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()); |
| | | NewHEntryID += 1; |
| | | } |
| | | |
| | | oCN.RunProc($@"Insert into Sc_MouldLifeUseBillSub |
| | | (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty |
| | | ,HRelationMoney,HMaterID,HUnitID,HDesignLife,HLeaveLife,HUseLife,HNewLeaveLife) |
| | | values({HInterID},{NewHEntryID},'{ HBillNo }','{oSub.HRemark}',{oSub.HSourceInterID} |
| | | ,{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney},{oSub.HMaterID},{oSub.HUnitID},{oSub.HDesignLife},{oSub.HLeaveLife},{oSub.HUseLife},{oSub.HNewLeaveLife})"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region [å é¤] |
| | | [Route("Sc_MouldLifeUseBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Sc_MouldLifeUseBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Sc_MouldLifeUseBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using DBUtility; |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Converters; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.MJGL |
| | | { |
| | | public class Sc_MouldScrapRequestBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region [å¨å
·æ¥åºç³è¯·åå表] |
| | | [Route("Sc_MouldScrapRequestBill/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_MouldScrapRequestBillList order by HMainID asc", "h_v_Sc_MouldScrapRequestBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldScrapRequestBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by HMainID asc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldScrapRequestBillList"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [æ ¹æ®IDæ¥æ¾è®°å½] |
| | | [Route("Sc_MouldScrapRequestBill/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_MouldScrapRequestBillList where hmainid =" + HInterID, "h_v_Sc_MouldScrapRequestBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å¨å
·æ¥åºç³è¯·å ä¿å/ç¼è¾åè½ |
| | | [Route("Sc_MouldScrapRequestBill/MouldScrapRequestBillEdit")] |
| | | [HttpPost] |
| | | public object MouldScrapRequestBillEdit([FromBody] JObject sMainSub) |
| | | { |
| | | try |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | oCN.BeginTran(); |
| | | //ä¿å主表 |
| | | objJsonResult = AddBillMain(msg1); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®ä¿åæåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillMain(string msg1) |
| | | { |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); //ä¸»è¡¨æ°æ® |
| | | string msg3 = sArray[1].ToString(); //åè¡¨æ°æ® |
| | | int OperationType = int.Parse(sArray[2].ToString()); // æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ |
| | | string user = sArray[3].ToString(); |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsSc_MouldScrapRequestBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldScrapRequestBillMain>>(msg2); |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | long HBillStatus = 1;//åæ®å· |
| | | long HPRDORGID = mainList[0].HPRDORGID;//ç»ç» |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | | string HRemark = mainList[0].HRemark;//夿³¨ |
| | | long HEmpID = mainList[0].HEmpID;//ç³è¯·äºº |
| | | long HDeptID = mainList[0].HDeptID;//é¨é¨ |
| | | long HMangerID = mainList[0].HMangerID;//è´è´£äºº |
| | | long HWHID = mainList[0].HWHID;//æ¥åºä»åº |
| | | string HReason = mainList[0].HReason;//æ¥åºåå |
| | | string HMaker = user;//å¶å人 |
| | | |
| | | DateTime dt = DateTime.Now; |
| | | |
| | | |
| | | |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_POOrderBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2))//æ°å¢ && ds.Tables[0].Rows.Count == 0 |
| | | { |
| | | //DataSet Ds; |
| | | //Int64 NewHInterID = 1; |
| | | //Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_POOrderBillMain", "Cg_POOrderBillMain"); |
| | | //if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0) |
| | | //{ |
| | | // NewHInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()); |
| | | // NewHInterID += 1; |
| | | //} |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Sc_MouldScrapRequestBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HReason,HExplanation,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceInterID |
| | | ,HMainSourceEntryID,HMainSourceBillNo,HEmpID,HDeptID,HMangerID,HWHID,HCheckItemNowID |
| | | ,HCheckItemNextID,HCheckFlowID,HBacker,HChecker,HUpDater,HCloseMan,HCloseType,HDeleteMan,HInnerBillNo) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3823 + "','" + |
| | | 3823 + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HReason + "','" + mainList[0].HExplanation + "','" + mainList[0].HRemark + |
| | | "','" + mainList[0].HBackRemark + "','" + mainList[0].HMaker + "','" + dt + "'," + mainList[0].HMainSourceInterID + |
| | | "," + mainList[0].HMainSourceEntryID + ",'" + mainList[0].HMainSourceBillNo + "'," + mainList[0].HEmpID + "," + mainList[0].HDeptID + "," + mainList[0].HMangerID + "," + mainList[0].HWHID + ",0,0,0" + ",'" + mainList[0].HBacker + "','" + mainList[0].HChecker + "','" + mainList[0].HUpDater + "','" + mainList[0].HCloseMan + "'," + 0 + ",'" + mainList[0].HDeleteMan + "','" + mainList[0].HInnerBillNo + "'" + ")"); |
| | | } |
| | | else if (OperationType == 3)//|| ds.Tables[0].Rows.Count != 0 |
| | | { //ä¿®æ¹ |
| | | oCN.RunProc("update Sc_MouldScrapRequestBillMain set " + |
| | | "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + |
| | | ",HEmpID=" + HEmpID + ",HDeptID=" + HDeptID + ",HMangerID=" + HMangerID + |
| | | ",HReason='" + HReason + "'" + |
| | | ",HWHID=" + HWHID + " where HInterID=" + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Sc_MouldScrapRequestBillSub where HInterID='" + HInterID + "'"); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg3, long HInterID, int OperationType) |
| | | { |
| | | List<ClsSc_MouldScrapRequestBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldScrapRequestBillSub>>(msg3); |
| | | |
| | | |
| | | |
| | | int i = 0; |
| | | foreach (ClsSc_MouldScrapRequestBillSub oSub in DetailColl) |
| | | { |
| | | i++; |
| | | |
| | | DataSet Cs; |
| | | Int64 NewHEntryID = 1; |
| | | Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Sc_MouldScrapRequestBillSub", "Sc_MouldScrapRequestBillSub"); |
| | | if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0) |
| | | { |
| | | NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()); |
| | | NewHEntryID += 1; |
| | | } |
| | | |
| | | oCN.RunProc($@"Insert into Sc_MouldScrapRequestBillSub |
| | | (HInterID,HEntryID,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty |
| | | ,HRelationMoney,HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HWHID) |
| | | values({HInterID},{NewHEntryID},'{oSub.HRemark}',{oSub.HSourceInterID} |
| | | ,{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney},{oSub.HMaterID} |
| | | ,{oSub.HPropertyID},{oSub.HSecUnitID},{oSub.HSecUnitRate},{oSub.HUnitID},0,{oSub.HQty},{oSub.HPrice},{oSub.HMoney},{oSub.HDesignLife} |
| | | ,{oSub.HLeaveLife},{oSub.HWHID})"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region [å é¤] |
| | | [Route("Sc_MouldScrapRequestBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Sc_MouldScrapRequestBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Sc_MouldScrapRequestBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using DBUtility; |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Converters; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.MJGL |
| | | { |
| | | public class Sc_MouldStatusChangeBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region [å¨å
·ç¶æåæ´åå表] |
| | | [Route("Sc_MouldStatusChangeBill/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_MouldStatusChangeBillList order by HMainID asc", "h_v_Sc_MouldStatusChangeBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldStatusChangeBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by HMainID asc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldStatusChangeBillList"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [æ ¹æ®IDæ¥æ¾è®°å½] |
| | | [Route("Sc_MouldStatusChangeBill/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_MouldStatusChangeBillList where HMainID =" + HInterID, "h_v_Sc_MouldStatusChangeBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å¨å
·ç¶æåæ´å ä¿å/ç¼è¾åè½ |
| | | [Route("Sc_MouldStatusChangeBill/MouldStatusChangeBillEdit")] |
| | | [HttpPost] |
| | | public object BarCodeStatusChangeBillEdit([FromBody] JObject sMainSub) |
| | | { |
| | | try |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | oCN.BeginTran(); |
| | | //ä¿å主表 |
| | | objJsonResult = AddBillMain(msg1); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®ä¿åæåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillMain(string msg1) |
| | | { |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); //ä¸»è¡¨æ°æ® |
| | | string msg3 = sArray[1].ToString(); //åè¡¨æ°æ® |
| | | int OperationType = int.Parse(sArray[2].ToString()); // æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ |
| | | string user = sArray[3].ToString(); |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsSc_MouldStatusChangeBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldStatusChangeBillMain>>(msg2); |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | long HBillStatus = 1;//åæ®ç¶æ |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | | string HRemark = mainList[0].HRemark;//夿³¨ |
| | | long HEmpID = mainList[0].HEmpID;//è´è´£äºº |
| | | long HDeptID = mainList[0].HDeptID;//é¨é¨ |
| | | string HReason = mainList[0].HReason;//åæ´åå |
| | | string HExplanation = mainList[0].HExplanation;//æè¦ |
| | | string HMaker = user;//å¶å人 |
| | | |
| | | DateTime dt = DateTime.Now; |
| | | |
| | | |
| | | |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_POOrderBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2))//æ°å¢ && ds.Tables[0].Rows.Count == 0 |
| | | { |
| | | //DataSet Ds; |
| | | //Int64 NewHInterID = 1; |
| | | //Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_POOrderBillMain", "Cg_POOrderBillMain"); |
| | | //if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0) |
| | | //{ |
| | | // NewHInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()); |
| | | // NewHInterID += 1; |
| | | //} |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Sc_MouldStatusChangeBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID |
| | | ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HEmpID,HDeptID,HReason,HExplanation,HInnerBillNo) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3844 + "','" + |
| | | mainList[0].HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + mainList[0].HRemark + |
| | | "','" + mainList[0].HBackRemark + "','" + mainList[0].HMaker + "','" + dt + "','" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID + |
| | | "," + mainList[0].HMainSourceEntryID + ",'" + mainList[0].HMainSourceBillNo + "'," + mainList[0].HPrintQty + "," + mainList[0].HEmpID + "," + mainList[0].HDeptID + ",'" + HReason + "','" + HExplanation + "','" + mainList[0].HInnerBillNo + "'" + ")"); |
| | | } |
| | | else if (OperationType == 3)//|| ds.Tables[0].Rows.Count != 0 |
| | | { //ä¿®æ¹ |
| | | oCN.RunProc("update Sc_MouldStatusChangeBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + ",HReason='" + HReason + |
| | | "',HExplanation='" + HExplanation + "',HEmpID=" + HEmpID + ",HDeptID=" + HDeptID + " where HInterID=" + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Sc_MouldStatusChangeBillSub where HInterID='" + HInterID + "'"); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType, HBillNo); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg3, long HInterID, int OperationType,string HBillNo) |
| | | { |
| | | List<ClsSc_MouldStatusChangeBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldStatusChangeBillSub>>(msg3); |
| | | |
| | | |
| | | |
| | | int i = 0; |
| | | foreach (ClsSc_MouldStatusChangeBillSub oSub in DetailColl) |
| | | { |
| | | i++; |
| | | |
| | | DataSet Cs; |
| | | Int64 NewHEntryID = 1; |
| | | Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Sc_MouldStatusChangeBillSub", "Sc_MouldStatusChangeBillSub"); |
| | | if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0) |
| | | { |
| | | NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()); |
| | | NewHEntryID += 1; |
| | | } |
| | | |
| | | oCN.RunProc($@"Insert into Sc_MouldStatusChangeBillSub |
| | | (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty |
| | | ,HRelationMoney,HMaterID,HUnitID,HQtyMust,HQty,HStatusID_Old,HStatusID_New) |
| | | values({HInterID},{NewHEntryID},'{ HBillNo }','{oSub.HRemark}',{oSub.HSourceInterID} |
| | | ,{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney},{oSub.HMaterID},{oSub.HUnitID},{0},{oSub.HQty},{oSub.HStatusID_Old},{oSub.HStatusID_New})"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region [å é¤] |
| | | [Route("Sc_MouldStatusChangeBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Sc_MouldStatusChangeBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Sc_MouldStatusChangeBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using DBUtility; |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Converters; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | |
| | | namespace WebAPI.Controllers.SBGL |
| | | { |
| | | public class Sb_EquipStatusChangeBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region [设å¤ç¶æåæ´åå表] |
| | | [Route("Sb_EquipStatusChangeBill/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Sb_EquipStatusChangeBillList order by HMainID asc", "h_v_Sb_EquipStatusChangeBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sb_EquipStatusChangeBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by HMainID asc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipStatusChangeBillList"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [æ ¹æ®IDæ¥æ¾è®°å½] |
| | | [Route("Sb_EquipStatusChangeBill/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sb_EquipStatusChangeBillList where HMainID =" + HInterID, "h_v_Sb_EquipStatusChangeBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 设å¤ç¶æåæ´å ä¿å/ç¼è¾åè½ |
| | | [Route("Sb_EquipStatusChangeBill/EquipStatusChangeBillEdit")] |
| | | [HttpPost] |
| | | public object BarCodeStatusChangeBillEdit([FromBody] JObject sMainSub) |
| | | { |
| | | try |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | oCN.BeginTran(); |
| | | //ä¿å主表 |
| | | objJsonResult = AddBillMain(msg1); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®ä¿åæåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillMain(string msg1) |
| | | { |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); //ä¸»è¡¨æ°æ® |
| | | string msg3 = sArray[1].ToString(); //åè¡¨æ°æ® |
| | | int OperationType = int.Parse(sArray[2].ToString()); // æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ |
| | | string user = sArray[3].ToString(); |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsSb_EquipStatusChangeBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSb_EquipStatusChangeBillMain>>(msg2); |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | long HBillStatus = 1;//åæ®ç¶æ |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | | string HRemark = mainList[0].HRemark;//夿³¨ |
| | | long HEmpID = mainList[0].HEmpID;//ç³è¯·äºº |
| | | long HDeptID = mainList[0].HDeptID;//é¨é¨ |
| | | string HReason = mainList[0].HReason;//åæ´åå |
| | | string HExplanation = mainList[0].HExplanation;//æè¦ |
| | | string HMaker = user;//å¶å人 |
| | | |
| | | DateTime dt = DateTime.Now; |
| | | |
| | | |
| | | |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_POOrderBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2))//æ°å¢ && ds.Tables[0].Rows.Count == 0 |
| | | { |
| | | //DataSet Ds; |
| | | //Int64 NewHInterID = 1; |
| | | //Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_POOrderBillMain", "Cg_POOrderBillMain"); |
| | | //if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0) |
| | | //{ |
| | | // NewHInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()); |
| | | // NewHInterID += 1; |
| | | //} |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Sb_EquipStatusChangeBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID |
| | | ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HEmpID,HDeptID,HReason,HExplanation,HInnerBillNo) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3844 + "','" + |
| | | mainList[0].HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + mainList[0].HRemark + |
| | | "','" + mainList[0].HBackRemark + "','" + mainList[0].HMaker + "','" + dt + "','" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID + |
| | | "," + mainList[0].HMainSourceEntryID + ",'" + mainList[0].HMainSourceBillNo + "'," + mainList[0].HPrintQty + "," + mainList[0].HEmpID + "," + mainList[0].HDeptID + ",'" + HReason + "','" + HExplanation + "','" + mainList[0].HInnerBillNo + "'" + ")"); |
| | | } |
| | | else if (OperationType == 3)//|| ds.Tables[0].Rows.Count != 0 |
| | | { //ä¿®æ¹ |
| | | oCN.RunProc("update Sb_EquipStatusChangeBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + ",HReason='" + HReason + |
| | | "',HExplanation='" + HExplanation + "',HEmpID=" + HEmpID + ",HDeptID=" + HDeptID + " where HInterID=" + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Sb_EquipStatusChangeBillSub where HInterID='" + HInterID + "'"); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType, HBillNo); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg3, long HInterID, int OperationType, string HBillNo) |
| | | { |
| | | List<ClsSb_EquipStatusChangeBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSb_EquipStatusChangeBillSub>>(msg3); |
| | | |
| | | |
| | | |
| | | int i = 0; |
| | | foreach (ClsSb_EquipStatusChangeBillSub oSub in DetailColl) |
| | | { |
| | | i++; |
| | | |
| | | DataSet Cs; |
| | | Int64 NewHEntryID = 1; |
| | | Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Sb_EquipStatusChangeBillSub", "Sb_EquipStatusChangeBillSub"); |
| | | if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0) |
| | | { |
| | | NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()); |
| | | NewHEntryID += 1; |
| | | } |
| | | |
| | | oCN.RunProc($@"Insert into Sb_EquipStatusChangeBillSub |
| | | (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty |
| | | ,HRelationMoney,HEquipID,HUnitID,HQtyMust,HQty,HStatusID_Old,HStatusID_New) |
| | | values({HInterID},{NewHEntryID},'{ HBillNo }','{oSub.HRemark}',{oSub.HSourceInterID} |
| | | ,{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney},{oSub.HEquipID},{oSub.HUnitID},{0},{oSub.HQty},{oSub.HStatusID_Old},{oSub.HStatusID_New})"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region [å é¤] |
| | | [Route("Sb_EquipStatusChangeBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Sb_EquipStatusChangeBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Sb_EquipStatusChangeBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ |
| | | { |
| | | public class Gy_EquipStatusController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region 设å¤ç¶æ å表 |
| | | [Route("Gy_EquipStatus/Gy_EquipStatusList")] |
| | | [HttpGet] |
| | | public object Gy_EquipStatusList(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sql1 = string.Format(@"select * from h_v_Gy_EquipStatus where 使ç¨ç»ç»='" + Organization + "'"); |
| | | |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_EquipStatus"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 设å¤ç¶æ ç¼è¾ |
| | | [Route("Gy_EquipStatus/Gy_EquipStatusEdit")] |
| | | [HttpPost] |
| | | public object Gy_EquipStatusEdit([FromBody] JObject msg) |
| | | { |
| | | DataSet ds; |
| | | var _value = msg["msg"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | //string msg_HUSEORGID = sArray[2].ToString(); |
| | | Int64 HItemID = 0; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | ListModels oListModels = new ListModels(); |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_EquipStatus_Ctl oBill = new DAL.ClsGy_EquipStatus_Ctl(); |
| | | List<Model.ClsGy_EquipStatus_Model> lsmain = new List<Model.ClsGy_EquipStatus_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_EquipStatus(msg1); |
| | | foreach (Model.ClsGy_EquipStatus_Model oItem in lsmain) |
| | | { |
| | | if (oItem.HNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (oItem.HName.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼åç§°ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //æ¥è¯¢æ°æ®ä¸æ¯å¦åå¨éå¤ä»£ç |
| | | ds = oCN.RunProcReturn("select * from Gy_EquipStatus where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_EquipStatus"); |
| | | if (oItem.HItemID == 0) |
| | | { |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString()) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //æ°å¢æ¶å¤æ |
| | | #region ç¶çº§æ ¡éªæ¹æ³ï¼apiè°ç¨å
注éæï¼ï¼ |
| | | /* |
| | | if (oItem.HItemID == 0) |
| | | { |
| | | if (ds == null || ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //æ£æ¥ç¶çº§æ¯å¦åå¨ |
| | | string sParent; |
| | | sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); |
| | | if (sParent.Trim() == "") |
| | | { |
| | | oBill.oModel.HParentID = 0; |
| | | } |
| | | else |
| | | { |
| | | if (oBill.HavParentCode(sParent.Trim(), HItemID)) |
| | | { |
| | | oBill.oModel.HParentID = oBill.oModel.HItemID; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else//ç¼è¾æ¶å¤æ |
| | | { |
| | | //æ£æ¥ç¶çº§æ¯å¦åå¨ |
| | | string sParent; |
| | | sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); |
| | | if (sParent.Trim() == "") |
| | | { |
| | | oBill.oModel.HParentID = 0; |
| | | } |
| | | else |
| | | { |
| | | if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID)) |
| | | { |
| | | oBill.oModel.HParentID = oBill.oModel.HItemID; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | */ |
| | | #endregion |
| | | //å¾å°ç代ç |
| | | string sShortNumber; |
| | | sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); |
| | | if (sShortNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //oItem.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //ç»ç»id |
| | | oItem.HShortNumber = sShortNumber;//ç代ç |
| | | oItem.HEndFlag = true;//æ«çº§æ å¿ |
| | | oItem.HLevel = 1; //ç级 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()) |
| | | oBill.oModel = oItem; |
| | | } |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (oBill.oModel.HItemID == 0) |
| | | { |
| | | bResult = oBill.AddNew(); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyByID(oBill.oModel.HItemID); |
| | | } |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | 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) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 设å¤ç¶æ å é¤ |
| | | [Route("Gy_EquipStatus/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | if (string.IsNullOrWhiteSpace(HItemID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HItemID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | ds = oCN.RunProcReturn("select * from Gy_EquipStatus where HItemID=" + HItemID, "Gy_EquipStatus"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | if (HStopflag) |
| | | { |
| | | oCN.RollBack();//åæ»äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ°æ®å·²ç¦ç¨æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("delete from Gy_EquipStatus where HItemID=" + HItemID); |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | |
| | | namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ |
| | | { |
| | | public class Gy_MouldStatusController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region å¨å
·ç¶æ å表 |
| | | [Route("Gy_MouldStatus/Gy_MouldStatusList")] |
| | | [HttpGet] |
| | | public object Gy_MouldStatusList(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sql1 = string.Format(@"select * from h_v_Gy_MouldStatus where 使ç¨ç»ç»='" + Organization + "'"); |
| | | |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_MouldStatus"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å¨å
·ç¶æ ç¼è¾ |
| | | [Route("Gy_MouldStatus/Gy_MouldStatusEdit")] |
| | | [HttpPost] |
| | | public object Gy_MouldStatusEdit([FromBody] JObject msg) |
| | | { |
| | | DataSet ds; |
| | | var _value = msg["msg"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | //string msg_HUSEORGID = sArray[2].ToString(); |
| | | Int64 HItemID = 0; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | ListModels oListModels = new ListModels(); |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_MouldStatus_Ctl oBill = new DAL.ClsGy_MouldStatus_Ctl(); |
| | | List<Model.ClsGy_MouldStatus_Model> lsmain = new List<Model.ClsGy_MouldStatus_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_MouldStatus(msg1); |
| | | foreach (Model.ClsGy_MouldStatus_Model oItem in lsmain) |
| | | { |
| | | if (oItem.HNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (oItem.HName.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼åç§°ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //æ¥è¯¢æ°æ®ä¸æ¯å¦åå¨éå¤ä»£ç |
| | | ds = oCN.RunProcReturn("select * from Gy_MouldStatus where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_MouldStatus"); |
| | | if (oItem.HItemID == 0) |
| | | { |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString()) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //æ°å¢æ¶å¤æ |
| | | #region ç¶çº§æ ¡éªæ¹æ³ï¼apiè°ç¨å
注éæï¼ï¼ |
| | | /* |
| | | if (oItem.HItemID == 0) |
| | | { |
| | | if (ds == null || ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //æ£æ¥ç¶çº§æ¯å¦åå¨ |
| | | string sParent; |
| | | sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); |
| | | if (sParent.Trim() == "") |
| | | { |
| | | oBill.oModel.HParentID = 0; |
| | | } |
| | | else |
| | | { |
| | | if (oBill.HavParentCode(sParent.Trim(), HItemID)) |
| | | { |
| | | oBill.oModel.HParentID = oBill.oModel.HItemID; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else//ç¼è¾æ¶å¤æ |
| | | { |
| | | //æ£æ¥ç¶çº§æ¯å¦åå¨ |
| | | string sParent; |
| | | sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); |
| | | if (sParent.Trim() == "") |
| | | { |
| | | oBill.oModel.HParentID = 0; |
| | | } |
| | | else |
| | | { |
| | | if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID)) |
| | | { |
| | | oBill.oModel.HParentID = oBill.oModel.HItemID; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | */ |
| | | #endregion |
| | | //å¾å°ç代ç |
| | | string sShortNumber; |
| | | sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); |
| | | if (sShortNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //oItem.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //ç»ç»id |
| | | oItem.HShortNumber = sShortNumber;//ç代ç |
| | | oItem.HEndFlag = true;//æ«çº§æ å¿ |
| | | oItem.HLevel = 1; //ç级 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()) |
| | | oBill.oModel = oItem; |
| | | } |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (oBill.oModel.HItemID == 0) |
| | | { |
| | | bResult = oBill.AddNew(); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyByID(oBill.oModel.HItemID); |
| | | } |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | 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) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å¨å
·ç¶æ å é¤ |
| | | [Route("Gy_MouldStatus/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | if (string.IsNullOrWhiteSpace(HItemID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HItemID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | ds = oCN.RunProcReturn("select * from Gy_MouldStatus where HItemID=" + HItemID, "Gy_MouldStatus"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | if (HStopflag) |
| | | { |
| | | oCN.RollBack();//åæ»äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ°æ®å·²ç¦ç¨æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("delete from Gy_MouldStatus where HItemID=" + HItemID); |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çå¨å
·ç¶æè¡¨çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsGy_MouldStatus_Model> getObjectByJson_Gy_MouldStatus(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsGy_MouldStatus_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_MouldStatus_Model>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤ç设å¤ç¶æè¡¨çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsGy_EquipStatus_Model> getObjectByJson_Gy_EquipStatus(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsGy_EquipStatus_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_EquipStatus_Model>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çåæ®ç±»å表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | |
| | | <Compile Include="Controllers\CJGL\Cj_StationEntrustOutBillController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Sc_WorkBillAutoSortBillMainController.cs" /> |
| | | <Compile Include="Controllers\Gy_MateMouldController.cs" /> |
| | | <Compile Include="Controllers\MJGL\Sc_MouldLifeUseBillController.cs" /> |
| | | <Compile Include="Controllers\MJGL\Sc_MouldScrapRequestBillController.cs" /> |
| | | <Compile Include="Controllers\MJGL\Sc_MouldStatusChangeBillController.cs" /> |
| | | <Compile Include="Controllers\Pay_ReportController.cs" /> |
| | | <Compile Include="Controllers\SBGL\Sb_EquipSparepartsBillController.cs" /> |
| | | <Compile Include="Controllers\SBGL\Sb_EquipSparepartsChangeBillController.cs" /> |
| | | <Compile Include="Controllers\SBGL\Sb_EquipStatusChangeBillController.cs" /> |
| | | <Compile Include="Controllers\SCGL\Sc_ComplementGoodBill_ZXBZController.cs" /> |
| | | <Compile Include="Controllers\SCGL\æ¥è®¡å管ç\DataHelper.cs" /> |
| | | <Compile Include="Controllers\SCGL\æ¥è®¡å管ç\JIT_Cg_PODemandPlanBillController.cs" /> |
| | |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_COMMONCONTACTBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_CustLocationController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_DutyBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_EquipStatusController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_MatePriceSupController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_MouldStatusController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_OperatorController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_PaymentConditionListBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_RateTypeController.cs" /> |
| | |
| | | <Folder Include="Views\Gy_ConkType\" /> |
| | | <Folder Include="Views\Gy_CustLocation\" /> |
| | | <Folder Include="Views\Gy_DutyBill\" /> |
| | | <Folder Include="Views\Gy_EquipStatus\" /> |
| | | <Folder Include="Views\Gy_EquipType\" /> |
| | | <Folder Include="Views\Gy_ICBomBill\" /> |
| | | <Folder Include="Views\Gy_MateMould\" /> |
| | | <Folder Include="Views\Gy_MatePriceSup\" /> |
| | | <Folder Include="Views\Gy_MouldStatus\" /> |
| | | <Folder Include="Views\Gy_Operator\" /> |
| | | <Folder Include="Views\Gy_PackType\" /> |
| | | <Folder Include="Views\Gy_PaymentConditionListBill\" /> |
| | |
| | | <Folder Include="Views\Sb_EquipRepairSendWorkBill\" /> |
| | | <Folder Include="Views\Sb_EquipSparepartsBill\" /> |
| | | <Folder Include="Views\Sb_EquipSparepartsChangeBill\" /> |
| | | <Folder Include="Views\Sb_EquipStatusChangeBill\" /> |
| | | <Folder Include="Views\Sc_CallGoodsBackRequestBill\" /> |
| | | <Folder Include="Views\Sc_ComplementGoodBill\" /> |
| | | <Folder Include="Views\Sc_ComplementGoodBill_ZXBZ\" /> |
| | | <Folder Include="Views\Sc_ComplementGoods\" /> |
| | | <Folder Include="Views\Sc_JIT_ComplementGoodBill\" /> |
| | | <Folder Include="Views\Sc_MouldLifeUseBill\" /> |
| | | <Folder Include="Views\Sc_MouldRepairOutBill\" /> |
| | | <Folder Include="Views\Sc_MouldRepairSendWorkBill\" /> |
| | | <Folder Include="Views\Sc_MouldScrapRequestBill\" /> |
| | | <Folder Include="Views\Sc_MouldStatusChangeBill\" /> |
| | | <Folder Include="Views\Sc_WorkBillAutoSortBillMain\" /> |
| | | <Folder Include="Views\Sc_WorkBillSortBill\" /> |
| | | <Folder Include="Views\Sc_WorkDemandPlanBill\" /> |