DAL/DAL.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DAL/信息平台/ClsOA_ErrMsgBackReceiveBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/Model.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/信息平台/ClsOA_ErrMsgBackReceiveBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/信息平台/ClsOA_ErrMsgBackReceiveBillSub.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/基础资料/基础资料/ClsGy_ErrMsgBackType_Model.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/WebAPIController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/DLL/ClsGy_ErrMsgBackType_Ctl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/ListModels.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Service/LuBaoSevice.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DAL/DAL.csproj
@@ -95,6 +95,7 @@ <Compile Include="ä»åºç®¡ç\ClsKf_SellOutBillForLayUI.cs" /> <Compile Include="ä»åºç®¡ç\æ¡ç 管ç\ClsGy_BarCodeBill_ChaiMa.cs" /> <Compile Include="ä»åºç®¡ç\æ¡ç 管ç\ClsKF_BarCodeStatusChangeBill.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackReceiveBill.cs" /> <Compile Include="åºç¡èµæ\InterFaceåºç¡èµæ\ClsIF_ORGANIZATIONS_View.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_BadType_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_CardChangeType_Ctl.cs" /> DAL/ÐÅϢƽ̨/ClsOA_ErrMsgBackReceiveBill.cs
New file @@ -0,0 +1,318 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsOA_ErrMsgBackReceiveBill:DBUtility.ClsXt_BaseBill { public Model.ClsOA_ErrMsgBackReceiveBillMain omodel = new Model.ClsOA_ErrMsgBackReceiveBillMain(); public List<Model.ClsOA_ErrMsgBackReceiveBillSub> DetailColl = new List<Model.ClsOA_ErrMsgBackReceiveBillSub>(); public ClsOA_ErrMsgBackReceiveBill() { base.MvarItemKeySub = "OA_ErrMsgBackReceiveBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey= "OA_ErrMsgBackReceiveBillMain"; base.MvarReportTitle = "å¼å¸¸å馿¥æ¶å"; base.BillType = "4529"; base.HBillSubType = "4529"; } #region åºå®ä»£ç ~ClsOA_ErrMsgBackReceiveBill() { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { //ä¿ååæ§å¶========================================= string HBillNote = ""; DataSet ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackReceiveBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackReceiveBill_BeforeSaveCtrl"); if (ds == null) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") { sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); return false; } //========================================================= // oCn.BeginTran(); //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate OA_ErrMsgBackReceiveBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== ",HDate='" + omodel.HDate + "'" + ",HYear='" + omodel.HYear.ToString() + "'" + ",HPeriod='" + omodel.HPeriod.ToString() + "'" + ",HRemark='" + omodel.HRemark + "'" + ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + ",HUpDateDate=getdate()" + //======================================== ",HDeptID='" + omodel.HDeptID.ToString() + "'" + ",HReceiveID='" + omodel.HReceiveID.ToString() + "'" + ",HSendMan='" + omodel.HSendMan + "'" + ",HReceiveMan='" + omodel.HReceiveMan + "'" + ",HCopyMan='" + omodel.HCopyMan + "'" + ",HLevel='" + omodel.HLevel + "'" + ",HErrMsgBackTypeID='" + omodel.HErrMsgBackTypeID.ToString() + "',HContext='" + omodel.HContext + "'" + ",HDescription='" + omodel.HDescription + "'" + ",HBillTypeName='" + omodel.HBillTypeName + "'" + ",HPlanBillNo='" + omodel.HPlanBillNo + "'" + ",HMaterName='" + omodel.HMaterName + "'" + ",HMaterModel='" + omodel.HMaterModel + "'" + ",HEquipID='" + omodel.HEquipID.ToString() + "',HMouldID='" + omodel.HMouldID.ToString() + "',HRelationEmpID='" + omodel.HRelationEmpID.ToString() + "',HReceiveNote='" + omodel.HReceiveNote + "'" + ",HReceiveDate='" + omodel.HReceiveDate+"'" + ",HHandleEmpID='" + omodel.HHandleEmpID.ToString() + "',HHandleAdvise='" + omodel.HHandleAdvise + "' where HInterID=" + lngBillKey.ToString()); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); //å é¤å表 DeleteBillSub(lngBillKey); //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackReceiveBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackReceiveBill_AfterSaveCtrl"); if (ds2 == null) { sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; oCn.RollBack(); return false; } if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") { sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); oCn.RollBack(); return false; } //============================ sReturn = "ä¿®æ¹åæ®æåï¼"; oCn.Commit(); return true; } catch (Exception e) { sReturn = e.Message; oCn.RollBack(); throw (e); } } //æ°å¢åæ® public override bool AddBill(ref string sReturn) { try { //å¾å°mainid //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //è¥MAINDIéå¤åéæ°è·å oCn.BeginTran(); //ä¿ååæ§å¶========================================= string HBillNote = ""; DataSet ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackReceiveBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackReceiveBill_BeforeSaveCtrl"); if (ds == null) { sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; return false; } if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") { sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); return false; } //========================================================= string sql = ""; sql = "Insert Into OA_ErrMsgBackReceiveBillMain" + "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HYear,HPeriod,HRemark,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType," + "HDeptID,HReceiveID,HSendMan,HReceiveMan,HCopyMan,HLevel,HErrMsgBackTypeID,HContext,HDescription,HBillTypeName,HPlanBillNo,HMaterName,HMaterModel,HEquipID,HMouldID,HRelationEmpID,HReceiveNote,HReceiveDate,HHandleEmpID,HHandleAdvise) " + " values(" + "'" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'," + omodel.HYear + "," + omodel.HPeriod + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + ",'" + omodel.HMainSourceInterID + "','" + omodel.HMainSourceEntryID + "','" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "','" + omodel.HDeptID.ToString() + "','" + omodel.HReceiveID.ToString() + "','" + omodel.HSendMan + "','" + omodel.HReceiveMan + "','" + omodel.HCopyMan + "','" + omodel.HLevel + "','" + omodel.HErrMsgBackTypeID.ToString() + "','" + omodel.HContext + "','" + omodel.HDescription + "','" + omodel.HBillTypeName + "','" + omodel.HPlanBillNo + "','" + omodel.HMaterName + "','" + omodel.HMaterModel + "','" + omodel.HEquipID.ToString() + "','" + omodel.HMouldID.ToString() + "','" + omodel.HRelationEmpID.ToString() + "','" + omodel.HReceiveNote + "','" + omodel.HReceiveDate + "','" + omodel.HHandleEmpID.ToString() + "','" + omodel.HHandleAdvise + "') "; //主表 oCn.RunProc(sql); //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackReceiveBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackReceiveBill_AfterSaveCtrl"); if (ds2 == null) { sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; oCn.RollBack(); return false; } if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") { sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); oCn.RollBack(); return false; } //============================ sReturn = "æ°å¢åæ®æåï¼"; oCn.Commit(); return true; } catch (Exception e) { sReturn = e.Message; oCn.RollBack(); throw (e); } } //æ¾ç¤ºåæ® public override bool ShowBill(Int64 lngBillKey, ref string sReturn) { try { //æ¥è¯¢ä¸»è¡¨ DataSet Ds ; Ds = oCn.RunProcReturn("Select * from OA_ErrMsgBackReceiveBillMain Where HInterID=" + lngBillKey.ToString(), "OA_ErrMsgBackReceiveBillMain"); if(Ds.Tables[0].Rows.Count==0) { sReturn = "åæ®æªæ¾å°ï¼"; return false; } //åºå®èµå¼=========================================== omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); //======================================================== //omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); //omodel.HContext = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HContext"]); //omodel.HDescription = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDescription"]); //omodel.HSendMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSendMan"]); //omodel.HReceiveMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HReceiveMan"]); //omodel.HCopyMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCopyMan"]); //omodel.HLevel = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HLevel"]); //omodel.HReTransmitMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HReTransmitMan"]); //omodel.HBillTypeName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillTypeName"]); //omodel.HPlanBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HPlanBillNo"]); //omodel.HMaterName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterName"]); //omodel.HMaterModel = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterModel"]); //omodel.HSendType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSendType"]); //omodel.HHasten = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HHasten"]); //omodel.HQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HQty"]); // //å¾ªç¯ DataSet DsSub ; DsSub = oCn.RunProcReturn("Select * from OA_ErrMsgBackReceiveBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "OA_ErrMsgBackReceiveBillSub"); DetailColl.Clear();//æ¸ ç©º for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) { Model.ClsOA_ErrMsgBackReceiveBillSub oSub = new Model.ClsOA_ErrMsgBackReceiveBillSub(); // åºå®èµå¼=============================================== oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); //=================================================== //oSub.HDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HDate"]); //oSub.HSendStatus = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSendStatus"]); //oSub.HSendMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSendMan"]); //oSub.HDescription = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDescription"]); DetailColl.Add(oSub); } sReturn = "æ¾ç¤ºåæ®æåï¼"; return true; } catch (Exception e) { sReturn = e.Message; throw (e); } } } } Model/Model.csproj
@@ -286,7 +286,9 @@ <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ComFileBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ComFileBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_EmpMinMessage.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackReceiveBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackReceiveBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackBillSub2.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_InformBillMain.cs" /> @@ -348,6 +350,7 @@ <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CardStatus_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CardAddress_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CardType_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_ErrMsgBackType_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_StockCheckItem_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_InspectInstruMent_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_InspectBasis_Model.cs" /> Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackReceiveBillMain.cs
New file @@ -0,0 +1,30 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsOA_ErrMsgBackReceiveBillMain : DBUtility.ClsXt_BaseBillMain { public int HDeptID ; // åéé¨é¨(Gy_Department) public int HReceiveID ; // æ¥æ¶é¨é¨(Gy_Department) public string HSendMan ; // åé人ï¼gy_czyglï¼(åè½è· å¼å¸¸åé¦å ä¸è´) public string HReceiveMan ; // æ¥æ¶äººï¼gy_czyglï¼(åè½è· å¼å¸¸åé¦å ä¸è´) public string HCopyMan ; // æéï¼gy_czyglï¼(åè½è· å¼å¸¸åé¦å ä¸è´) public string HLevel ; // ç´§æ¥ç¨åº¦ï¼æ®éï¼ç´§æ¥ï¼ public int HErrMsgBackTypeID ; // å¼å¸¸ç±»åï¼Gy_ErrMsgBackTypeï¼ public string HContext ; // ä¸»é¢ public string HDescription ; // å 容 public string HBillTypeName ; // åæ®ç±»å public string HPlanBillNo ; // åæ®å·ç public string HMaterName ; // 产ååç§° public string HMaterModel ; // è§æ ¼åå· public int HEquipID ; // ç¸å ³è®¾å¤ï¼Gy_EquipFileBillMainï¼ public int HMouldID ; // ç¸å ³æ¨¡æ²»å ·ï¼Gy_MouldFileMainï¼ public int HRelationEmpID ; // å ³è人ï¼Gy_Employeeï¼ public string HReceiveNote ; // æ¥æ¶ç¡®è®¤ public DateTime HReceiveDate ; // æ¥æ¶ç¡®è®¤æ¶é´ï¼å¹´ææ¥æ¶åç§ï¼ public int HHandleEmpID ; // ææ´¾å¤ç人ï¼Gy_Employeeï¼ public string HHandleAdvise ; // å¤ç建议 } } Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackReceiveBillSub.cs
New file @@ -0,0 +1,11 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsOA_ErrMsgBackReceiveBillSub : DBUtility.ClsXt_BaseBillSub { } } Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_ErrMsgBackType_Model.cs
New file @@ -0,0 +1,14 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_ErrMsgBackType_Model : DBUtility.ClsGy_Base_Model { public DateTime HMakeTime; public int HUSEORGID; public string HMakeEmp; public DateTime HModifyTime; } } WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
@@ -4876,6 +4876,247 @@ } #endregion #region å¼å¸¸åé¦ç±»å æ¥è¯¢,å®¡æ ¸ï¼åå®¡æ ¸ï¼ç¦ç¨ï¼åç¦ç¨ /// <summary> /// å¼å¸¸åé¦ç±»å æ¥è¯¢ /// </summary> /// <param name="sWhere"></param> /// <param name="user"></param> /// <returns></returns> [Route("Gy_BadReason/Gy_ErrMsgBackTypeList")] [HttpGet] public object Gy_ErrMsgBackTypeList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_ErrMsgBackType_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_ErrMsgBackType where 1 = 1"; string sql = sql1 + sWhere + " order by å¼å¸¸åé¦ç±»å代ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_ErrMsgBackType"); //æ·»å åå 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.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } /// <summary> /// å¼å¸¸åé¦ç±»å å®¡æ ¸ãåå®¡æ ¸ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_BadReason/AuditGy_ErrMsgBackType")] [HttpGet] public object AuditGy_ErrMsgBackType(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_ErrMsgBackType_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_ErrMsgBackType where HItemID=" + HInterID, "Gy_ErrMsgBackType"); if (ds.Tables[0].Rows.Count > 0) { if (IsAudit == 0) //å®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); if (IsAudit == 0) //å®¡æ ¸å¤æ { oCN.RunProc("update Gy_ErrMsgBackType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update Gy_ErrMsgBackType set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸æå"; objJsonResult.data = null; } oCN.Commit(); return objJsonResult; } catch (Exception e) { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } /// <summary> /// å¼å¸¸åé¦ç±»å ç¦ç¨ãåç¦ç¨ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsStop">ç¦ç¨(0),åç¦ç¨(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_BadReason/StopGy_ErrMsgBackType")] [HttpGet] public object StopGy_ErrMsgBackType(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_ErrMsgBackType_Close", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_ErrMsgBackType where HItemID=" + HInterID, "Gy_ErrMsgBackType"); if (ds.Tables[0].Rows.Count > 0) { if (IsStop == 0) //ç¦ç¨å¤æ { if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ç¦ç¨!ä¸è½å次ç¦ç¨ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsStop == 1) //åç¦ç¨å¤æ { if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªç¦ç¨!ä¸éè¦åç¦ç¨!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); if (IsStop == 0) //ç¦ç¨å¤æ { oCN.RunProc("update Gy_ErrMsgBackType set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ç¦ç¨æå"; objJsonResult.data = null; } if (IsStop == 1) //åç¦ç¨å¤æ { oCN.RunProc("update Gy_ErrMsgBackType set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åç¦ç¨æå"; objJsonResult.data = null; } oCN.Commit(); return objJsonResult; } catch (Exception e) { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥æè åç¦ç¨å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region å¼å¸¸ç±»å æ¥è¯¢ [Route("Gy_BadReason/Gy_ErrTypeList")] WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -28,6 +28,7 @@ public DLL.ClsOA_ErrMsgBackBill BillNew = new DLL.ClsOA_ErrMsgBackBill(); //对åºåæ®ç±» public DLL.ClsOA_ErrMsgBackBill BillOld = new DLL.ClsOA_ErrMsgBackBill(); //对åºåæ®ç±» #region æ¥å·¥å¹³å°å¼å¸¸åé¦åä¿å/ç¼è¾ /// <summary> /// å¼å¸¸åé¦å @@ -746,5 +747,918 @@ } #endregion #region å¼å¸¸åé¦ æ¥æ¶/ç¾å° åå表 æ ¹æ®å¼å¸¸åé¦å䏿¨è·åæ°æ® [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackList")] [HttpGet] public object Get_OA_ErrMsgBackList(string HInterID,string HEntryID, string user,int num) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackBill_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } if (num == 1) //å¼å¸¸åé¦å { string sql = "select * from h_v_OA_ErrMsgBackBillList where HInterID = '" + HInterID + "' and HEntryID = '" + HEntryID + "'"; ds = oCN.RunProcReturn(sql, "p_v_OA_ErrMsgBackBillList"); } else if (num==2) //å¼å¸¸å馿¥æ¶å { string sql = "select * from h_v_OA_ErrMsgBackReceiveBillMainList where HInterID = '" + HInterID + "' and HEntryID = '" + HEntryID + "'"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillMainList"); } //æ·»å åå 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.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception ex) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¥è¯¢æ°æ®å¼å¸¸ï¼è¯·ä¸ç®¡çåèç³»ï¼" + ex.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region å¼å¸¸å馿¥æ¶å æ°å¢/ç¼è¾ [Route("Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackReceiveBill")] [HttpPost] public object SaveOA_ErrMsgBackReceiveBill([FromBody] JObject msg) { var _value = msg["msg"].ToString(); string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); //string msg3 = sArray[1].ToString(); //å表 string refSav = sArray[1].ToString();//æä½æ¹å¼æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ string msg4 = sArray[2].ToString();//ç¨æ·å DBUtility.ClsPub.CurUserName = msg4; string UserName = ""; string s = ""; ListModels oListModels = new ListModels(); try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("OA_ErrMsgBackReceiveBillMain_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } // OA_ErrMsgBackReceiveBill DAL.ClsOA_ErrMsgBackReceiveBill oBill = new DAL.ClsOA_ErrMsgBackReceiveBill(); List<Model.ClsOA_ErrMsgBackReceiveBillMain> lsmain = new List<Model.ClsOA_ErrMsgBackReceiveBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_OA_ErrMsgBackReceiveBill(msg2); foreach (Model.ClsOA_ErrMsgBackReceiveBillMain oItem in lsmain) { if (refSav == "Add") { //忮巿¯å¦éå¤ if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å 许ä¿åï¼"; objJsonResult.data = 1; return objJsonResult; } } if (refSav == "Update") { if (oBill.ShowBill(oItem.HInterID, ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; objJsonResult.data = 1; return objJsonResult; } //夿æ¯å¦å¯ç¼è¾ if (oBill.omodel.HChecker != "" && oBill.omodel.HChecker != null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } if (oBill.omodel.HBillStatus > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å¤äºä¸å¯ç¼è¾ç¶æï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(oBill, ref s)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s + "ï¼ä¸å 许修æ¹"; objJsonResult.data = 1; return objJsonResult; } } UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "4529"; oItem.HBillSubType = "4529"; oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; objJsonResult.data = 1; return objJsonResult; } oBill.omodel = oItem; } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (refSav == "Add") { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else if (refSav == "Update") { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); } else { bResult = false; } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } #endregion #region å¼å¸¸å馿¥æ¶å ç¼è¾åæ¾å表 [Route("Sc_MESTransFerWorkBill/Edit_OA_ErrMsgBackReceiveBill")] [HttpGet] public object Edit_OA_ErrMsgBackReceiveBill(string HID) { try { List<object> columnNameList = new List<object>(); string sql = "select * from h_v_OA_ErrMsgBackReceiveBillMainList where hmainid='"+HID+"'"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillMainList"); //æ·»å åå 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.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception ex) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¥è¯¢æ°æ®å¼å¸¸ï¼è¯·ä¸ç®¡çåèç³»ï¼" + ex.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region å¼å¸¸å馿¥æ¶åå表 [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackReceiveBillList")] [HttpGet] public object Get_OA_ErrMsgBackReceiveBillList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackReceiveBillMain_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } if (sWhere == null || sWhere.Equals("")) { string sql = "select * from h_v_OA_ErrMsgBackReceiveBillMainList order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillMainList"); } else { string sql1 = "select * from h_v_OA_ErrMsgBackReceiveBillMainList where 1 = 1 "; string sql = sql1 + sWhere + " order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillMainList"); } //æ·»å åå 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.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception ex) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¥è¯¢æ°æ®å¼å¸¸ï¼è¯·ä¸ç®¡çåèç³»ï¼" + ex.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region å¼å¸¸å馿¥æ¶å å é¤ /// <summary> ///åæ°ï¼string HInterIDã ///è¿åå¼ï¼objectã /// </summary> [Route("Sc_MESTransFerWorkBill/DeleteOA_ErrMsgBackReceiveBill")] [HttpGet] public object DeleteOA_ErrMsgBackReceiveBill(string HInterID, string user) { try { string s = ""; DAL.ClsOA_ErrMsgBackReceiveBill BillOld = new DAL.ClsOA_ErrMsgBackReceiveBill(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackReceiveBillMain_Delete", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿éï¼"; objJsonResult.data = null; return objJsonResult; } if (HInterID == null || HInterID.Equals("")) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDä¸è½ä¸ºç©ºï¼"; objJsonResult.data = null; return objJsonResult; } if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; objJsonResult.data = 1; return objJsonResult; } //夿æ¯å¦å¯å é¤ if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å 许å é¤ï¼"; objJsonResult.data = 1; return objJsonResult; } //å é¤åæ§å¶========================================= string sql1 = "exec h_p_OA_ErrMsgBackReceiveBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackReceiveBill_BeforeDelCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } //================================================================================== oCN.BeginTran(); oCN.RunProc("delete from OA_ErrMsgBackReceiveBillMain where HInterID = " + HInterID); oCN.RunProc("delete from OA_ErrMsgBackReceiveBillSub where HInterID= " + HInterID); //å é¤åæ§å¶================================================================================== string sql2 = "exec h_p_OA_ErrMsgBackReceiveBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql2, "h_p_OA_ErrMsgBackReceiveBill_AfterDelCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { s = "å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å é¤å¤±è´¥!åå :" + s; objJsonResult.data = null; oCN.RollBack(); return objJsonResult; } if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") { s = ds.Tables[0].Rows[0]["HRemark"].ToString(); objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å é¤å¤±è´¥!åå :" + s; objJsonResult.data = null; oCN.RollBack(); return objJsonResult; } //============================================================================================== oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å 餿å"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region å¼å¸¸å馿¥æ¶å å®¡æ ¸/åå®¡æ ¸ /// <summary> /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Sc_MESTransFerWorkBill/AuditOA_ErrMsgBackReceiveBill")] [HttpGet] public object AuditOA_ErrMsgBackReceiveBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackReceiveBillMain_Check"; DBUtility.ClsPub.CurUserName = CurUserName; try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } //HInterIDæ°æ®å¤æ if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ DAL.ClsOA_ErrMsgBackReceiveBill oBill = new DAL.ClsOA_ErrMsgBackReceiveBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® { if (oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 0) //å®¡æ ¸å¤æ { if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } //è¿è¡éè¦è¿è¡çå®¡æ ¸/åå®¡æ ¸æä½ if (IsAudit == 0) //å®¡æ ¸æäº¤ { oCN.BeginTran(); //è®°å½è¿åä¿¡æ¯ string msg = ""; //å®¡æ ¸åæ§å¶========================================= string sql1 = "exec h_p_OA_ErrMsgBackReceiveBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackReceiveBill_BeforeCheckCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :å®¡æ ¸åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; objJsonResult.data = null; oCN.RollBack(); return objJsonResult; } if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; oCN.RollBack(); return objJsonResult; } //================================================================================== //å®¡æ ¸æäº¤ if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackReceiveBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æåï¼" + msg; objJsonResult.data = null; return objJsonResult; } else { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸æäº¤ { //åå®¡æ ¸åæ§å¶========================================= string sql1 = "exec h_p_OA_ErrMsgBackReceiveBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackReceiveBill_BeforeUnCheckCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :åå®¡æ ¸åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } //=========================================================== //åå®¡æ ¸æäº¤AbandonCheck if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackReceiveBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸æå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } return objJsonResult; } catch (Exception e) { oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region å¼å¸¸å馿¥æ¶å å ³é/åå ³é /// <summary> /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å ³é(0),åå ³é(1)</param> /// <param name="CurUserName">å ³é人</param> /// <returns></returns> [Route("Sc_MESTransFerWorkBill/CloseOA_ErrMsgBackReceiveBill")] [HttpGet] public object CloseOA_ErrMsgBackReceiveBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackReceiveBillMain_Close"; DBUtility.ClsPub.CurUserName = CurUserName; try { //æ£æ¥æé if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³éå¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } //HInterIDæ°æ®å¤æ if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ DAL.ClsOA_ErrMsgBackReceiveBill oBill = new DAL.ClsOA_ErrMsgBackReceiveBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® { if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸è½è¿è¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 0) //å ³é夿 { if (oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå ³é夿 { if (oBill.omodel.HCloseMan.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå ³é!ä¸éè¦åå ³éï¼"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } //è¿è¡éè¦è¿è¡çå ³é/åå ³éæä½ if (IsAudit == 0) //å ³éæäº¤ { //å ³éæäº¤ if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å ³éæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå ³éæäº¤ { //åå ³éæäº¤ if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå ³éæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå ³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³é失败æè åå ³é失败ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region å¼å¸¸å馿¥æ¶å ä½åº/åä½åº /// <summary> /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">ä½åº(0),åä½åº(1)</param> /// <param name="CurUserName">ä½åºäºº</param> /// <returns></returns> [Route("Sc_MESTransFerWorkBill/DeleteOA_ErrMsgBackReceiveBill")] [HttpGet] public object DeleteOA_ErrMsgBackReceiveBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackReceiveBillMain_Drop"; DBUtility.ClsPub.CurUserName = CurUserName; try { //æ£æ¥æé if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä½åºå¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } //HInterIDæ°æ®å¤æ if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ DAL.ClsOA_ErrMsgBackReceiveBill oBill = new DAL.ClsOA_ErrMsgBackReceiveBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® { if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åºï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 0) //ä½åºå¤æ { if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½åä½åºï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åä½åºå¤æ { if (oBill.omodel.HDeleteMan.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦åä½åºï¼"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } //è¿è¡éè¦è¿è¡çä½åº/åä½åºæä½ if (IsAudit == 0) //ä½åºæäº¤ { //ä½åºæäº¤ if (oBill.Cancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ä½åºæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå ³éæäº¤ { //åå ³éæäº¤ if (oBill.AbandonCancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åä½åºæå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä½åºå¤±è´¥æè åä½åºå¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } } WebAPI/Controllers/WebAPIController.cs
@@ -8210,6 +8210,307 @@ } #endregion #region å¼å¸¸åé¦ç±»å 设置å表/ä¿å/ç¼è¾/å 餿¹æ³ /// <summary> /// å¼å¸¸åé¦ç±»å ä¿å /// </summary> /// <param name="msg"></param> /// <returns></returns> [Route("SaveGy_ErrMsgBackType")] [HttpPost] public object SaveGy_ErrMsgBackType([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(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_ErrMsgBackType_Edit", 1, false, msg2)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } Int64 HItemID = 0; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); //è·åæå¤§IDå¼èµå¼ DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_ErrMsgBackType ", "Gy_ErrMsgBackType"); 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"]); maxid += 1; HItemID = maxid; } ListModels oListModels = new ListModels(); try { WebAPI.DLL.ClsGy_ErrMsgBackType_Ctl oBill = new WebAPI.DLL.ClsGy_ErrMsgBackType_Ctl(); List<Model.ClsGy_ErrMsgBackType_Model> lsmain = new List<Model.ClsGy_ErrMsgBackType_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); lsmain = oListModels.getObjectByJson_Gy_ErrMsgBackType(msg1); foreach (Model.ClsGy_ErrMsgBackType_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; } if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; objJsonResult.data = 1; return objJsonResult; } //æ¥è¯¢æ°æ®ä¸æ¯å¦åå¨éå¤ä»£ç ds = oCN.RunProcReturn("select * from Gy_ErrMsgBackType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_ErrMsgBackType"); if (oItem.HNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç 为空ï¼"; objJsonResult.data = 1; return objJsonResult; } //æ°å¢æ¶å¤æ if (oItem.HItemID == 0) { if (ds == null || ds.Tables[0].Rows.Count == 0) { } else { 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; } } } //å¾å°ç代ç 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.HShortNumber = sShortNumber;//ç代ç oItem.HEndFlag = true;//æ«çº§æ å¿ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //ç级 oItem.HMakeEmp = msg2; //å建人 oBill.oModel = oItem; } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.oModel.HItemID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } if (bResult) { objJsonResult.code = "0"; 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; } } /// <summary> /// å¼å¸¸åé¦ç±»å è·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_ErrMsgBackTypeDetail")] [HttpGet] public ApiResult<DataSet> GetGy_ErrMsgBackTypeDetail(string HID) { var model = LuBaoSevice.GetGy_ErrMsgBackTypeDetail(HID); return model; } /// <summary> /// å¼å¸¸åé¦ç±»å å é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_ErrMsgBackType")] [HttpGet] public object DeltetGy_ErrMsgBackType(string HItemID, string user) { DataSet ds; //string ModRightNameCheck = "Sc_ProcessReport_check"; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_ErrMsgBackType_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿éï¼"; objJsonResult.data = null; return objJsonResult; } SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (string.IsNullOrWhiteSpace(HItemID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HItemID为空ï¼"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran();//å¼å§äºå¡ ds = oCN.RunProcReturn("select * from Gy_ErrMsgBackType where HItemID=" + HItemID, "Gy_ErrMsgBackType"); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ç¦ç¨!ä¸è½è¿è¡å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!"; objJsonResult.data = null; return objJsonResult; } oCN.RunProc("delete Gy_ErrMsgBackType 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> /// ç¨å ³èå·¥åºè·åä¿¡æ¯ WebAPI/DLL/ClsGy_ErrMsgBackType_Ctl.cs
New file @@ -0,0 +1,102 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace WebAPI.DLL { public class ClsGy_ErrMsgBackType_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_ErrMsgBackType_Model oModel = new Model.ClsGy_ErrMsgBackType_Model(); //æ°å¢ public override bool AddNew() { // try { oCn.BeginTran(); oCn.RunProc("Insert into " + MvarItemKey + " " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " + " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", 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 + "'" + ",HHelpCode='" + oModel.HHelpCode + "'" + ",HModifyTime='" + DateTime.Now + "'" + ",HUSEORGID='" + oModel.HUSEORGID + "'" + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + ",HUseFlag='" + oModel.HUseFlag + "'" + ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",HRemark= '" + oModel.HRemark + "' 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_ErrMsgBackType_Ctl() { MvarItemKey = "Gy_ErrMsgBackType"; MvarReportTitle = "å¼å¸¸åé¦ç±»å设置"; oModel = new Model.ClsGy_ErrMsgBackType_Model(); } } } WebAPI/ListModels.cs
@@ -1062,6 +1062,31 @@ List<Model.ClsGy_ProjectMoney_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_ProjectMoney_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢å¼å¸¸å馿¥æ¶å表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsOA_ErrMsgBackReceiveBillMain> getObjectByJson_OA_ErrMsgBackReceiveBill(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsOA_ErrMsgBackReceiveBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsOA_ErrMsgBackReceiveBillMain>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢å¼å¸¸åé¦ç±»å表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_ErrMsgBackType_Model> getObjectByJson_Gy_ErrMsgBackType(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_ErrMsgBackType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_ErrMsgBackType_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢å¼å¸¸ç±»å表çjson /// </summary> WebAPI/Service/LuBaoSevice.cs
@@ -624,6 +624,25 @@ } /// <summary> /// å¼å¸¸åé¦ç±»åæ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_ErrMsgBackTypeDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_ErrMsgBackTypeDb(HID); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) return new ApiResult<DataSet> { code = -1, msg = "ä¸åå¨é¡¹ç®è´¹ç¨æ°æ®" }; return new ApiResult<DataSet> { code = 1, msg = "æ¥è¯¢æå", data = dataSet }; } public static DataSet GetGy_ErrMsgBackTypeDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_ErrMsgBackType where HItemID= " + HID + " ", "h_v_Gy_ErrMsgBackType"); return dataSet; } /// <summary> ///客æ·åç±»æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_CusTypeDetail(string HID) WebAPI/WebAPI.csproj
@@ -645,6 +645,7 @@ <Compile Include="DLL\ClsGy_PoStockStyle_Ctl.cs" /> <Compile Include="DLL\ClsGy_AreaSet_Ctl.cs" /> <Compile Include="DLL\ClsGy_CusType_Ctl.cs" /> <Compile Include="DLL\ClsGy_ErrMsgBackType_Ctl.cs" /> <Compile Include="DLL\ClsGy_StockCheckItem_Ctl.cs" /> <Compile Include="DLL\ClsGy_ProjectMoney_Ctl.cs" /> <Compile Include="DLL\ClsGy_SupType_Ctl.cs" />