DAL/DAL.csproj
@@ -95,6 +95,8 @@ <Compile Include="ä»åºç®¡ç\ClsKf_SellOutBillForLayUI.cs" /> <Compile Include="ä»åºç®¡ç\æ¡ç 管ç\ClsGy_BarCodeBill_ChaiMa.cs" /> <Compile Include="ä»åºç®¡ç\æ¡ç 管ç\ClsKF_BarCodeStatusChangeBill.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackSignBill.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" /> @@ -626,6 +628,7 @@ <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsSc_MouldStatusChangeBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_EquipFileMain.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_EquipTypeBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_FixCardChangeBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_FixCardBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipWorkBeforeCheckBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipStockInCheckBill.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); } } } } DAL/ÐÅϢƽ̨/ClsOA_ErrMsgBackSignBill.cs
New file @@ -0,0 +1,321 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsOA_ErrMsgBackSignBill:DBUtility.ClsXt_BaseBill { public Model.ClsOA_ErrMsgBackSignBillMain omodel = new Model.ClsOA_ErrMsgBackSignBillMain(); public List<Model.ClsOA_ErrMsgBackSignBillSub> DetailColl = new List<Model.ClsOA_ErrMsgBackSignBillSub>(); public ClsOA_ErrMsgBackSignBill() { base.MvarItemKeySub = "OA_ErrMsgBackSignBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey= "OA_ErrMsgBackSignBillMain"; base.MvarReportTitle = "å¼å¸¸åé¦ç¾å°å"; base.BillType = "4530"; base.HBillSubType = "4530"; } #region åºå®ä»£ç ~ClsOA_ErrMsgBackSignBill() { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { //ä¿ååæ§å¶========================================= string HBillNote = ""; DataSet ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackSignBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackSignBill_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_ErrMsgBackSignBillMain 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() + "',HSignEmpID='" + omodel.HSignEmpID.ToString() + "',HSignNote='" + omodel.HSignNote + "'" + ",HSignDate='" + omodel.HSignDate + "'" + ",HErrMsgBackBillNo='" + omodel.HErrMsgBackBillNo + "',HErrMsgBackInterID='" + omodel.HErrMsgBackInterID.ToString() + "',HErrMsgBackEntryID='" + omodel.HErrMsgBackEntryID.ToString() + "' where HInterID=" + lngBillKey.ToString()); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); //å é¤å表 DeleteBillSub(lngBillKey); //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackSignBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackSignBill_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_ErrMsgBackSignBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackSignBill_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_ErrMsgBackSignBillMain" + "(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,HSignEmpID,HSignNote,HSignDate,HErrMsgBackBillNo,HErrMsgBackInterID,HErrMsgBackEntryID) " + " 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.HSignEmpID.ToString() + "','" + omodel.HSignNote + "','" + omodel.HSignDate + "','" + omodel.HErrMsgBackBillNo + "','" + omodel.HErrMsgBackInterID.ToString() + "','" + omodel.HErrMsgBackEntryID.ToString() + "') "; //主表 oCn.RunProc(sql); //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackSignBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackSignBill_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_ErrMsgBackSignBillMain Where HInterID=" + lngBillKey.ToString(), "OA_ErrMsgBackSignBillMain"); 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_ErrMsgBackSignBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "OA_ErrMsgBackSignBillSub"); DetailColl.Clear();//æ¸ ç©º for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) { Model.ClsOA_ErrMsgBackSignBillSub oSub = new Model.ClsOA_ErrMsgBackSignBillSub(); // åºå®èµå¼=============================================== 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); } } } } DAL/Ô´µ¥/InterFaceÔ´µ¥/Cls_S_IFCLD_ICMOList.cs
@@ -13,8 +13,8 @@ base.ViewName = "h_v_IFCLD_ICMOBillList_Source"; base.mvarReportTitle = "ç产订å"; base.mvarItemKey = "3710"; base.sCondtion = " and 任塿°é>isnull(å ¥åºæ°é,0) and ç¶æ<>'ç»æ¡' "; base.sOrderSql = " order by åæ®å· "; base.sCondtion = " "; base.sOrderSql = " order by åæ®å· desc "; base.sKeyCol = "é¨é¨"; } DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsGy_FixCardBill.cs
@@ -106,8 +106,6 @@ { try { //å¾å°mainid omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //è¥MAINDIéå¤åéæ°è·å oCn.BeginTran(); //主表 DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsGy_FixCardChangeBill.cs
New file @@ -0,0 +1,207 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsGy_FixCardChangeBill : DBUtility.ClsXt_BaseBill { public Model.ClsGy_FixCardChangeBillMain omodel = new Model.ClsGy_FixCardChangeBillMain(); DataSet ds; public ClsGy_FixCardChangeBill() { base.MvarItemKeySub = "Gy_FixCardChangeBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey= "Gy_FixCardChangeBillMain"; base.MvarReportTitle="åºå®èµäº§åå¨å"; base.BillType = "3336"; base.HBillSubType = "3336"; } #region åºå®ä»£ç ~ClsGy_FixCardChangeBill() { //DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { // oCn.BeginTran(); //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate Gy_FixCardChangeBillMain set " + " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== ",HRemark='" + omodel.HRemark + "'" + ",HUpDater='" + omodel.HMaker + "'" + ",HUpDateDate=getdate()" + //======================================== ",HCardID=" + omodel.HCardID + ",HCardNumber='" + omodel.HCardNumber + "'" + ",HChangeReason='" + omodel.HChangeReason + "'" + ",HOrgID=" + omodel.HOrgID + ",HCardStatusID_OLD=" + omodel.HCardStatusID_OLD + ",HCardStatusID_NEW=" + omodel.HCardStatusID_NEW + ",HCardAddr_OLD=" + omodel.HCardAddr_OLD + ",HCardAddr_NEW=" + omodel.HCardAddr_NEW + " where HInterID=" + lngBillKey.ToString()); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); sReturn = "ä¿®æ¹åæ®æåï¼"; oCn.Commit(); return true; } catch (Exception e) { sReturn = e.Message; oCn.RollBack(); throw (e); } } //æ°å¢åæ® public override bool AddBill(ref string sReturn) { try { //è¥MAINDIéå¤åéæ°è·å oCn.BeginTran(); //ä¿ååæ§å¶========================================= ds = oCn.RunProcReturn("exec h_p_Gy_FixCardChangeBill_BeforeSaveCtrl " + omodel.HInterID + ",'" + omodel.HMaker + "'", "h_p_Gy_FixCardChangeBill_BeforeSaveCtrl"); if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") { sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); oCn.RollBack(); return false; } //========================================================= //主表 oCn.RunProc("Insert Into Gy_FixCardChangeBillMain" + "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HYear,HPeriod,HRemark,HBillStatus," + "HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo," + "HCardID,HCardNumber,HChangeReason,HOrgID,HCardStatusID_OLD,HCardStatusID_NEW,HCardAddr_OLD,HCardAddr_NEW" + ") "+ " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HBillStatus + ",'" + omodel.HMainSourceBillType + "','" +omodel.HMainSourceInterID + "'," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "'," + omodel.HCardID + ",'" + omodel.HCardNumber + "','" + omodel.HChangeReason + "'," + omodel.HOrgID + "," + omodel.HCardStatusID_OLD + "," + omodel.HCardStatusID_NEW + "," + omodel.HCardAddr_OLD + "," + omodel.HCardAddr_NEW + ") "); //ä¿ååæ§å¶========================================= ds = oCn.RunProcReturn("exec h_p_Gy_FixCardChangeBill_AfterSaveCtrl " + omodel.HInterID + ",'" + omodel.HMaker + "'", "h_p_Gy_FixCardChangeBill_AfterSaveCtrl"); if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") { sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); 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 Gy_FixCardChangeBillMain Where HInterID=" + lngBillKey.ToString(), "Gy_FixCardChangeBillMain"); if(Ds.Tables[0].Rows.Count==0) { sReturn = "åæ®æªæ¾å°ï¼"; return false; } //åºå®èµå¼=========================================== omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); omodel.HDate =DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); //======================================================== //== // //å¾ªç¯ //DataSet DsSub ; //DsSub = oCn.RunProcReturn("Select * from Gy_FixCardChangeBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Gy_FixCardChangeBillSub"); //DetailColl.Clear();//æ¸ ç©º //for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) //{ // Model.ClsGy_FixCardChangeBillSub_Emp oSub = new Model.ClsGy_FixCardChangeBillSub_Emp(); // // åºå®èµå¼=============================================== // 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(); // //=================================================== // DetailColl.Add(oSub); //} sReturn = "æ¾ç¤ºåæ®æåï¼"; return true; } catch (Exception e) { sReturn = e.Message; throw (e); } } } } Model/Model.csproj
@@ -286,7 +286,11 @@ <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ComFileBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ComFileBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_EmpMinMessage.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackSignBill.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackReceiveBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackSignBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackReceiveBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackBillSub2.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_InformBillMain.cs" /> @@ -348,6 +352,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" /> @@ -616,6 +621,7 @@ <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsSc_MouldStockBillMain.cs" /> <Compile Include="ç产管ç\æ¨¡å ·ç®¡ç\ClsSc_MouldStockBillSub.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_EquipTypeBill.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_FixCardChangeBillMain.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipConkBookBillMain.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsSb_EquipConkBookBillSub.cs" /> <Compile Include="ç产管ç\设å¤ç®¡ç\ClsGy_FixCardBillMain.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/ÐÅϢƽ̨/ClsOA_ErrMsgBackSignBill.cs
New file @@ -0,0 +1,31 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsOA_ErrMsgBackSignBillMain : 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 HSignEmpID; // ç¾å°äººï¼Gy_Employeeï¼ public string HSignNote; // ç¾å°ç¡®è®¤ public DateTime HSignDate; // ç¾å°æ¶é´ï¼å¹´ææ¥æ¶åç§ï¼ public string HErrMsgBackBillNo; //å¼å¸¸åé¦åå· public int HErrMsgBackInterID; //å¼å¸¸åé¦å主å ç public int HErrMsgBackEntryID; //å¼å¸¸åé¦ååå ç } } Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackSignBillSub.cs
New file @@ -0,0 +1,11 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsOA_ErrMsgBackSignBillSub : 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; } } Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsGy_FixCardChangeBillMain.cs
New file @@ -0,0 +1,18 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_FixCardChangeBillMain : DBUtility.ClsXt_BaseBillMain { public Int64 HCardID; //å¡çå ç public string HCardNumber; //å¡çç¼ç public string HChangeReason; //åæ´åå public Int64 HOrgID; //èµäº§ç»ç» public Int64 HCardStatusID_OLD; //èµäº§ç¶æï¼åæ´åï¼ public Int64 HCardStatusID_NEW; //èµäº§ç¶æï¼åæ´åï¼ public Int64 HCardAddr_OLD; //èµäº§ä½ç½®ï¼åå¨åï¼ public Int64 HCardAddr_NEW; //èµäº§ä½ç½®ï¼åå¨åï¼ } } WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill.cs
@@ -155,6 +155,8 @@ // public string ModName = "85"; public string ModCaption = "æ¡ç çæ"; public const string ModRightName = "Gy_BarCodeBill"; public const string ModRightNameSourceQty = ModRightName + "_SourceQty"; //è¶ æºåæ°éæ§å¶ public bool BillChange; // public DBUtility.ClsPub.Enum_BillStatus BillStatus; @@ -589,23 +591,16 @@ //忮宿´æ§å¤æ æªå®æ private bool Sub_AllowSave() { ////å¿ è¾é¡¹ç®æ¯å¦ä¸ºç©º //if (txtHDeptID.Tag.ToString().Trim() == "0") //{ // MessageBox.Show("çäº§è½¦é´æ²¡æéæ©ï¼", "æç¤º"); // return false; //} //if (txtHGroupID.Tag.ToString().Trim() == "0") //{ // MessageBox.Show("çç»æ²¡æéæ©ï¼", "æç¤º"); // return false; //} //忮巿¯å¦éå¤ //if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, txtHBillNo.Text.Trim(), BillStatus, BillOld.omodel.HInterID)) //{ // MessageBox.Show("åæ®å·éå¤ï¼", "æç¤º"); // return false; //} //ç³»ç»åæ°ï¼ææºåçææ¡ç ï¼çææ¡ç æ°éå¯å¦è¶ æºåæ°éæ§å¶ï¼N为ä¸å¯è¶ æºåæ°éï¼ if (SourceQtyCtl=="N") { //ç³»ç»åæ°ä¸ºä¸å¯è¶ æºåæ°éæ¶ï¼åæ¬¡å¤æç¨æ·æéæ¯å¦å¯è¶ æºåæ°é //夿æé if (ClsPub.Security_Log(ModRightNameSourceQty, 3, false, ClsPub.CurUserName)) { SourceQtyCtl = "Y"; } } //æç»è¡¨æ¯å¦ä¸ºé¶è¡ bool b = false; for (int i = 0; i < grdMain.RowCount; i++) 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/SBGL/Gy_FixCardChangeBillController.cs
New file @@ -0,0 +1,698 @@ using DBUtility; 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.SBGL { public class Gy_FixCardChangeBillController : ApiController { //è·åç³»ç»åæ° Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DBUtility.ClsPub.Enum_BillStatus BillStatus; private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; public DAL.ClsGy_FixCardChangeBill BillOld = new DAL.ClsGy_FixCardChangeBill(); #region åºå®èµäº§åå¨åå表æ¥è¯¢ [Route("Gy_FixCardChangeBill/list")] [HttpGet] public object list(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Gy_FixCardChangeBill_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_FixCardChangeBillList where 1 = 1"); if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn(sql1 + sWhere , "h_v_Gy_FixCardChangeBillList"); } else { string sql = sql1 + sWhere; ds = oCN.RunProcReturn(sql, "h_v_Gy_FixCardChangeBillList"); } //æ·»å åå 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; } } #endregion #region åºå®èµäº§åå¨å ä¿å/ç¼è¾ [Route("Gy_FixCardChangeBill/SaveFixCardChangeBillList")] [HttpPost] public object SaveFixCardChangeBillList([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 msg4 = sArray[1].ToString(); //ç¨æ· string OperationType = sArray[2].ToString(); //æä½ç±»å string UserName = ""; ListModels oListModels = new ListModels(); try { if (!DBUtility.ClsPub.Security_Log("Gy_FixCardChangeBill_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsGy_FixCardChangeBill oBill = new DAL.ClsGy_FixCardChangeBill(); List<Model.ClsGy_FixCardChangeBillMain> lsmain = new List<Model.ClsGy_FixCardChangeBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_Gy_FixCardChangeBillMain(msg2); foreach (Model.ClsGy_FixCardChangeBillMain oItem in lsmain) { //oItem.HMaker = ""; UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "3336"; oItem.HBillSubType = "3336"; oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --æ¥æ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); oItem.HBillStatus = 1; 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 (OperationType == "1") { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else { bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); } if (bResult) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } #endregion //#region åºå®èµäº§åå¨å å é¤ [Route("Gy_FixCardChangeBill/DelFixCardChangeBill")] [HttpGet] public object DelFixCardChangeBill(string HInterID, string user) { Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); if (lngBillKey == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ID为空ï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsGy_FixCardChangeBill oBill = new DAL.ClsGy_FixCardChangeBill(); if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) { ds = oCN.RunProcReturn("select * from Gy_FixCardChangeBillMain where HInterID=" + lngBillKey, "Gy_FixCardChangeBillMain"); if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å½åå¤äºä¸è½å é¤ç¶æ,ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ç»å®¡æ ¸,ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } //å é¤åæ§å¶========================================= string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); string sql1 = "exec h_p_Gy_FixCardChangeBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Gy_FixCardChangeBill_BeforeDelCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } //================================================================================== bool IsDete = oBill.DeleteBill(lngBillKey, HBillNo, "h_p_Gy_FixCardChangeBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); if (IsDete) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªæ¾å°"; objJsonResult.data = null; return objJsonResult; } } //#endregion #region æ ¹æ®å¡çç¼ç æ¥æ¾åºå®èµäº§å¡çä¿¡æ¯PDA [Route("Gy_PDA_FixCardChangeBill/txtHBarCode_KeyDown")] [HttpGet] public object txtHBarCode_KeyDown(string HBarCode) { try { if (HBarCode == null || HBarCode.Equals("")) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¡å½¢ç ä¸è½ä¸ºç©ºï¼"; objJsonResult.data = null; return objJsonResult; } //å¾å°ä¿¡æ¯ ds = oCN.RunProcReturn("select * from h_v_Gy_FixCardBillList where å¡çç¼ç = '" + HBarCode + "'", "h_v_Gy_FixCardBillList "); //åå ¥ä¿¡æ¯ if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "1.æªæ¥è¯¢å°åºå®èµäº§å¡çä¿¡æ¯"; objJsonResult.data = null; return objJsonResult; } objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = ds.Tables[0]; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region åºå®èµäº§åå¨å å®¡æ ¸/åå®¡æ ¸åè½ [Route("Gy_FixCardChangeBill/CheckGy_FixCardChangeBill")] [HttpGet] public object CheckGy_FixCardChangeBill(string HInterID, int Type, string user) { try { //夿æ¯å¦æå 餿é if (!DBUtility.ClsPub.Security_Log("Gy_FixCardChangeBill_Check", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "Gy_FixCardChangeBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ if (Type == 1) { //夿忮æ¯å¦å·²ç»å®¡æ ¸ DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } //å®¡æ ¸åæ§å¶ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); sql = "exec h_p_Gy_FixCardChangeBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql, "h_p_Gy_FixCardChangeBill_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; 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; } //å®¡æ ¸åæ® if (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_Gy_FixCardChangeBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } else { //夿忮æ¯å¦å·²ç»åå®¡æ ¸ DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已åå®¡æ ¸!ä¸éè¦ååå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } //åå®¡æ ¸åæ§å¶ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); sql = "exec h_p_Gy_FixCardChangeBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql, "h_p_Gy_FixCardChangeBill_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; } //åå®¡æ ¸åæ® if (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_Gy_FixCardChangeBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } 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 #region åºå®èµäº§ å ³é/åå ³éåè½ [Route("Gy_FixCardChangeBill/CloseGy_FixCardChangeBill")] [HttpGet] public object CloseGy_FixCardChangeBill(string HInterID, int Type, string user) { try { //夿æ¯å¦æå 餿é if (!DBUtility.ClsPub.Security_Log("Gy_FixCardChangeBill_Close", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå ³é!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "Gy_FixCardChangeBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 å ³é 2 åå ³é if (Type == 1) { //夿忮æ¯å¦å·²ç»å ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸éè¦åå ³é!"; objJsonResult.data = null; return objJsonResult; } } //å ³éåæ® if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } else { //夿忮æ¯å¦å·²ç»åå ³é DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已åå ³é!ä¸éè¦ååå ³é!"; objJsonResult.data = null; return objJsonResult; } } //åå ³éåæ® if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åå ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } 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 #region åºå®èµäº§åå¨å ä½åº/åä½åºåè½ [Route("Gy_FixCardChangeBill/DropGy_FixCardChangeBill")] [HttpGet] public object DropGy_FixCardChangeBill(string HInterID, int Type, string user) { try { //夿æ¯å¦æä½åºæé if (!DBUtility.ClsPub.Security_Log("Gy_FixCardChangeBill_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéä½åº!"; objJsonResult.data = null; return objJsonResult; } if (string.IsNullOrWhiteSpace(HInterID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterID为空ï¼"; objJsonResult.data = null; return objJsonResult; } ClsPub.CurUserName = user; BillOld.MvarItemKey = "Gy_FixCardChangeBillMain"; oCN.BeginTran();//å¼å§äºå¡ //Type 1 ä½åº 2 åä½åº if (Type == 1) { //夿忮æ¯å¦å·²ç»ä½åº DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸éè¦åä½åº!"; objJsonResult.data = null; return objJsonResult; } //ä½åºåæ® if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } else { //夿忮æ¯å¦å·²ç»åä½åº DataSet ds; string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦ååä½åº!"; objJsonResult.data = null; return objJsonResult; } //åä½åºåæ® if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } } 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 } } WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs
@@ -140,6 +140,50 @@ #endregion #region 设å¤è´è·åæè¡¨ [Route("Sb_EquipMaintainReport/Sb_EquipmentLoadReportList")] [HttpGet] public object Sb_EquipmentLoadReportList(string HDeptID, string HWorkCenterID, string user) { try { List<object> columnNameList = new List<object>(); if (HDeptID == "0" || HDeptID.Equals("")|| HWorkCenterID == "0" || HWorkCenterID.Equals("")) { ds = oCN.RunProcReturn("exec h_p_Sb_EquipmentLoadReportListt '0','0'", "h_p_Sb_EquipmentLoadReportListt"); } else { ds = oCN.RunProcReturn("exec h_p_Sb_EquipmentLoadReportListt '" + HDeptID + "','" + HWorkCenterID + "'", "h_p_Sb_EquipmentLoadReportListt"); } //æ·»å åå 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; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region sqlè¯å¥ 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,1772 @@ } #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 hmainid = '" + HInterID + "'"; 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 #region å¼å¸¸åé¦ç¾å°å æ°å¢/ç¼è¾ [Route("Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackSignBill")] [HttpPost] public object SaveOA_ErrMsgBackSignBill([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_ErrMsgBackSignBillMain_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } // OA_ErrMsgBackSignBill DAL.ClsOA_ErrMsgBackSignBill oBill = new DAL.ClsOA_ErrMsgBackSignBill(); List<Model.ClsOA_ErrMsgBackSignBillMain> lsmain = new List<Model.ClsOA_ErrMsgBackSignBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_OA_ErrMsgBackSignBill(msg2); foreach (Model.ClsOA_ErrMsgBackSignBillMain 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 = "4530"; oItem.HBillSubType = "4530"; 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_ErrMsgBackSignBill")] [HttpGet] public object Edit_OA_ErrMsgBackSignBill(string HID) { try { List<object> columnNameList = new List<object>(); string sql = "select * from h_v_OA_ErrMsgBackSignBillMainList where hmainid='" + HID + "'"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackSignBillMainList"); //æ·»å åå 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_ErrMsgBackSignBillList")] [HttpGet] public object Get_OA_ErrMsgBackSignBillList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackSignBillMain_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_ErrMsgBackSignBillMainList order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackSignBillMainList"); } else { string sql1 = "select * from h_v_OA_ErrMsgBackSignBillMainList where 1 = 1 "; string sql = sql1 + sWhere + " order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackSignBillMainList"); } //æ·»å åå 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_ErrMsgBackSignBill")] [HttpGet] public object DeleteOA_ErrMsgBackSignBill(string HInterID, string user) { try { string s = ""; DAL.ClsOA_ErrMsgBackSignBill BillOld = new DAL.ClsOA_ErrMsgBackSignBill(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackSignBillMain_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_ErrMsgBackSignBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackSignBill_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_ErrMsgBackSignBillMain where HInterID = " + HInterID); oCN.RunProc("delete from OA_ErrMsgBackSignBillSub where HInterID= " + HInterID); //å é¤åæ§å¶================================================================================== string sql2 = "exec h_p_OA_ErrMsgBackSignBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql2, "h_p_OA_ErrMsgBackSignBill_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_ErrMsgBackSignBill")] [HttpGet] public object AuditOA_ErrMsgBackSignBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackSignBillMain_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_ErrMsgBackSignBill oBill = new DAL.ClsOA_ErrMsgBackSignBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ 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_ErrMsgBackSignBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackSignBill_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_ErrMsgBackSignBill_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_ErrMsgBackSignBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackSignBill_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_ErrMsgBackSignBill_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_ErrMsgBackSignBill")] [HttpGet] public object CloseOA_ErrMsgBackSignBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackSignBillMain_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_ErrMsgBackSignBill oBill = new DAL.ClsOA_ErrMsgBackSignBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ 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_ErrMsgBackSignBill")] [HttpGet] public object DeleteOA_ErrMsgBackSignBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackSignBillMain_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_ErrMsgBackSignBill oBill = new DAL.ClsOA_ErrMsgBackSignBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ 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/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormBillController.cs
@@ -2574,7 +2574,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç产æç»è¡éå¤,éå¤çç产订åå·:" + ds.Tables[0].Rows[i]["ç产订åå·"].ToString() + ",æç»è¡å·:" + ds.Tables[0].Rows[i]["ç产订åæç»è¡å·"].ToString(); objJsonResult.Message = "ç产æç»è¡éå¤,éå¤çç产订åå·:" + dt.Tables[0].Rows[i]["ç产订åå·"].ToString() + ",æç»è¡å·:" + dt.Tables[0].Rows[i]["ç产订åæç»è¡å·"].ToString(); objJsonResult.data = null; return objJsonResult; } 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/Controllers/XSGL/Xs_SeReportController.cs
New file @@ -0,0 +1,196 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Pub_Class; using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Web.Http; using WebAPI.Models; namespace WebAPI.Controllers { //é宿¥è¡¨Controller public class Xs_SeReportController : ApiController { //é宿¥è¡¨ private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; #region é宿¯å©ä¼°ç®åææ¥è¡¨ æ¥è¯¢ /// <summary> /// è¿å项ç®é¶æ®µå表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Xs_SeReport/Xs_SeOrderBillProfitReportList")] [HttpGet] public object Xs_SeOrderBillProfitReportList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); ds = oCN.RunProcReturn("exec h_p_Xs_SeOrderBillProfitReport '" + sWhere + "',''", "h_p_Xs_SeOrderBillProfitReport"); //æ·»å åå 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; } } #endregion #region éå®åºåºæ±æ»æ¥è¡¨ æ¥è¯¢ /// <summary> /// è¿å项ç®é¶æ®µå表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Xs_SeReport/Xs_SellOutStockSumReportList")] [HttpGet] public object Xs_SellOutStockSumReportList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); ds = oCN.RunProcReturn("exec h_p_Xs_SellOutStockSumReport '" + sWhere + "','' ", "h_p_Xs_SellOutStockSumReport"); //æ·»å åå 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; } } #endregion #region éå®è®¢åæ§è¡æ±æ»æ¥è¡¨ æ¥è¯¢ /// <summary> /// è¿å项ç®é¶æ®µå表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Xs_SeReport/Xs_SeOrderBillProcessSumReportList")] [HttpGet] public object Xs_SeOrderBillProcessSumReportList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); ds = oCN.RunProcReturn("exec h_p_Xs_SeOrderBillProcessSumReport '" + sWhere + "','',''", "h_p_Xs_SeOrderBillProcessSumReport"); //æ·»å åå 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; } } #endregion #region 客æ·åè´§åæ¶çæ¥è¡¨ æ¥è¯¢ /// <summary> /// è¿å项ç®é¶æ®µå表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Xs_SeReport/Xs_SeOrderSendDaySumReportList")] [HttpGet] public object Xs_SeOrderSendDaySumReportList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); ds = oCN.RunProcReturn("exec h_p_Xs_SeOrderSendDaySumReport '" + sWhere + "','',''", "h_p_Xs_SeOrderSendDaySumReport"); //æ·»å åå 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; } } #endregion } } WebAPI/Controllers/»ù´¡×ÊÁÏ/¹¤×Ê»ù´¡×ÊÁÏ/Gy_ProcPriceController.cs
@@ -521,7 +521,6 @@ } } var error = ""; //æ¥è¯¢å·¥åºå·¥ä»·æ²¡æçå 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,43 @@ 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.ClsOA_ErrMsgBackSignBillMain> getObjectByJson_OA_ErrMsgBackSignBill(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsOA_ErrMsgBackSignBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsOA_ErrMsgBackSignBillMain>>(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> @@ -3226,6 +3263,19 @@ return list; } /// <summary> /// åºå®èµäº§åå¨å 主表 /// </summary> /// <param name="jsonString"></param> /// <returns></returns> // ClsGy_FixCardChangeBillMain public List<Model.ClsGy_FixCardChangeBillMain> getObjectByJson_Gy_FixCardChangeBillMain(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_FixCardChangeBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_FixCardChangeBillMain>>(jsonString); return list; } #region 客è¯å¤çå /// <summary> /// 客è¯å¤çå主表json 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/Web.config
@@ -22,7 +22,7 @@ <!--<add key="FileIP" value="http://localhost:8082/LuBaoAPI"/>--> <!--<add key="FileIP" value="http://localhost:8080/" />--> <!--<add key="sUrl" value="http://183.129.128.86:9090/WEBS-WMSTest/WebService1.asmx"/> --> <!--<add key="sUrl" value="http://192.168.63.20/WEBS-WMS/WebService1.asmx"/> é¢å°å¼æº--> <add key="sUrl" value="http://192.168.63.53/WEBS-WMS/WebService1.asmx"/> <!--é¢å°å¼æº--> <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> å¤å®--> <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> --> <!--<add key="sUrl" value="http://10.10.130.181/WEBS-WMS/WebService1.asmx"/> åæ¥ç§æ--> @@ -34,7 +34,7 @@ <!--<add key="sUrl" value="http://192.168.80.90:9090/WEBS-WMS/WebService1.asmx"/> å®çæå¡å¨--> <!--<add key="sUrl" value="http://47.96.97.237/WEBS-WMS/WebService1.asmx"/> --> <!--æµè¯æå¡å¨--> <!--<add key="sUrl" value="http://localhost:8082/WEBS/WebService1.asmx"/> æ¬å°--> <add key="sUrl" value="http://192.168.110.57:81/WEBS/WebService1.asmx"/> <!--éé¯éæ¬å°é ç½®--> <!--<add key="sUrl" value="http://192.168.110.57:81/WEBS/WebService1.asmx"/> éé¯éæ¬å°é ç½®--> <!--<add key="sUrl" value="http://192.168.1.57:8082/WEBS-WMS/WebService1.asmx"/>ä¹è±--> <add key="webpages:Version" value="3.0.0.0" /> WebAPI/WebAPI.csproj
@@ -417,6 +417,7 @@ <Compile Include="Controllers\MJGL\Sc_MouldStatusChangeBillController.cs" /> <Compile Include="Controllers\MJGL\Sc_MouldUpperBillController.cs" /> <Compile Include="Controllers\Pay_ReportController.cs" /> <Compile Include="Controllers\SBGL\Gy_FixCardChangeBillController.cs" /> <Compile Include="Controllers\SBGL\Gy_FixCardBillController.cs" /> <Compile Include="Controllers\SBGL\Sb_EquipConkBookBillController.cs" /> <Compile Include="Controllers\SBGL\Sb_EquipSparepartsBillController.cs" /> @@ -484,6 +485,7 @@ <Compile Include="Controllers\CGGL\YF_PayMentBillController.cs" /> <Compile Include="Controllers\XSGL\YS_ReceiveBackBillController.cs" /> <Compile Include="Controllers\CGGL\YF_PayMentOtherBillController.cs" /> <Compile Include="Controllers\XSGL\Xs_SeReportController.cs" /> <Compile Include="Controllers\XSGL\YS_ReceiveOtherBillController.cs" /> <Compile Include="Controllers\XSGL\YS_ReceiveBillController.cs" /> <Compile Include="Controllers\XSGL\Kf_SellOutBillController.cs" /> @@ -645,6 +647,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" />