Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
| | |
| | | <Compile Include="人äºç®¡ç\ClsHR_EmpUpChangeBill.cs" /> |
| | | <Compile Include="ä»åºç®¡ç\æ¡ç 管ç\ClsGy_BarCodeBill_ChaiMa.cs" /> |
| | | <Compile Include="åºç¡èµæ\InterFaceåºç¡èµæ\ClsIF_ORGANIZATIONS_View.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_TaxRate_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_RecCondition_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_FactoryDayOff_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_FactoryDayOff_View.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_COMMONCONTACT_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_PaymentCondition_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_SupplierContact_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_StockStatus_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¶ä»åºç¡èµæ\ClsGy_MateMould_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¶ä»åºç¡èµæ\ClsGy_QCCheckProject_View.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¶ä»åºç¡èµæ\ClsGy_StdWorkTimes_Ctl.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_COMMONCONTACT_Ctl : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_COMMONCONTACT_Model oModel = new Model.ClsGy_COMMONCONTACT_Model(); |
| | | //æ°å¢ |
| | | public override bool AddNew() |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc($@"insert into Gy_COMMONCONTACT(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_COMMONCONTACT_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_COMMONCONTACT"; |
| | | MvarReportTitle = "æ¶è´§æ¹è系人"; |
| | | oModel = new Model.ClsGy_COMMONCONTACT_Model(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_PaymentCondition_Ctl:DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_PaymentCondition_Model oModel = new Model.ClsGy_PaymentCondition_Model(); |
| | | //æ°å¢ |
| | | public override bool AddNew() |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc($@"insert into Gy_PaymentCondition(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_PaymentCondition_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_PaymentCondition"; |
| | | MvarReportTitle = "仿¬¾æ¡ä»¶"; |
| | | oModel = new Model.ClsGy_PaymentCondition_Model(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_RecCondition_Ctl : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_RecCondition_Model oModel = new Model.ClsGy_RecCondition_Model(); |
| | | //æ°å¢ |
| | | public override bool AddNew() |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc($@"insert into Gy_RecCondition(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_RecCondition_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_RecCondition"; |
| | | MvarReportTitle = "æ¶æ¬¾æ¡ä»¶"; |
| | | oModel = new Model.ClsGy_RecCondition_Model(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_StockStatus_Ctl:DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_StockStatus_Model oModel = new Model.ClsGy_StockStatus_Model(); |
| | | //æ°å¢ |
| | | public override bool AddNew() |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc($@"insert into Gy_StockStatus(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_StockStatus_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_StockStatus"; |
| | | MvarReportTitle = "åºåç¶æ"; |
| | | oModel = new Model.ClsGy_StockStatus_Model(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_SupplierContact_Ctl:DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_SupplierContact_Model oModel = new Model.ClsGy_SupplierContact_Model(); |
| | | //æ°å¢ |
| | | public override bool AddNew() |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc($@"insert into Gy_SupplierContact(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_SupplierContact_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_SupplierContact"; |
| | | MvarReportTitle = "ä¾è´§æ¹è系人"; |
| | | oModel = new Model.ClsGy_SupplierContact_Model(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_TaxRate_Ctl:DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_TaxRate_Model oModel = new Model.ClsGy_TaxRate_Model(); |
| | | //æ°å¢ |
| | | public override bool AddNew() |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc($@"insert into Gy_TaxRate(HNumber,HName ,HTaxRate,HShortNumber ,HParentID ,HLevel |
| | | ,HEndFlag ,HStopflag ,HRemark ,HHelpCode ,HUseFlag |
| | | ,HMakeTime ,HMakeEmp ,HCheckEmp ,HCheckTime ,HModifyEmp |
| | | ,HModifyTime ,HStopEmp ,HStopTime ,HUSEORGID,HCREATEORGID) |
| | | values('{oModel.HNumber}','{oModel.HName}',{oModel.HTaxRate},'{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 + "'" + |
| | | ",HTaxRate='" + oModel.HTaxRate + "'" + |
| | | ",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_TaxRate_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_TaxRate"; |
| | | MvarReportTitle = "ç¨ç"; |
| | | oModel = new Model.ClsGy_TaxRate_Model(); |
| | | } |
| | | } |
| | | } |
| | |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Carbook_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CareFor_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CheckToolsType_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_TaxRate_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_PaymentCondition_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Company_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_ConveyComp_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_ConveyType_Model.cs" /> |
| | |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Logo_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_MainMaterial_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Market_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_COMMONCONTACT_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_RecCondition_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_SupplierContact_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_StockStatus_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_MaterType_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_MouldFileMain.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_MouldFileSub.cs" /> |
| | |
| | | <Compile Include="ç产管ç\ClsSc_ChangeNoteBillSub.cs" /> |
| | | <Compile Include="ç产管ç\ClsSc_MateWasterRequestBillMain.cs" /> |
| | | <Compile Include="ç产管ç\ClsSc_MateWasterRequestBillSub.cs" /> |
| | | <Compile Include="ç产管ç\ClsSc_PPBomBillMain.cs" /> |
| | | <Compile Include="ç产管ç\ClsSc_PPBomBillSub.cs" /> |
| | | <Compile Include="ç产管ç\ClsSc_WIPStockChangeBillMain.cs" /> |
| | | <Compile Include="ç产管ç\ClsSc_WIPStockChangeBillSub.cs" /> |
| | | <Compile Include="ç产管ç\ClsSc_WIPStockCheckBillMain.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsGy_COMMONCONTACT_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_PaymentCondition_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_RecCondition_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_StockStatus_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_SupplierContact_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_TaxRate_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; } |
| | | public decimal HTaxRate { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | |
| | | namespace Model.ç产管ç |
| | | { |
| | | public class ClsSc_PPBomBillMain : DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | public string HBillNo; //åæ®å· |
| | | public Int64 HMaterID; //ç©æ |
| | | public Int64 HUnitID; //计éåä½ |
| | | public Int64 HDeptID; //é¨é¨ |
| | | public DateTime HDate; //æ¥æ |
| | | public double HQty; //æ°é |
| | | public string HRemark; //夿³¨ |
| | | |
| | | |
| | | public Int64 HYear; |
| | | public Int64 HPeriod; |
| | | public string HBillType; // åæ®ç±»å |
| | | public string HBillSubType; // åç±»å |
| | | public Int64 HInterID; |
| | | public Int64 HBillStatus; //åæ®ç¶æ |
| | | public Int64 HCheckItemNextID; //å¾
å®¡æ ¸é¡¹ç®ï¼é»è®¤å¼ 0ï¼ çé¢ä¸ä¸éè¦æ¾ç¤º |
| | | public Int64 HCheckFlowID; //å®¡æ¹æµï¼é»è®¤å¼ 0ï¼ çé¢ä¸ä¸éè¦æ¾ç¤º |
| | | public string HBacker; //éå人 ï¼é»è®¤ä¸º''ï¼ |
| | | public string HBackDate; //é忥æ ï¼å
许NULLï¼ |
| | | public string HChecker; //å®¡æ ¸äºº ï¼é»è®¤ä¸º''ï¼ |
| | | public string HCheckDate; //å®¡æ ¸æ¥æ ï¼å
许NULLï¼ |
| | | public string HMaker; //å¶å人 |
| | | public string HMakeDate; //å¶åæ¥æ |
| | | public string HUpDater; //ä¿®æ¹äºº ï¼é»è®¤ä¸º''ï¼ |
| | | public string HUpDateDate; //ä¿®æ¹æ¥æ ï¼å
许NULLï¼ |
| | | public string HCloseMan; //å
³é人 ï¼é»è®¤ä¸º''ï¼ |
| | | public string HCloseDate; //å
³éæ¥æ ï¼å
许NULLï¼ |
| | | public Int64 HCloseType; //å
³éç±»å ï¼é»è®¤ä¸º0ï¼ |
| | | public string HDeleteMan; //ä½åºäºº ï¼é»è®¤ä¸º''ï¼ |
| | | public string HDeleteDate; //ä½åºæ¥æ ï¼å
许NULLï¼ |
| | | public Int64 HICMOInterID; //ç产订åå
ç |
| | | public Int64 HCheckItemNowID; //å½åå®¡æ ¸é¡¹ç®ï¼é»è®¤å¼ 0ï¼ çé¢ä¸ä¸éè¦æ¾ç¤º |
| | | public Int64 HSeOrderInterID; //éå®è®¢åå
ç |
| | | public Int64 HSeOrderEntryID; //éå®è®¢ååå
ç |
| | | public string HSeOrderBillNo; //éå®è®¢åå· |
| | | public string HType; // ç±»å(å¯è½æ¯ å§å¤åç产) |
| | | public Int64 HSeOrderEntrySEQ; //éå®è®¢åè¡å· |
| | | public Int64 HICMOEntrySEQ; //ç产订åè¡å· |
| | | public string HREQSRC; //éæ±æ¥æº |
| | | |
| | | public Int64 HICMOEntryID; |
| | | public Int64 HPRDORGID; |
| | | public Int64 HENTRUSTORGID; |
| | | public Int64 HPARENTOWNERID; |
| | | public string HPARENTOWNERTYPEID; |
| | | public Int64 HERPInterID; |
| | | public string HERPBillType; |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | |
| | | namespace Model.ç产管ç |
| | | { |
| | | public class ClsSc_PPBomBillSub : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public Int64 HMaterID; //ç©æID |
| | | public string HMaterNumber; // |
| | | public Int64 HUnitID; //åä½ID |
| | | public string HUnitNumber; // |
| | | public Int64 HWHID; //ä»åº |
| | | public Int64 HSPID; //ä»ä½ |
| | | public Int64 HBASEUNITID; //åºæ¬è®¡éåä½, |
| | | public double HQty; //æ°é |
| | | public string HRemark; //夿³¨ |
| | | |
| | | |
| | | public Int64 HQtyMust; //åºåæ°é |
| | | public double HNumerator; //åå |
| | | public double HDenominator; //忝 |
| | | public double HQtyScrap; //æèç |
| | | public DateTime HSendDate; //åææ¥æ |
| | | public Int64 HBomInterID; //BOM |
| | | public Int64 HProcID; //å·¥åºå
ç |
| | | public Int64 HKeyMaterID_Line; //å
³é®ä»¶ç»å®æ è®° |
| | | public Int64 HKeyMaterID_InStock; //å
³é®ä»¶å
¥åºæ è®° |
| | | public Int64 HKeyMaterID_Ready; //å
³é®ä»¶é½å¥æ è®° |
| | | public Int64 HICMOInterID; //ä»»å¡åID |
| | | public string HICMOBillNo; //ä»»å¡åå· |
| | | public string HSeOrderBillNo; //(éå®è®¢åå·) |
| | | public Int64 HSeOrderInterID; //(éå®è®¢å主å
ç ) |
| | | public Int64 HSeOrderEntryID; //(éå®è®¢ååå
ç ) |
| | | public Int64 HChangeTimes; //åæ´æ¬¡æ° |
| | | public Int64 HProcessID; //ä½ä¸, |
| | | public Int64 HICMOENTRYSEQ;//ç产订åè¡å·, |
| | | public Int64 HICMOEntryID;//ç产订ååå
ç |
| | | public string HPROJECTNO; //项ç®ç¼å·, |
| | | public Int64 HOPERID;//éè¶å·¥åº, |
| | | public Int64 HSEQ;//è¡å·, |
| | | public Int64 HSTOCKSTATUSID; //åºåç¶æ, |
| | | public Int64 HLOT; //æ¹æ¬¡å
ç , |
| | | public Int64 HOPTQUEUE;//å·¥åºåºå, |
| | | public Int64 HRESERVETYPE;//é¢çç±»å, |
| | | public double HSelPickedQty; //颿éåæ°é, |
| | | public double HSELPRCDRETURNQTY; //éæéåæ°é, |
| | | public Int64 HInterID; |
| | | public Int64 HEntryID; |
| | | public string HCloseMan; //è¡å
³é(é»è®¤ä¸º'') |
| | | public DateTime HEntryCloseDate; //è¡å
³é(é»è®¤ä¸º'') |
| | | public Int64 HCloseType; //å
³éç±»å(é»è®¤ä¸º0) |
| | | public Int64 HSourceInterID; //æºåID |
| | | public Int64 HSourceEntryID; //æºååID |
| | | public string HSourceBillNo; //æºååå· |
| | | public string HSourceBillType; //æºåç±»å |
| | | public double HRelationQty; //å
³èæ°é |
| | | public double HRelationMoney; //å
³èéé¢ |
| | | |
| | | public Int64 HCHILDSUPPLYORGID; |
| | | public Int64 HSUPPLYORGID; |
| | | public Int64 HENTRUSTPICKORGID; |
| | | public Int64 HSRCTRANSORGID; |
| | | public Int64 HGROUPBYOWNERID; |
| | | public Int64 HOWNERID; |
| | | public Int64 HAuxPropID; |
| | | public Int64 HERPInterID; |
| | | public Int64 HERPEntryID; |
| | | public double HMoveStockQty; |
| | | public double HBackRelationQty; |
| | | public string HOWNERTYPEID; |
| | | public string HBatchNO; |
| | | public string HMTONo; |
| | | } |
| | | } |
| | |
| | | public Int64 HDeptID;// int --é¨é¨ (Gy_Employee) |
| | | public string HExplanation;// varchar(200) --ÕªÒª |
| | | public string HInnerBillNo;// varchar(50) --å
é¨åæ®å· |
| | | |
| | | |
| | | public Int64 HInterID; |
| | | public Int64 HYear; |
| | | public Int64 HPeriod; |
| | | public string HBillType; |
| | | public string HBillSubType; |
| | | public DateTime HDate; |
| | | public string HBillNo; |
| | | public Int64 HBillStatus; |
| | | public string HRemark; |
| | | public string HMaker; |
| | | public string HMakeDate; |
| | | public string HChecker; |
| | | public string HCheckDate; |
| | | public string HOWNERTYPEID; |
| | | public Int64 HOWNERID; |
| | | public Int64 HERPInterID; |
| | | public string HERPBillType; |
| | | public Int64 HPURCHASEORGID; |
| | | public Int64 HSTOCKORGID; |
| | | public Int64 HREQUIREORGID; |
| | | public Int64 HSTOCKGROUPID; |
| | | public string HSENDBILLNO; |
| | | public string HLADBILLNO; |
| | | public Int64 HPURDEPTID; |
| | | public Int64 HPURGROUPID; |
| | | public Int64 HSUPPLYID; |
| | | public Int64 HSETTLEID; |
| | | public Int64 HCHARGEID; |
| | | public string HBUSINESSTYPE; |
| | | public string HSUPPLYADDRESS; |
| | | public Int64 HCORRESPONDORGID; |
| | | public Int64 HPROVIDERCONTACTID; |
| | | |
| | | } |
| | | } |
| | |
| | | public Int64 HPOOrderInterID;// |
| | | public Int64 HPOOrderEntryID;// |
| | | public string HPOOrderBillNo;// |
| | | public Int64 HSecUnitID;// è¾
å©åä½ |
| | | |
| | | public Int64 HInterID; |
| | | public Int64 HEntryID; |
| | | public Int64 HSPID; |
| | | public Int64 HSourceInterID; |
| | | public Int64 HSourceEntryID; |
| | | public string HSourceBillNo; |
| | | public Int64 HAuxPropID; |
| | | public string HBatchNO; |
| | | public string HMTONo; |
| | | public string HPlanMode; |
| | | public Int64 HERPInterID; |
| | | public Int64 HERPEntryID; |
| | | public double HRelationQty; |
| | | public Int64 HGiveAwayFlag; |
| | | public double HReceiveQty; |
| | | public Int64 HSEQ; |
| | | public string HPRODUCEDATE; |
| | | public string HEXPIRYDATE; |
| | | public string HSUPPLYLOT; |
| | | public string HREQTRACENO; |
| | | public Int64 HBOMID; |
| | | public Int64 HSTOCKUNITID; |
| | | public Int64 HBASEUNITID; |
| | | public Int64 HSTOCKSTATUSID; |
| | | public string HKEEPERTYPEID; |
| | | public string HPROJECTNO; |
| | | public string HGIVEAWAY; |
| | | public string HCHECKINCOMING; |
| | | public string HDISCOUNTRATE; |
| | | public double HPRICECOEFFICIENT; |
| | | public Int64 HPRICEUNITID; |
| | | public Int64 HPRICELISTENTRY; |
| | | public double HSAMPLEDAMAGEQTY; |
| | | public double HSAMPLEDAMAGEBASEQTY; |
| | | public Int64 HPAYORGID; |
| | | public Int64 HSETTLEORGID; |
| | | public Int64 HSETTLECURRID; |
| | | public Int64 HSETTLEMODEID; |
| | | public Int64 HEXCHANGETYPEID; |
| | | public double HEXCHANGERATE; |
| | | public Int64 HPAYCONDITONID; |
| | | public Int64 HLOCALCURRID; |
| | | public Int64 HISINCLUDEDTAX; |
| | | public Int64 HISPRICEEXCLUDETAX; |
| | | public Int64 HTAXRATEID; |
| | | public double HCOSTPERCENT; |
| | | public double HCOSTAMOUNT; |
| | | public Int64 HVAT; |
| | | public Int64 HSELLERWITHHOLDING; |
| | | public Int64 HBUYERWITHHOLDING; |
| | | |
| | | } |
| | | } |
| | |
| | | public Int64 HDeptID;// int --é¨é¨ (Gy_Employee) |
| | | public string HExplanation;// varchar(200) --ÕªÒª |
| | | public string HInnerBillNo;// varchar(50) --å
é¨åæ®å· |
| | | public DateTime HSSDate; |
| | | public DateTime HSSDate; //ç»ç®æ¥æ |
| | | public string HRemark; //夿³¨ |
| | | |
| | | |
| | | public Int64 HInterID; |
| | | public Int64 HYear; |
| | | public Int64 HPeriod; |
| | | public string HBillType; |
| | | public string HBillSubType; |
| | | public DateTime HDate; |
| | | public string HBillNo; |
| | | public Int64 HBillStatus; |
| | | public string HChecker; |
| | | public string HCheckDate; |
| | | public string HMaker; |
| | | public string HMakeDate; |
| | | public Int64 HERPInterID; |
| | | public string HERPBillType; |
| | | public Int64 HPURCHASEORGID; |
| | | |
| | | } |
| | | } |
| | |
| | | public string HSourceInterID; |
| | | public string HSourceEntryID; |
| | | public string HSourceQty; |
| | | |
| | | |
| | | public Int64 HInterID; |
| | | public Int64 HEntryID; |
| | | public string HSourceBillNo; |
| | | public string HSourceBillType; |
| | | public double HRelationQty; |
| | | public double HBackRelationQty; |
| | | public Int64 HPropertyID; |
| | | public string HBatChNo; |
| | | public Int64 HAuxPropID; |
| | | public string HMTONo; |
| | | public Int64 HERPInterID; |
| | | public Int64 HERPEntryID; |
| | | |
| | | } |
| | | } |
| | |
| | | using Newtonsoft.Json; |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Cg_POInStockBill/ModifyByID")] |
| | | [HttpPost] |
| | | public object ModifyByID([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | DAL.ClsGy_Warehouse_Ctl oDept = new DAL.ClsGy_Warehouse_Ctl(); |
| | | DAL.ClsGy_Warehouse_View oDeptHlp = new DAL.ClsGy_Warehouse_View(); |
| | | |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | //string msg3 = sArray[1].ToString(); |
| | | //string msg4 = sArray[2].ToString(); |
| | | //string msg5 = sArray[3].ToString(); |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Warehouse> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Warehouse>>(msg2); |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HShortNumber = list[0].HShortNumber; |
| | | long HParentID = list[0].HParentID; |
| | | long HLevel = list[0].HLevel; |
| | | bool HEndFlag = list[0].HEndFlag; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HRemark = list[0].HRemark; |
| | | string HBarCode = list[0].HBarCode; |
| | | long HEmpID = list[0].HEmpID; |
| | | string HAddress = list[0].HAddress; |
| | | string HPhone = list[0].HPhone; |
| | | long HUSEORGID = list[0].HUSEORGID; |
| | | string HUpDater = list[0].HUpDater; |
| | | |
| | | ////夿æé |
| | | //if (!ClsPub.Security_Log(msg5, 1, false, msg4)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç éå¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | if (HItemID == 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Insert into Gy_Warehouse " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HEmpID,HAddress,HPhone,HUSEORGID) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + |
| | | "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HEmpID.ToString() + ",'" + HAddress + "','" + HPhone + "','" + HUSEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_Warehouse set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | } |
| | | else |
| | | { |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_Warehouse set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HLevel=" + HLevel.ToString() + |
| | | ",HParentID=" + HParentID.ToString() + |
| | | ",HEndflag=" + Convert.ToString(HEndFlag ? 1 : 0) + |
| | | ",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) + |
| | | ",HEmpID=" + HEmpID.ToString() + |
| | | ",HAddress='" + HAddress + "'" + |
| | | ",HPhone='" + HPhone + "'" + |
| | | ",HUSEORGID='" + HUSEORGID + "'" + |
| | | ",HUpdater='" + HUpDater + "'" + |
| | | ",HUpdateDate= getdate()" + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Warehouse,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCN.RunProc("Update Gy_Warehouse set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | oCN.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | ///å é¤åè½ |
| | | /// </summary> |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | // |
| | | #region æ¶æéç¥å ä¿å/ç¼è¾åè½ |
| | | [Route("Cg_POInStockBill/POInStockBillEdit")] |
| | | [HttpPost] |
| | | public object POInStockBillEdit([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(); |
| | | string msg_allVal = sArray[4].ToString(); //主表+åè¡¨æææ°æ® |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsCg_POInStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POInStockBillMain>>(msg2); |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | long HPRDORGID = mainList[0].HPRDORGID;//ç»ç» |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | | string HRemark = mainList[0].HRemark;//夿³¨ |
| | | long HSupID = mainList[0].HSupID;//ä¾åºå |
| | | long HEmpID = mainList[0].HEmpID;//ä¸å¡å |
| | | long HDeptID = mainList[0].HDeptID;//é¨é¨ |
| | | long HCurID = mainList[0].HCurID;//å¸å« |
| | | Single HExRate = mainList[0].HExRate;//æ±ç |
| | | long HManagerID = mainList[0].HManagerID;//主管 |
| | | long HWHID = mainList[0].HWHID;//ä»åº |
| | | string HMaker = user;//å¶å人 |
| | | string HAddress = mainList[0].HAddress;//å°å |
| | | string HExplanation = mainList[0].HExplanation;//æè¦ |
| | | string HInnerBillNo = mainList[0].HInnerBillNo;//å
é¨åæ®å· |
| | | |
| | | List<ClsCg_POInStockBillMain> mainList2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POInStockBillMain>>(msg2); |
| | | DateTime dt = DateTime.Now; |
| | | |
| | | long HYear = mainList2[0].HYear == null ? 0 : mainList2[0].HYear; |
| | | long HPeriod = mainList2[0].HPeriod == null ? 0 : mainList2[0].HPeriod; |
| | | string HBillType = mainList2[0].HBillType == null ? "''" : mainList2[0].HBillType; |
| | | string HBillSubType = mainList2[0].HBillSubType == null ? "''" : mainList2[0].HBillSubType; |
| | | long HBillStatus = mainList2[0].HBillStatus == null ? 0 : mainList2[0].HBillStatus; |
| | | string HMakeDate = mainList2[0].HMakeDate == null ? "''" : mainList2[0].HMakeDate; |
| | | string HChecker = mainList2[0].HChecker == null ? "''" : mainList2[0].HChecker; |
| | | string HCheckDate = mainList2[0].HCheckDate == null ? "''" : mainList2[0].HCheckDate; |
| | | string HOWNERTYPEID = mainList2[0].HOWNERTYPEID == null ? "''" : mainList2[0].HOWNERTYPEID; |
| | | long HOWNERID = mainList2[0].HOWNERID == null ? 0 : mainList2[0].HOWNERID; |
| | | long HERPInterID = mainList2[0].HERPInterID == null ? 0 : mainList2[0].HERPInterID; |
| | | string HERPBillType = mainList2[0].HERPBillType == null ? "''" : mainList2[0].HERPBillType; |
| | | long HPURCHASEORGID = mainList2[0].HPURCHASEORGID == null ? 0 : mainList2[0].HPURCHASEORGID; |
| | | long HSTOCKORGID = mainList2[0].HSTOCKORGID == null ? 0 : mainList2[0].HSTOCKORGID; |
| | | long HREQUIREORGID = mainList2[0].HREQUIREORGID == null ? 0 : mainList2[0].HREQUIREORGID; |
| | | long HSTOCKGROUPID = mainList2[0].HSTOCKGROUPID == null ? 0 : mainList2[0].HSTOCKGROUPID; |
| | | string HSENDBILLNO = mainList2[0].HSENDBILLNO == null ? "''" : mainList2[0].HSENDBILLNO; |
| | | string HLADBILLNO = mainList2[0].HLADBILLNO == null ? "''" : mainList2[0].HLADBILLNO; |
| | | long HPURDEPTID = mainList2[0].HPURDEPTID == null ? 0 : mainList2[0].HPURDEPTID; |
| | | long HPURGROUPID = mainList2[0].HPURGROUPID == null ? 0 : mainList2[0].HPURGROUPID; |
| | | long HSUPPLYID = mainList2[0].HSUPPLYID == null ? 0 : mainList2[0].HSUPPLYID; |
| | | long HSETTLEID = mainList2[0].HSETTLEID == null ? 0 : mainList2[0].HSETTLEID; |
| | | long HCHARGEID = mainList2[0].HCHARGEID == null ? 0 : mainList2[0].HCHARGEID; |
| | | string HBUSINESSTYPE = mainList2[0].HBUSINESSTYPE == null ? "''" : mainList2[0].HBUSINESSTYPE; |
| | | string HSUPPLYADDRESS = mainList2[0].HSUPPLYADDRESS == null ? "''" : mainList2[0].HSUPPLYADDRESS; |
| | | long HCORRESPONDORGID = mainList2[0].HCORRESPONDORGID == null ? 0 : mainList2[0].HCORRESPONDORGID; |
| | | long HPROVIDERCONTACTID = mainList2[0].HPROVIDERCONTACTID == null ? 0 : mainList2[0].HPROVIDERCONTACTID; |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_POOrderBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Cg_POInStockBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate |
| | | ,HBillNo,HBillStatus,HSupID,HManagerID,HEmpID,HDeptID,HRemark |
| | | ,HMaker,HMakeDate,HChecker,HCheckDate,HOWNERTYPEID,HOWNERID |
| | | ,HERPInterID,HERPBillType,HPURCHASEORGID,HSTOCKORGID,HREQUIREORGID |
| | | ,HSTOCKGROUPID,HSENDBILLNO,HLADBILLNO,HPURDEPTID,HPURGROUPID,HSUPPLYID |
| | | ,HSETTLEID,HCHARGEID,HBUSINESSTYPE,HSUPPLYADDRESS,HCORRESPONDORGID,HPROVIDERCONTACTID,HCurID,HExRate,HAddress,HWHID) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1103 + "','" + |
| | | HBillSubType + "','" + HDate + "','" + HBillNo + "'," + HBillStatus + "," + HSupID + |
| | | "," + HManagerID + "," + HEmpID + "," + HDeptID + ",'" + HRemark + "','" + HMaker + |
| | | "','" + HMakeDate + "','" + HChecker + "','" + HCheckDate + "','" + HOWNERTYPEID + "'," + HOWNERID + "," + HERPInterID + ",'" + HERPBillType + "'," + HPURCHASEORGID + "," + HSTOCKORGID + "," + HREQUIREORGID + "," + |
| | | HSTOCKGROUPID + ",'" + HSENDBILLNO + "','" + HLADBILLNO + "'," + HPURDEPTID + "," + HPURGROUPID + "," + HSUPPLYID + "," + |
| | | HSETTLEID + "," + HCHARGEID + ",'" + HBUSINESSTYPE + "','" + HSUPPLYADDRESS + "'," + HCORRESPONDORGID + "," + HPROVIDERCONTACTID + "," + HCurID + "," + HExRate + ",'" + HAddress + "'," + HWHID + ")"); |
| | | } |
| | | else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) |
| | | { //ä¿®æ¹ |
| | | oCN.RunProc("update Cg_POInStockBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + |
| | | ",HSupID=" + HSupID + ",HCurID=" + HCurID |
| | | + ",HExRate=" + HExRate + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID |
| | | + ",HAddress='" + HAddress + " where HInterID=" + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Cg_POInStockBillSub 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<ClsCg_POInStockBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POInStockBillSub>>(msg3); |
| | | |
| | | List<ClsCg_POInStockBillSub> DetailColl2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POInStockBillSub>>(msg3); |
| | | |
| | | |
| | | long HSPID = DetailColl2[0].HSPID == null ? 0 : DetailColl2[0].HSPID; |
| | | long HSourceInterID = DetailColl2[0].HSourceInterID == null ? 0 : DetailColl2[0].HSourceInterID; |
| | | long HSourceEntryID = DetailColl2[0].HSourceEntryID == null ? 0 : DetailColl2[0].HSourceEntryID; |
| | | string HSourceBillNo = DetailColl2[0].HSourceBillNo == null ? "''" : DetailColl2[0].HSourceBillNo; |
| | | string HSourceBillType = DetailColl2[0].HSourceBillType == null ? "''" : DetailColl2[0].HSourceBillType; |
| | | long HAuxPropID = DetailColl2[0].HAuxPropID == null ? 0 : DetailColl2[0].HAuxPropID; |
| | | string HBatchNO = DetailColl2[0].HBatchNO == null ? "''" : DetailColl2[0].HBatchNO; |
| | | string HMTONo = DetailColl2[0].HMTONo == null ? "''" : DetailColl2[0].HMTONo; |
| | | string HPlanMode = DetailColl2[0].HPlanMode == null ? "''" : DetailColl2[0].HPlanMode; |
| | | long HERPInterID = DetailColl2[0].HERPInterID == null ? 0 : DetailColl2[0].HERPInterID; |
| | | long HERPEntryID = DetailColl2[0].HERPEntryID == null ? 0 : DetailColl2[0].HERPEntryID; |
| | | double HRelationQty = DetailColl2[0].HRelationQty == null ? 0 : DetailColl2[0].HRelationQty; |
| | | long HGiveAwayFlag = DetailColl2[0].HGiveAwayFlag == null ? 0 : DetailColl2[0].HGiveAwayFlag; |
| | | double HReceiveQty = DetailColl2[0].HReceiveQty == null ? 0 : DetailColl2[0].HReceiveQty; |
| | | long HSEQ = DetailColl2[0].HSEQ == null ? 0 : DetailColl2[0].HSEQ; |
| | | string HPRODUCEDATE = DetailColl2[0].HPRODUCEDATE == null ? "''" : DetailColl2[0].HPRODUCEDATE; |
| | | string HEXPIRYDATE = DetailColl2[0].HEXPIRYDATE == null ? "''" : DetailColl2[0].HEXPIRYDATE; |
| | | string HSUPPLYLOT = DetailColl2[0].HSUPPLYLOT == null ? "''" : DetailColl2[0].HSUPPLYLOT; |
| | | string HREQTRACENO = DetailColl2[0].HREQTRACENO == null ? "''" : DetailColl2[0].HREQTRACENO; |
| | | long HBOMID = DetailColl2[0].HBOMID == null ? 0 : DetailColl2[0].HBOMID; |
| | | long HSTOCKUNITID = DetailColl2[0].HSTOCKUNITID == null ? 0 : DetailColl2[0].HSTOCKUNITID; |
| | | long HBASEUNITID = DetailColl2[0].HBASEUNITID == null ? 0 : DetailColl2[0].HBASEUNITID; |
| | | long HSTOCKSTATUSID = DetailColl2[0].HSTOCKSTATUSID == null ? 0 : DetailColl2[0].HSTOCKSTATUSID; |
| | | string HKEEPERTYPEID = DetailColl2[0].HKEEPERTYPEID == null ? "''" : DetailColl2[0].HKEEPERTYPEID; |
| | | string HPROJECTNO = DetailColl2[0].HPROJECTNO == null ? "''" : DetailColl2[0].HPROJECTNO; |
| | | string HGIVEAWAY = DetailColl2[0].HGIVEAWAY == null ? "''" : DetailColl2[0].HGIVEAWAY; |
| | | string HCHECKINCOMING = DetailColl2[0].HCHECKINCOMING == null ? "''" : DetailColl2[0].HCHECKINCOMING; |
| | | string HDISCOUNTRATE = DetailColl2[0].HDISCOUNTRATE == null ? "''" : DetailColl2[0].HDISCOUNTRATE; |
| | | double HPRICECOEFFICIENT = DetailColl2[0].HPRICECOEFFICIENT == null ? 0 : DetailColl2[0].HPRICECOEFFICIENT; |
| | | long HPRICEUNITID = DetailColl2[0].HPRICEUNITID == null ? 0 : DetailColl2[0].HPRICEUNITID; |
| | | long HPRICELISTENTRY = DetailColl2[0].HPRICELISTENTRY == null ? 0 : DetailColl2[0].HPRICELISTENTRY; |
| | | double HSAMPLEDAMAGEQTY = DetailColl2[0].HSAMPLEDAMAGEQTY == null ? 0 : DetailColl2[0].HSAMPLEDAMAGEQTY; |
| | | double HSAMPLEDAMAGEBASEQTY = DetailColl2[0].HSAMPLEDAMAGEBASEQTY == null ? 0 : DetailColl2[0].HSAMPLEDAMAGEBASEQTY; |
| | | long HPAYORGID = DetailColl2[0].HPAYORGID == null ? 0 : DetailColl2[0].HPAYORGID; |
| | | long HSETTLEORGID = DetailColl2[0].HSETTLEORGID == null ? 0 : DetailColl2[0].HSETTLEORGID; |
| | | long HSETTLECURRID = DetailColl2[0].HSETTLECURRID == null ? 0 : DetailColl2[0].HSETTLECURRID; |
| | | long HSETTLEMODEID = DetailColl2[0].HSETTLEMODEID == null ? 0 : DetailColl2[0].HSETTLEMODEID; |
| | | long HEXCHANGETYPEID = DetailColl2[0].HEXCHANGETYPEID == null ? 0 : DetailColl2[0].HEXCHANGETYPEID; |
| | | long HPAYCONDITONID = DetailColl2[0].HPAYCONDITONID == null ? 0 : DetailColl2[0].HPAYCONDITONID; |
| | | long HLOCALCURRID = DetailColl2[0].HLOCALCURRID == null ? 0 : DetailColl2[0].HLOCALCURRID; |
| | | long HISINCLUDEDTAX = DetailColl2[0].HISINCLUDEDTAX == null ? 0 : DetailColl2[0].HISINCLUDEDTAX; |
| | | long HISPRICEEXCLUDETAX = DetailColl2[0].HISPRICEEXCLUDETAX == null ? 0 : DetailColl2[0].HISPRICEEXCLUDETAX; |
| | | long HTAXRATEID = DetailColl2[0].HTAXRATEID == null ? 0 : DetailColl2[0].HTAXRATEID; |
| | | double HCOSTPERCENT = DetailColl2[0].HCOSTPERCENT == null ? 0 : DetailColl2[0].HCOSTPERCENT; |
| | | double HCOSTAMOUNT = DetailColl2[0].HCOSTAMOUNT == null ? 0 : DetailColl2[0].HCOSTAMOUNT; |
| | | long HVAT = DetailColl2[0].HVAT == null ? 0 : DetailColl2[0].HVAT; |
| | | long HSELLERWITHHOLDING = DetailColl2[0].HSELLERWITHHOLDING == null ? 0 : DetailColl2[0].HSELLERWITHHOLDING; |
| | | long HBUYERWITHHOLDING = DetailColl2[0].HBUYERWITHHOLDING == null ? 0 : DetailColl2[0].HBUYERWITHHOLDING; |
| | | string HRemark = DetailColl2[0].HRemark == null ? "''" : DetailColl2[0].HRemark; |
| | | string HPOOrderBillNo = DetailColl2[0].HPOOrderBillNo == null ? "''" : DetailColl2[0].HPOOrderBillNo; |
| | | |
| | | int i = 0; |
| | | foreach (ClsCg_POInStockBillSub oSub in DetailColl) |
| | | { |
| | | i++; |
| | | if (oSub.HQty <= 0 || oSub.HQty == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼æ°éä¸è½ä¸º0æè
å°äº0"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oSub.HMaterID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼ç©æä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if (oSub.HSourceID == 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + i + "è¡ï¼çäº§èµæºä¸è½ä¸ºç©º"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (oSub.HUnitID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼è®¡éåä½ä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet Cs; |
| | | Int64 NewHEntryID = 1; |
| | | Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Cg_POInStockBillSub", "Cg_POInStockBillSub"); |
| | | 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 Cg_POInStockBillSub |
| | | (HInterID,HEntryID,HMaterID,HUnitID,HQty,HPrice |
| | | ,HMoney,HWHID,HSPID,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HPOOrderInterID |
| | | ,HPOOrderEntryID,HPOORderBillNo,HAuxPropID,HBatchNO,HMTONo,HPlanMode,HERPInterID,HERPEntryID |
| | | ,HRelationQty,HGiveAwayFlag,HReceiveQty,HSEQ,HPRODUCEDATE,HEXPIRYDATE,HSUPPLYLOT,HREQTRACENO,HBOMID,HSTOCKUNITID |
| | | ,HBASEUNITID,HSTOCKSTATUSID,HKEEPERTYPEID,HPROJECTNO,HGIVEAWAY,HCHECKINCOMING,HTAXPRICE,HDISCOUNTRATE |
| | | ,HPRICECOEFFICIENT,HPRICEUNITID,HPRICELISTENTRY,HSAMPLEDAMAGEQTY,HSAMPLEDAMAGEBASEQTY |
| | | ,HPAYORGID,HSETTLEORGID,HSETTLECURRID,HSETTLEMODEID,HEXCHANGETYPEID,HPAYCONDITONID |
| | | ,HEXCHANGERATE,HLOCALCURRID,HISINCLUDEDTAX,HISPRICEEXCLUDETAX |
| | | ,HTAXRATEID,HCOSTPERCENT,HCOSTAMOUNT,HVAT,HSELLERWITHHOLDING,HBUYERWITHHOLDING,HSecUnitID) |
| | | values({HInterID},{NewHEntryID},{oSub.HMaterID},{oSub.HUnitID},{(oSub.HQty == null ? 0 : oSub.HQty)} |
| | | ,{oSub.HPrice},{oSub.HMoney},{oSub.HWHID},{oSub.HSPID},'{HRemark}',{oSub.HSourceInterID},{oSub.HSourceEntryID},{HSourceBillNo},{HSourceBillType},{oSub.HPOOrderInterID},{oSub.HPOOrderEntryID},{HPOOrderBillNo},{HAuxPropID},{HBatchNO},{HMTONo},{HPlanMode},{HERPInterID},{HERPEntryID},{HRelationQty},{HGiveAwayFlag},{HReceiveQty},{HSEQ},{HPRODUCEDATE},{HEXPIRYDATE}, |
| | | {HSUPPLYLOT},{HREQTRACENO},{HBOMID},{HSTOCKUNITID},{HBASEUNITID},{HSTOCKSTATUSID},'{HKEEPERTYPEID}',{HPROJECTNO},{HGIVEAWAY},{HCHECKINCOMING},{oSub.HTaxPrice},{HDISCOUNTRATE},{HPRICECOEFFICIENT},{HPRICEUNITID},{HPRICELISTENTRY},{HSAMPLEDAMAGEQTY},{HSAMPLEDAMAGEBASEQTY},{HPAYORGID},{HSETTLEORGID},{HSETTLECURRID},{HSETTLEMODEID},{HEXCHANGETYPEID},{HPAYCONDITONID},{oSub.HEXCHANGERATE},{HLOCALCURRID},{HISINCLUDEDTAX},{HISPRICEEXCLUDETAX},{HTAXRATEID},{HCOSTPERCENT},{HCOSTAMOUNT},{HVAT},{HSELLERWITHHOLDING},{HBUYERWITHHOLDING},{oSub.HSecUnitID})"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | using Newtonsoft.Json; |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | |
| | | } |
| | | } |
| | | |
| | | // |
| | | #region éè´è®¢å ä¿å/ç¼è¾åè½ |
| | | [Route("Cg_POOrderBill/POOrderBillEdit")] |
| | | [HttpPost] |
| | | public object POOrderBillEdit([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(); |
| | | string msg_allVal = sArray[4].ToString(); //主表+åè¡¨æææ°æ® |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsCg_POOrderBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POOrderBillMain>>(msg2); |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | long HPRDORGID = mainList[0].HPRDORGID;//ç»ç» |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | | string HRemark = mainList[0].HRemark;//夿³¨ |
| | | long HSupID = mainList[0].HSupID;//ä¾åºå |
| | | long HEmpID = mainList[0].HEmpID;//ä¸å¡å |
| | | long HDeptID = mainList[0].HDeptID;//é¨é¨ |
| | | long HCurID = mainList[0].HCurID;//å¸å« |
| | | Single HExRate = mainList[0].HExRate;//æ±ç |
| | | long HManagerID = mainList[0].HManagerID;//主管 |
| | | long HPSStyleID = mainList[0].HPSStyleID;//éè´æ¹å¼ |
| | | long HSSID = mainList[0].HSSID;//ç»ç®æ¹å¼ |
| | | DateTime HSSDate = mainList[0].HSSDate;//ç»ç®æ¥æ |
| | | string HMaker = user;//å¶å人 |
| | | string HAddress = mainList[0].HAddress;//å°å |
| | | string HExplanation = mainList[0].HExplanation;//æè¦ |
| | | string HInnerBillNo = mainList[0].HInnerBillNo;//å
é¨åæ®å· |
| | | |
| | | List<ClsCg_POOrderBillMain> mainList2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POOrderBillMain>>(msg2); |
| | | DateTime dt = DateTime.Now; |
| | | |
| | | long HYear = mainList2[0].HYear == null ? 0 : mainList2[0].HYear; |
| | | long HPeriod = mainList2[0].HPeriod == null ? 0 : mainList2[0].HPeriod; |
| | | string HBillType = mainList2[0].HBillType == null ? "''" : mainList2[0].HBillType; |
| | | string HBillSubType = mainList2[0].HBillSubType == null ? "''" : mainList2[0].HBillSubType; |
| | | long HBillStatus = mainList2[0].HBillStatus == null ? 0 : mainList2[0].HBillStatus; |
| | | string HChecker = mainList2[0].HChecker == null ? "''" : mainList2[0].HChecker; |
| | | string HCheckDate = mainList2[0].HCheckDate == null ? "''" : mainList2[0].HCheckDate; |
| | | string HMakeDate = mainList2[0].HMakeDate == null ? "''" : mainList2[0].HMakeDate; |
| | | long HERPInterID = mainList2[0].HERPInterID == null ? 0 : mainList2[0].HERPInterID; |
| | | string HERPBillType = mainList2[0].HERPBillType == null ? "''" : mainList2[0].HERPBillType; |
| | | long HPURCHASEORGID = mainList2[0].HPURCHASEORGID == null ? 0 : mainList2[0].HPURCHASEORGID; |
| | | |
| | | 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 Cg_POOrderBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HAddress,HSSID,HSSDate,HPSStyleID,HSupID,HCurID |
| | | ,HExRate,HEmpID,HManagerID,HDeptID,HExplanation,HRemark,HInnerBillNo |
| | | ,HChecker,HCheckDate,HMaker,HMakeDate |
| | | ,HERPInterID,HERPBillType,HPURCHASEORGID) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1102 + "','" + |
| | | HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress + |
| | | "'," + HSSID + ",'" + HSSDate + "'," + HPSStyleID + "," + HSupID + "," + HCurID + |
| | | "," + HExRate + "," + HEmpID + "," + HManagerID + "," + HDeptID + ",'" + HExplanation + "','" + HRemark + "','" + HInnerBillNo + "','" + HChecker + "','" + HCheckDate + "','" + HMaker + "','" + |
| | | HMakeDate + "'," + HERPInterID + ",'" + HERPBillType + "'," + HPURCHASEORGID + ")"); |
| | | } |
| | | else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) |
| | | { //ä¿®æ¹ |
| | | oCN.RunProc("update Cg_POOrderBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + |
| | | ",HSSID=" + HSSID + ",HPSStyleID=" + HPSStyleID + ",HSupID=" + HSupID + ",HCurID=" + HCurID |
| | | + ",HExRate=" + HExRate + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID |
| | | + ",HAddress='" + HAddress + "',HSSDate='" + HSSDate + "' where HInterID=" + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Cg_POOrderBillSub 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<ClsCg_POOrderBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POOrderBillSub>>(msg3); |
| | | |
| | | List<ClsCg_POOrderBillSub> DetailColl2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POOrderBillSub>>(msg3); |
| | | |
| | | |
| | | string HSourceBillNo = DetailColl2[0].HSourceBillNo == null ? "''" : DetailColl2[0].HSourceBillNo; |
| | | string HSourceBillType = DetailColl2[0].HSourceBillType == null ? "''" : DetailColl2[0].HSourceBillType; |
| | | double HRelationQty = DetailColl2[0].HRelationQty == null ? 0 : DetailColl2[0].HRelationQty; |
| | | double HBackRelationQty = DetailColl2[0].HBackRelationQty == null ? 0 : DetailColl2[0].HBackRelationQty; |
| | | long HPropertyID = DetailColl2[0].HPropertyID == null ? 0 : DetailColl2[0].HPropertyID; |
| | | string HBatChNo = DetailColl2[0].HBatChNo == null ? "''" : DetailColl2[0].HBatChNo; |
| | | long HAuxPropID = DetailColl2[0].HAuxPropID == null ? 0 : DetailColl2[0].HAuxPropID; |
| | | string HMTONo = DetailColl2[0].HMTONo == null ? "''" : DetailColl2[0].HMTONo; |
| | | long HERPInterID = DetailColl2[0].HERPInterID == null ? 0 : DetailColl2[0].HERPInterID; |
| | | long HERPEntryID = DetailColl2[0].HERPEntryID == null ? 0 : DetailColl2[0].HERPEntryID; |
| | | |
| | | string HSeOrderBillNo = DetailColl2[0].HSeOrderBillNo == null ? "''" : DetailColl2[0].HSeOrderBillNo; |
| | | string HRemark = DetailColl2[0].HRemark == null ? "''" : DetailColl2[0].HRemark; |
| | | string HSourceInterID = DetailColl2[0].HSourceInterID == null ? "''" : DetailColl2[0].HSourceInterID; |
| | | string HSourceEntryID = DetailColl2[0].HSourceEntryID == null ? "''" : DetailColl2[0].HSourceEntryID; |
| | | |
| | | |
| | | int i = 0; |
| | | foreach (ClsCg_POOrderBillSub oSub in DetailColl) |
| | | { |
| | | i++; |
| | | if (oSub.HQty <= 0 || oSub.HQty == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼æ°éä¸è½ä¸º0æè
å°äº0"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oSub.HMaterID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼ç©æä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if (oSub.HSourceID == 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + i + "è¡ï¼çäº§èµæºä¸è½ä¸ºç©º"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (oSub.HUnitID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼è®¡éåä½ä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet Cs; |
| | | Int64 NewHEntryID = 1; |
| | | Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Cg_POOrderBillSub", "Cg_POOrderBillSub"); |
| | | 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 Cg_POOrderBillSub |
| | | (HInterID,HEntryID,HMaterID,HUnitID,HQty,HPrice,HTaxPrice,HDiscountRate,HRelTaxPrice |
| | | ,HMoney,HTaxRate,HTaxMoney,HLineTotal,HlineTotalBB,HDate,HInStockQty,HInvoiceQty,HSeOrderBillNo,HSeOrderInterID |
| | | ,HSeOrderEntryID,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo |
| | | ,HSourceBillType,HRelationQty,HBackRelationQty,HPropertyID,HBatChNo,HAuxPropID,HMTONo |
| | | ,HERPInterID,HERPEntryID) |
| | | values({HInterID},{NewHEntryID},{oSub.HMaterID},{oSub.HUnitID},{(oSub.HQty == null ? 0 : oSub.HQty)} |
| | | ,{oSub.HPrice},{oSub.HTaxPrice},{oSub.HDiscountRate},{oSub.HRelTaxPrice},{oSub.HMoney},{oSub.HTaxRate},{oSub.HTaxMoney},{oSub.HlineTotal},{oSub.HlineTotalBB},'{oSub.HDate}',{oSub.HInStockQty},{oSub.HInvoiceQty},{HSeOrderBillNo},{oSub.HSeOrderInterID},{oSub.HSeOrderEntryID},'{HRemark}',{HSourceInterID},{HSourceEntryID},{HSourceBillNo},{HSourceBillType},{HRelationQty},{HBackRelationQty},{HPropertyID},{HBatChNo}, |
| | | {HAuxPropID},{HMTONo},{HERPInterID},{HERPEntryID})"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | #endregion |
| | | /// <summary> |
| | | ///å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Cg_POOrderBill/DeltetCg_POOrderBill")] |
| | | [HttpGet] |
| | | public object DeltetCg_POOrderBill(string HInterID) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Cg_POOrderBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Cg_POOrderBillSub 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; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Cg_POOrderBill/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid =" + HInterID, "h_v_IF_POOrderBillList"); |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Model.ç产管ç; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region çäº§ç¨æå ä¿å/ç¼è¾åè½ |
| | | [Route("Sc_PPBomBill/PPBomBillEdit")] |
| | | [HttpPost] |
| | | public object PPBomBillEdit([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(); |
| | | string msg_allVal = sArray[4].ToString(); //主表+åè¡¨æææ°æ® |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsSc_PPBomBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_PPBomBillMain>>(msg2); |
| | | |
| | | string HBillNo = mainList[0].HBillNo; //åæ®å· |
| | | long HMaterID = mainList[0].HMaterID; //ç©æ |
| | | long HUnitID = mainList[0].HUnitID; //计éåä½ |
| | | long HDeptID = mainList[0].HDeptID; //é¨é¨ |
| | | DateTime HDate = mainList[0].HDate; //æ¥æ |
| | | double HQty = mainList[0].HQty; //æ°é |
| | | string HRemark = mainList[0].HRemark; //夿³¨ |
| | | |
| | | |
| | | List<ClsSc_PPBomBillMain> mainList2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_PPBomBillMain>>(msg2); |
| | | DateTime dt = DateTime.Now; |
| | | |
| | | long HYear = mainList2[0].HYear == null ? 0 : mainList2[0].HYear; |
| | | long HPeriod = mainList2[0].HPeriod == null ? 0 : mainList2[0].HPeriod; |
| | | string HBillType = mainList2[0].HBillType == null ? "''" : mainList2[0].HBillType; // åæ®ç±»å |
| | | string HBillSubType = mainList2[0].HBillSubType == null ? "''" : mainList2[0].HBillSubType; // åç±»å |
| | | long HInterID = mainList2[0].HInterID == null ? 0 : mainList2[0].HInterID; |
| | | long HBillStatus = mainList2[0].HBillStatus == null ? 0 : mainList2[0].HBillStatus; //åæ®ç¶æ |
| | | long HCheckItemNextID = mainList2[0].HCheckItemNextID == null ? 0 : mainList2[0].HCheckItemNextID; //å¾
å®¡æ ¸é¡¹ç®ï¼é»è®¤å¼ 0ï¼ |
| | | long HCheckFlowID = mainList2[0].HCheckFlowID == null ? 0 : mainList2[0].HCheckFlowID; //å®¡æ¹æµï¼é»è®¤å¼ 0ï¼ çé¢ä¸ä¸éè¦æ¾ç¤º |
| | | string HBacker = mainList2[0].HBacker == null ? "''" : mainList2[0].HBacker; //éå人 ï¼é»è®¤ä¸º''ï¼ |
| | | string HBackDate = mainList2[0].HBackDate == null ? "''" : mainList2[0].HBackDate; //é忥æ ï¼å
许NULLï¼ |
| | | string HChecker = mainList2[0].HChecker == null ? "''" : mainList2[0].HChecker; //å®¡æ ¸äºº ï¼é»è®¤ä¸º''ï¼ |
| | | string HCheckDate = mainList2[0].HCheckDate == null ? "''" : mainList2[0].HCheckDate; //å®¡æ ¸æ¥æ ï¼å
许NULLï¼ |
| | | string HMaker = mainList2[0].HMaker == null ? "''" : mainList2[0].HMaker; //å¶å人 |
| | | string HMakeDate = mainList2[0].HMakeDate == null ? "''" : mainList2[0].HMakeDate; //å¶åæ¥æ |
| | | string HUpDater = mainList2[0].HUpDater == null ? "''" : mainList2[0].HUpDater; //ä¿®æ¹äºº ï¼é»è®¤ä¸º''ï¼ |
| | | string HUpDateDate = mainList2[0].HUpDateDate == null ? "''" : mainList2[0].HUpDateDate; //ä¿®æ¹æ¥æ ï¼å
许NULLï¼ |
| | | string HCloseMan = mainList2[0].HCloseMan == null ? "''" : mainList2[0].HCloseMan; //å
³é人 ï¼é»è®¤ä¸º''ï¼ |
| | | string HCloseDate = mainList2[0].HCloseDate == null ? "''" : mainList2[0].HCloseDate; //å
³éæ¥æ ï¼å
许NULLï¼ |
| | | long HCloseType = mainList2[0].HCloseType == null ? 0 : mainList2[0].HCloseType; //å
³éç±»å ï¼é»è®¤ä¸º0ï¼ |
| | | string HDeleteMan = mainList2[0].HDeleteMan == null ? "''" : mainList2[0].HDeleteMan; //ä½åºäºº ï¼é»è®¤ä¸º''ï¼ |
| | | string HDeleteDate = mainList2[0].HDeleteDate == null ? "''" : mainList2[0].HDeleteDate; //ä½åºæ¥æ ï¼å
许NULLï¼ |
| | | long HICMOInterID = mainList2[0].HICMOInterID == null ? 0 : mainList2[0].HICMOInterID; //ç产订åå
ç |
| | | long HCheckItemNowID = mainList2[0].HCheckItemNowID == null ? 0 : mainList2[0].HCheckItemNowID; //å½åå®¡æ ¸é¡¹ç®ï¼é»è®¤å¼ 0ï¼ |
| | | long HSeOrderInterID = mainList2[0].HSeOrderInterID == null ? 0 : mainList2[0].HSeOrderInterID; //éå®è®¢åå
ç |
| | | long HSeOrderEntryID = mainList2[0].HSeOrderEntryID == null ? 0 : mainList2[0].HSeOrderEntryID; //éå®è®¢ååå
ç |
| | | string HSeOrderBillNo = mainList2[0].HSeOrderBillNo == null ? "''" : mainList2[0].HSeOrderBillNo; //éå®è®¢åå· |
| | | string HType = mainList2[0].HType == null ? "''" : mainList2[0].HType; // ç±»å(å¯è½æ¯ å§å¤åç产) |
| | | long HSeOrderEntrySEQ = mainList2[0].HSeOrderEntrySEQ == null ? 0 : mainList2[0].HSeOrderEntrySEQ; //éå®è®¢åè¡å· |
| | | long HICMOEntrySEQ = mainList2[0].HICMOEntrySEQ == null ? 0 : mainList2[0].HICMOEntrySEQ; //ç产订åè¡å· |
| | | string HREQSRC = mainList2[0].HREQSRC == null ? "''" : mainList2[0].HREQSRC; //éæ±æ¥æº |
| | | |
| | | long HICMOEntryID = mainList2[0].HICMOEntryID == null ? 0 : mainList2[0].HICMOEntryID; |
| | | long HPRDORGID = mainList2[0].HPRDORGID == null ? 0 : mainList2[0].HPRDORGID; |
| | | long HENTRUSTORGID = mainList2[0].HENTRUSTORGID == null ? 0 : mainList2[0].HENTRUSTORGID; |
| | | long HPARENTOWNERID = mainList2[0].HPARENTOWNERID == null ? 0 : mainList2[0].HPARENTOWNERID; |
| | | string HPARENTOWNERTYPEID = mainList2[0].HPARENTOWNERTYPEID == null ? "''" : mainList2[0].HPARENTOWNERTYPEID; |
| | | long HERPInterID = mainList2[0].HERPInterID == null ? 0 : mainList2[0].HERPInterID; |
| | | string HERPBillType = mainList2[0].HERPBillType == null ? "''" : mainList2[0].HERPBillType; |
| | | |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_PPBomBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_PPBomBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Sc_PPBomBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus,HICMOInterID |
| | | ,HICMOEntryID,HMaterID,HUnitID,HQty,HDeptID,HMaker,HMakeDate,HChecker,HCheckDate |
| | | ,HSeOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HPRDORGID,HENTRUSTORGID,HPARENTOWNERID |
| | | ,HPARENTOWNERTYPEID,HERPInterID,HERPBillType,HSeOrderEntrySEQ,HICMOEntrySEQ) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3720 + "','" + |
| | | HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "'," + HICMOInterID + |
| | | "," + HICMOEntryID + ",'" + HMaterID + "'," + HUnitID + "," + HQty + "," + HDeptID + |
| | | ",'" + HMaker + "','" + HMakeDate + "','" + HChecker + "','" + HCheckDate + "','" + HSeOrderBillNo + "'," + HSeOrderInterID + "," + HSeOrderEntryID + "," + HPRDORGID + "," + HENTRUSTORGID + "," + HPARENTOWNERID + "," + |
| | | HPARENTOWNERTYPEID + "," + HERPInterID + ",'" + HERPBillType + "'," + HSeOrderEntrySEQ + "," + HICMOEntrySEQ + ")"); |
| | | } |
| | | else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) |
| | | { //ä¿®æ¹ |
| | | oCN.RunProc("update Sc_PPBomBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + |
| | | ",HDeptID=" + HDeptID + " where HInterID=" + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Sc_PPBomBillSub 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_PPBomBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_PPBomBillSub>>(msg3); |
| | | |
| | | List<ClsSc_PPBomBillSub> DetailColl2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_PPBomBillSub>>(msg3); |
| | | |
| | | DateTime dt = DateTime.Now; |
| | | |
| | | long HQtyMust = DetailColl2[0].HQtyMust == null ? 0 : DetailColl2[0].HQtyMust; //åºåæ°é |
| | | double HNumerator = DetailColl2[0].HNumerator == null ? 0 : DetailColl2[0].HNumerator; //åå |
| | | double HDenominator = DetailColl2[0].HDenominator == null ? 0 : DetailColl2[0].HDenominator; //忝 |
| | | double HQtyScrap = DetailColl2[0].HQtyScrap == null ? 0 : DetailColl2[0].HQtyScrap; //æèç |
| | | DateTime HSendDate = DetailColl2[0].HSendDate == null ? dt : DetailColl2[0].HSendDate; //åææ¥æ |
| | | long HBomInterID = DetailColl2[0].HBomInterID == null ? 0 : DetailColl2[0].HBomInterID; //BOM |
| | | long HProcID = DetailColl2[0].HProcID == null ? 0 : DetailColl2[0].HProcID; //å·¥åºå
ç |
| | | long HKeyMaterID_Line = DetailColl2[0].HKeyMaterID_Line == null ? 0 : DetailColl2[0].HKeyMaterID_Line; //å
³é®ä»¶ç»å®æ è®° |
| | | long HKeyMaterID_InStock = DetailColl2[0].HKeyMaterID_InStock == null ? 0 : DetailColl2[0].HKeyMaterID_InStock; //å
³é®ä»¶å
¥åºæ è®° |
| | | long HKeyMaterID_Ready = DetailColl2[0].HKeyMaterID_Ready == null ? 0 : DetailColl2[0].HKeyMaterID_Ready; //å
³é®ä»¶é½å¥æ è®° |
| | | long HICMOInterID = DetailColl2[0].HICMOInterID == null ? 0 : DetailColl2[0].HICMOInterID; //ä»»å¡åID |
| | | string HICMOBillNo = DetailColl2[0].HICMOBillNo == null ? "''" : DetailColl2[0].HICMOBillNo; //ä»»å¡åå· |
| | | string HSeOrderBillNo = DetailColl2[0].HSeOrderBillNo == null ? "''" : DetailColl2[0].HSeOrderBillNo; //(éå®è®¢åå·) |
| | | long HSeOrderInterID = DetailColl2[0].HSeOrderInterID == null ? 0 : DetailColl2[0].HSeOrderInterID; //(éå®è®¢å主å
ç ) |
| | | long HSeOrderEntryID = DetailColl2[0].HSeOrderEntryID == null ? 0 : DetailColl2[0].HSeOrderEntryID; //(éå®è®¢ååå
ç ) |
| | | long HChangeTimes = DetailColl2[0].HChangeTimes == null ? 0 : DetailColl2[0].HChangeTimes; //åæ´æ¬¡æ° |
| | | long HProcessID = DetailColl2[0].HProcessID == null ? 0 : DetailColl2[0].HProcessID; //ä½ä¸, |
| | | long HICMOENTRYSEQ = DetailColl2[0].HICMOENTRYSEQ == null ? 0 : DetailColl2[0].HICMOENTRYSEQ;//ç产订åè¡å·, |
| | | long HICMOEntryID = DetailColl2[0].HICMOEntryID == null ? 0 : DetailColl2[0].HICMOEntryID;//ç产订ååå
ç |
| | | string HPROJECTNO = DetailColl2[0].HPROJECTNO == null ? "''" : DetailColl2[0].HPROJECTNO; //项ç®ç¼å·, |
| | | long HOPERID = DetailColl2[0].HOPERID == null ? 0 : DetailColl2[0].HOPERID;//éè¶å·¥åº, |
| | | long HSEQ = DetailColl2[0].HSEQ == null ? 0 : DetailColl2[0].HSEQ;//è¡å·, |
| | | long HSTOCKSTATUSID = DetailColl2[0].HSTOCKSTATUSID == null ? 0 : DetailColl2[0].HSTOCKSTATUSID; //åºåç¶æ, |
| | | long HLOT = DetailColl2[0].HLOT == null ? 0 : DetailColl2[0].HLOT; //æ¹æ¬¡å
ç , |
| | | long HOPTQUEUE = DetailColl2[0].HOPTQUEUE == null ? 0 : DetailColl2[0].HOPTQUEUE;//å·¥åºåºå, |
| | | long HRESERVETYPE = DetailColl2[0].HRESERVETYPE == null ? 0 : DetailColl2[0].HRESERVETYPE;//é¢çç±»å, |
| | | double HSelPickedQty = DetailColl2[0].HSelPickedQty == null ? 0 : DetailColl2[0].HSelPickedQty; //颿éåæ°é, |
| | | double HSELPRCDRETURNQTY = DetailColl2[0].HSELPRCDRETURNQTY == null ? 0 : DetailColl2[0].HSELPRCDRETURNQTY; //éæéåæ°é, |
| | | string HCloseMan = DetailColl2[0].HCloseMan == null ? "''" : DetailColl2[0].HCloseMan; //è¡å
³é(é»è®¤ä¸º'') |
| | | DateTime HEntryCloseDate = DetailColl2[0].HEntryCloseDate == null ? dt : DetailColl2[0].HEntryCloseDate; //è¡å
³é(é»è®¤ä¸º'') |
| | | long HCloseType = DetailColl2[0].HCloseType == null ? 0 : DetailColl2[0].HCloseType; //å
³éç±»å(é»è®¤ä¸º0) |
| | | long HSourceInterID = DetailColl2[0].HSourceInterID == null ? 0 : DetailColl2[0].HSourceInterID; //æºåID |
| | | long HSourceEntryID = DetailColl2[0].HSourceEntryID == null ? 0 : DetailColl2[0].HSourceEntryID; //æºååID |
| | | string HSourceBillNo = DetailColl2[0].HSourceBillNo == null ? "''" : DetailColl2[0].HSourceBillNo; //æºååå· |
| | | string HSourceBillType = DetailColl2[0].HSourceBillType == null ? "''" : DetailColl2[0].HSourceBillType; //æºåç±»å |
| | | double HRelationQty = DetailColl2[0].HRelationQty == null ? 0 : DetailColl2[0].HRelationQty; //å
³èæ°é |
| | | double HRelationMoney = DetailColl2[0].HRelationMoney == null ? 0 : DetailColl2[0].HRelationMoney; //å
³èéé¢ |
| | | |
| | | |
| | | long HCHILDSUPPLYORGID = DetailColl2[0].HCHILDSUPPLYORGID == null ? 0 : DetailColl2[0].HCHILDSUPPLYORGID; |
| | | long HSUPPLYORGID = DetailColl2[0].HSUPPLYORGID == null ? 0 : DetailColl2[0].HSUPPLYORGID; |
| | | long HENTRUSTPICKORGID = DetailColl2[0].HENTRUSTPICKORGID == null ? 0 : DetailColl2[0].HENTRUSTPICKORGID; |
| | | long HSRCTRANSORGID = DetailColl2[0].HSRCTRANSORGID == null ? 0 : DetailColl2[0].HSRCTRANSORGID; |
| | | long HGROUPBYOWNERID = DetailColl2[0].HGROUPBYOWNERID == null ? 0 : DetailColl2[0].HGROUPBYOWNERID; |
| | | long HOWNERID = DetailColl2[0].HOWNERID == null ? 0 : DetailColl2[0].HOWNERID; |
| | | long HAuxPropID = DetailColl2[0].HAuxPropID == null ? 0 : DetailColl2[0].HAuxPropID; |
| | | long HERPInterID = DetailColl2[0].HERPInterID == null ? 0 : DetailColl2[0].HERPInterID; |
| | | long HERPEntryID = DetailColl2[0].HERPEntryID == null ? 0 : DetailColl2[0].HERPEntryID; |
| | | double HMoveStockQty = DetailColl2[0].HMoveStockQty == null ? 0 : DetailColl2[0].HMoveStockQty; |
| | | double HBackRelationQty = DetailColl2[0].HBackRelationQty == null ? 0 : DetailColl2[0].HBackRelationQty; |
| | | string HOWNERTYPEID = DetailColl2[0].HOWNERTYPEID == null ? "''" : DetailColl2[0].HOWNERTYPEID; |
| | | string HBatchNO = DetailColl2[0].HBatchNO == null ? "''" : DetailColl2[0].HBatchNO; |
| | | string HMTONo = DetailColl2[0].HMTONo == null ? "''" : DetailColl2[0].HMTONo; |
| | | |
| | | string HRemark = DetailColl2[0].HRemark == null ? "''" : DetailColl2[0].HRemark; |
| | | string HMaterNumber = DetailColl2[0].HMaterNumber == null ? "''" : DetailColl2[0].HMaterNumber; |
| | | string HUnitNumber = DetailColl2[0].HUnitNumber == null ? "''" : DetailColl2[0].HUnitNumber; |
| | | |
| | | int i = 0; |
| | | foreach (ClsSc_PPBomBillSub oSub in DetailColl) |
| | | { |
| | | i++; |
| | | if (oSub.HQty <= 0 || oSub.HQty == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼æ°éä¸è½ä¸º0æè
å°äº0"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oSub.HMaterID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼ç©æä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if (oSub.HSourceID == 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + i + "è¡ï¼çäº§èµæºä¸è½ä¸ºç©º"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (oSub.HUnitID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼è®¡éåä½ä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet Cs; |
| | | Int64 NewHEntryID = 1; |
| | | Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Sc_PPBomBillSub", "Sc_PPBomBillSub"); |
| | | 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_PPBomBillSub |
| | | (HInterID,HEntryID,HMaterID,HMaterNumber,HUnitID,HUnitNumber,HSPID,HQty,HQtyMust,HWHID,HRemark |
| | | ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HICMOInterID,HICMOEntryID,HICMOBillNo |
| | | ,HCHILDSUPPLYORGID,HSUPPLYORGID,HENTRUSTPICKORGID,HSRCTRANSORGID,HGROUPBYOWNERID,HOWNERID,HOWNERTYPEID |
| | | ,HRelationQty,HMoveStockQty,HAuxPropID,HBatchNO,HMTONo,HQtyScrap,HERPInterID,HERPEntryID |
| | | ,HBackRelationQty,HNumerator,HDenominator,HBASEUNITID,HProcessID,HICMOENTRYSEQ,HPROJECTNO |
| | | ,HOPERID,HSEQ,HSTOCKSTATUSID,HLOT,HOPTQUEUE,HRESERVETYPE,HSelPickedQty,HSELPRCDRETURNQTY) |
| | | values({HInterID},{NewHEntryID},{oSub.HMaterID},'{HMaterNumber}',{oSub.HUnitID},'{HUnitNumber}',{oSub.HSPID},{(oSub.HQty == null ? 0 : oSub.HQty)} |
| | | ,{HQtyMust},{oSub.HWHID},'{HRemark}',{HSourceInterID},{HSourceEntryID},{HSourceBillNo},{HSourceBillType},{HICMOInterID},{HICMOEntryID},{HICMOBillNo},{HCHILDSUPPLYORGID},{HSUPPLYORGID},{HENTRUSTPICKORGID},{HSRCTRANSORGID},{HGROUPBYOWNERID},{HOWNERID},{HOWNERTYPEID},{HRelationQty},{HMoveStockQty},{HAuxPropID},{HBatchNO},{HMTONo},{HQtyScrap},{HERPInterID}, |
| | | {HERPEntryID},{HBackRelationQty},{HNumerator},{HDenominator},{oSub.HBASEUNITID},{HProcessID},{HICMOENTRYSEQ},{HPROJECTNO},{HOPERID},{HSEQ},{HSTOCKSTATUSID},{HLOT},{HOPTQUEUE},{HRESERVETYPE},{HSelPickedQty},{HSELPRCDRETURNQTY})"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | ///å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_PPBomBill/DeltetPPBomBillBill")] |
| | | [HttpGet] |
| | | public object DeltetSeOrderBill(string HInterID) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Sc_PPBomBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Sc_PPBomBillSub 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); |
| | | if (Supplier != "") |
| | | { |
| | | sWhere = sWhere + " and ( HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%' or HUSEORGID like '%" + Supplier + "%' ) "; |
| | | sWhere = sWhere + " and ( HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%' or HUSEORGID like '%" + HOrgID + "%' ) "; |
| | | } |
| | | try |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åéè´æ¹å¼å表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Web/GetPoStockStyleList_Json")] |
| | | [HttpGet] |
| | | public object GetPoStockStyleList_Json(string PoStockStyle) |
| | | { |
| | | if (PoStockStyle != "") |
| | | { |
| | | sWhere = sWhere + " and ( HNumber like '%" + PoStockStyle + "%' or HName like '%" + PoStockStyle + "%' ) "; |
| | | } |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from Gy_PoStockStyle where HStopflag=0 Order by HItemID ", "Gy_PoStockStyle"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HNumber ,HName from Gy_PoStockStyle where HStopflag=0 and HEndFlag=1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_PoStockStyle"); |
| | | } |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "è·å失败" + DBUtility.ClsPub.sErrInfo; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | else |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 1; |
| | | objjson.Message = "è·åæå!"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "è·å失败" + ex.ToString(); |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å客æ·å表 |
| | | /// </summary> |
| | | /// <returns></returns> |
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_COMMONCONTACTBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region æ¶è´§æ¹è系人 å表 |
| | | [Route("Gy_COMMONCONTACTBill/Gy_COMMONCONTACTList")] |
| | | [HttpGet] |
| | | public object Gy_COMMONCONTACTList(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_COMMONCONTACT_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string sql1 = string.Format(@"select * from h_v_Gy_COMMONCONTACTList where 使ç¨ç»ç»='" + Organization + "'"); |
| | | |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_COMMONCONTACTList"); |
| | | |
| | | //æ·»å åå |
| | | 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_COMMONCONTACTBill/Gy_COMMONCONTACTEdit")] |
| | | [HttpPost] |
| | | public object Gy_COMMONCONTACTEdit([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(); |
| | | |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_COMMONCONTACT_Edit", 1, false, msg2)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //è·åæå¤§IDå¼èµå¼ |
| | | //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_COMMONCONTACT ", "Gy_COMMONCONTACT"); |
| | | //if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) |
| | | //{ |
| | | // //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] |
| | | // var maxid = Convert.ToInt32((Maxds.Tables[0].Rows[0]["HItemID"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"])); |
| | | // maxid += 1; |
| | | // HItemID = maxid; |
| | | //} |
| | | ListModels oListModels = new ListModels(); |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_COMMONCONTACT_Ctl oBill = new DAL.ClsGy_COMMONCONTACT_Ctl(); |
| | | List<Model.ClsGy_COMMONCONTACT_Model> lsmain = new List<Model.ClsGy_COMMONCONTACT_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_COMMONCONTACT(msg1); |
| | | foreach (Model.ClsGy_COMMONCONTACT_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_COMMONCONTACT where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_COMMONCONTACT"); |
| | | 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_COMMONCONTACTBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_COMMONCONTACT_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | 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_COMMONCONTACT where HItemID=" + HItemID, "Gy_COMMONCONTACT"); |
| | | 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_COMMONCONTACT 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_PaymentConditionListBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region 仿¬¾æ¡ä»¶ å表 |
| | | [Route("Gy_PaymentConditionBill/Gy_PaymentConditionList")] |
| | | [HttpGet] |
| | | public object Gy_PaymentConditionList(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_PaymentCondition_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string sql1 = string.Format(@"select * from h_v_Gy_PaymentConditionList where 使ç¨ç»ç»='" + Organization + "'"); |
| | | |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_PaymentConditionList"); |
| | | |
| | | //æ·»å åå |
| | | 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_PaymentConditionBill/Gy_PaymentConditionEdit")] |
| | | [HttpPost] |
| | | public object Gy_PaymentConditionEdit([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(); |
| | | |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_PaymentCondition_Edit", 1, false, msg2)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //è·åæå¤§IDå¼èµå¼ |
| | | //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_PaymentCondition ", "Gy_PaymentCondition"); |
| | | //if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) |
| | | //{ |
| | | // //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] |
| | | // var maxid = Convert.ToInt32((Maxds.Tables[0].Rows[0]["HItemID"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"])); |
| | | // maxid += 1; |
| | | // HItemID = maxid; |
| | | //} |
| | | ListModels oListModels = new ListModels(); |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_PaymentCondition_Ctl oBill = new DAL.ClsGy_PaymentCondition_Ctl(); |
| | | List<Model.ClsGy_PaymentCondition_Model> lsmain = new List<Model.ClsGy_PaymentCondition_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_PaymentCondition(msg1); |
| | | foreach (Model.ClsGy_PaymentCondition_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_PaymentCondition where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PaymentCondition"); |
| | | 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_PaymentConditionBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_PaymentCondition_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | 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_PaymentCondition where HItemID=" + HItemID, "Gy_PaymentCondition"); |
| | | 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_PaymentCondition 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_RecConditionBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region æ¶æ¬¾æ¡ä»¶ å表 |
| | | [Route("Gy_RecConditionBill/Gy_RecConditionList")] |
| | | [HttpGet] |
| | | public object Gy_RecConditionList(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_RecCondition_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string sql1 = string.Format(@"select * from h_v_Gy_RecConditionList where 使ç¨ç»ç»='" + Organization + "'"); |
| | | |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_RecConditionList"); |
| | | |
| | | //æ·»å åå |
| | | 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_RecConditionBill/Gy_RecConditionEdit")] |
| | | [HttpPost] |
| | | public object Gy_RecConditionEdit([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(); |
| | | |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_RecCondition_Edit", 1, false, msg2)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //è·åæå¤§IDå¼èµå¼ |
| | | //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_RecCondition ", "Gy_RecCondition"); |
| | | //if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) |
| | | //{ |
| | | // //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] |
| | | // var maxid = Convert.ToInt32((Maxds.Tables[0].Rows[0]["HItemID"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"])); |
| | | // maxid += 1; |
| | | // HItemID = maxid; |
| | | //} |
| | | ListModels oListModels = new ListModels(); |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_RecCondition_Ctl oBill = new DAL.ClsGy_RecCondition_Ctl(); |
| | | List<Model.ClsGy_RecCondition_Model> lsmain = new List<Model.ClsGy_RecCondition_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_RecCondition(msg1); |
| | | foreach (Model.ClsGy_RecCondition_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_RecCondition where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_RecCondition"); |
| | | 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_RecConditionBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_RecCondition_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | 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_RecCondition where HItemID=" + HItemID, "Gy_RecCondition"); |
| | | 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_RecCondition 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_StockStatusBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region åºåç¶æ å表 |
| | | [Route("Gy_StockStatusBill/Gy_StockStatusList")] |
| | | [HttpGet] |
| | | public object Gy_StockStatusList(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_StockStatus_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string sql1 = string.Format(@"select * from h_v_Gy_StockStatusList where 使ç¨ç»ç»='" + Organization + "'"); |
| | | |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_StockStatusList"); |
| | | |
| | | //æ·»å åå |
| | | 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_StockStatusBill/Gy_StockStatusEdit")] |
| | | [HttpPost] |
| | | public object Gy_StockStatusEdit([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(); |
| | | |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_StockStatus_Edit", 1, false, msg2)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //è·åæå¤§IDå¼èµå¼ |
| | | //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_StockStatus ", "Gy_StockStatus"); |
| | | //if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) |
| | | //{ |
| | | // //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] |
| | | // var maxid = Convert.ToInt32((Maxds.Tables[0].Rows[0]["HItemID"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"])); |
| | | // maxid += 1; |
| | | // HItemID = maxid; |
| | | //} |
| | | ListModels oListModels = new ListModels(); |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_StockStatus_Ctl oBill = new DAL.ClsGy_StockStatus_Ctl(); |
| | | List<Model.ClsGy_StockStatus_Model> lsmain = new List<Model.ClsGy_StockStatus_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_StockStatus(msg1); |
| | | foreach (Model.ClsGy_StockStatus_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_StockStatus where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_StockStatus"); |
| | | 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_StockStatusBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_StockStatus_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | 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_StockStatus where HItemID=" + HItemID, "Gy_StockStatus"); |
| | | 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_StockStatus 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_SupplierContactBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region ä¾è´§æ¹è系人 å表 |
| | | [Route("Gy_SupplierContactBill/Gy_SupplierContactList")] |
| | | [HttpGet] |
| | | public object Gy_SupplierContactList(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_SupplierContact_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string sql1 = string.Format(@"select * from h_v_Gy_SupplierContactList where 使ç¨ç»ç»='" + Organization + "'"); |
| | | |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_SupplierContactList"); |
| | | |
| | | //æ·»å åå |
| | | 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_SupplierContactBill/Gy_SupplierContactEdit")] |
| | | [HttpPost] |
| | | public object Gy_SupplierContactEdit([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(); |
| | | |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_SupplierContact_Edit", 1, false, msg2)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //è·åæå¤§IDå¼èµå¼ |
| | | //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_SupplierContact ", "Gy_SupplierContact"); |
| | | //if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) |
| | | //{ |
| | | // //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] |
| | | // var maxid = Convert.ToInt32((Maxds.Tables[0].Rows[0]["HItemID"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"])); |
| | | // maxid += 1; |
| | | // HItemID = maxid; |
| | | //} |
| | | ListModels oListModels = new ListModels(); |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_SupplierContact_Ctl oBill = new DAL.ClsGy_SupplierContact_Ctl(); |
| | | List<Model.ClsGy_SupplierContact_Model> lsmain = new List<Model.ClsGy_SupplierContact_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_SupplierContact(msg1); |
| | | foreach (Model.ClsGy_SupplierContact_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_SupplierContact where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_SupplierContact"); |
| | | 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_SupplierContactBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_SupplierContact_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | 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_SupplierContact where HItemID=" + HItemID, "Gy_SupplierContact"); |
| | | 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_SupplierContact 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_TaxRateBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region 仿¬¾æ¡ä»¶ å表 |
| | | [Route("Gy_TaxRateBill/Gy_TaxRateList")] |
| | | [HttpGet] |
| | | public object Gy_TaxRateList(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string sql1 = string.Format(@"select * from h_v_Gy_TaxRateList where 使ç¨ç»ç»='" + Organization + "'"); |
| | | |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_TaxRateList"); |
| | | |
| | | //æ·»å åå |
| | | 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_TaxRateBill/Gy_TaxRateEdit")] |
| | | [HttpPost] |
| | | public object Gy_TaxRateEdit([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(); |
| | | |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Edit", 1, false, msg2)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //è·åæå¤§IDå¼èµå¼ |
| | | //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_TaxRate ", "Gy_TaxRate"); |
| | | //if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) |
| | | //{ |
| | | // //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] |
| | | // var maxid = Convert.ToInt32((Maxds.Tables[0].Rows[0]["HItemID"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"])); |
| | | // maxid += 1; |
| | | // HItemID = maxid; |
| | | //} |
| | | ListModels oListModels = new ListModels(); |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_TaxRate_Ctl oBill = new DAL.ClsGy_TaxRate_Ctl(); |
| | | List<Model.ClsGy_TaxRate_Model> lsmain = new List<Model.ClsGy_TaxRate_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_TaxRate(msg1); |
| | | foreach (Model.ClsGy_TaxRate_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_TaxRate where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_TaxRate"); |
| | | 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_TaxRateBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_TaxRate_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | 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_TaxRate where HItemID=" + HItemID, "Gy_TaxRate"); |
| | | 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_TaxRate 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_StockStatus_Model> getObjectByJson_Gy_StockStatus(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsGy_StockStatus_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_StockStatus_Model>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤ç仿¬¾æ¡ä»¶è¡¨çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsGy_PaymentCondition_Model> getObjectByJson_Gy_PaymentCondition(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsGy_PaymentCondition_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_PaymentCondition_Model>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çç¨ç表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsGy_TaxRate_Model> getObjectByJson_Gy_TaxRate(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsGy_TaxRate_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_TaxRate_Model>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ¶æ¬¾æ¡ä»¶è¡¨çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsGy_RecCondition_Model> getObjectByJson_Gy_RecCondition(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsGy_RecCondition_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_RecCondition_Model>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çä¾è´§æ¹è系人表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsGy_SupplierContact_Model> getObjectByJson_Gy_SupplierContact(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsGy_SupplierContact_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_SupplierContact_Model>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ¶è´§æ¹è系人表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsGy_COMMONCONTACT_Model> getObjectByJson_Gy_COMMONCONTACT(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsGy_COMMONCONTACT_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_COMMONCONTACT_Model>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢å®¡æ ¸é¡¹ç®çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | |
| | | <Compile Include="Controllers\ä»å管ç\颿åè´§\Kf_StepFoldOutBillController.cs" /> |
| | | <Compile Include="Controllers\ä»å管ç\éªæ¶å
¥åº\Kf_StepFoldinBillController.cs" /> |
| | | <Compile Include="Controllers\忥èªå¨æ«ç 线\ScanlineAPIController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_COMMONCONTACTBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_DutyBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_PaymentConditionListBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_RecConditionBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_SOPBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_SOPBillEditController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_SOPBillListController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_StockCheckItemBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_StockStatusBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_SupplierContactBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_TaxRateBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_WorkStationBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Xt_CheckFlowBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Xt_CheckItemBillController.cs" /> |
| | |
| | | <Folder Include="Views\Cj_CallGoodsBillMain\" /> |
| | | <Folder Include="Views\Cj_ComplementGoodsBill\" /> |
| | | <Folder Include="Views\Cj_SendGoodsBill\" /> |
| | | <Folder Include="Views\Gy_COMMONCONTACTBill\" /> |
| | | <Folder Include="Views\Gy_ConkType\" /> |
| | | <Folder Include="Views\Gy_DutyBill\" /> |
| | | <Folder Include="Views\Gy_EquipType\" /> |
| | | <Folder Include="Views\Gy_ICBomBill\" /> |
| | | <Folder Include="Views\Gy_MateMould\" /> |
| | | <Folder Include="Views\Gy_PackType\" /> |
| | | <Folder Include="Views\Gy_PaymentConditionListBill\" /> |
| | | <Folder Include="Views\Gy_RecConditionBill\" /> |
| | | <Folder Include="Views\Gy_RoutingGroup\" /> |
| | | <Folder Include="Views\Gy_SOPBill\" /> |
| | | <Folder Include="Views\Gy_StockStatusBill\" /> |
| | | <Folder Include="Views\Gy_SupplierContactBill\" /> |
| | | <Folder Include="Views\Gy_TaxRateBill\" /> |
| | | <Folder Include="Views\Gy_WorkStation\" /> |
| | | <Folder Include="Views\JIT_DayPlanPlatFormBill\" /> |
| | | <Folder Include="Views\JIT_DayPlanPlatFormImport\" /> |