| | |
| | | <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" /> |
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 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\" /> |