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_ErrMsgBackCheckBill.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackHandleBill.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackSignBill.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackReceiveBill.cs" /> <Compile Include="åºç¡èµæ\InterFaceåºç¡èµæ\ClsIF_ORGANIZATIONS_View.cs" /> @@ -124,6 +126,7 @@ <Compile Include="åºç¡èµæ\å ¶ä»åºç¡èµæ\ClsGy_QCCheckProject_View.cs" /> <Compile Include="åºç¡èµæ\å ¶ä»åºç¡èµæ\ClsGy_StdWorkTimes_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¶ä»åºç¡èµæ\ClsGy_SupMaterial_Ctl.cs" /> <Compile Include="å·¥èµç®¡ç\ClsHR_PostSkillBill.cs" /> <Compile Include="æºå\ERPæºå\Cls_S_Sc_ABJJD.cs" /> <Compile Include="æºå\InterFaceæºå\Cls_S_IF_ICMOBillList.cs" /> <Compile Include="æºå\InterFaceæºå\Cls_S_IF_ProcessReportBillList.cs" /> DAL/ÐÅϢƽ̨/ClsOA_ErrMsgBackCheckBill.cs
New file @@ -0,0 +1,323 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsOA_ErrMsgBackCheckBill : DBUtility.ClsXt_BaseBill { public Model.ClsOA_ErrMsgBackCheckBillMain omodel = new Model.ClsOA_ErrMsgBackCheckBillMain(); public List<Model.ClsOA_ErrMsgBackCheckBillSub> DetailColl = new List<Model.ClsOA_ErrMsgBackCheckBillSub>(); public ClsOA_ErrMsgBackCheckBill() { base.MvarItemKeySub = "OA_ErrMsgBackCheckBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey = "OA_ErrMsgBackCheckBillMain"; base.MvarReportTitle = "å¼å¸¸åé¦éªæ¶å"; base.BillType = "4532"; base.HBillSubType = "4532"; } #region åºå®ä»£ç ~ClsOA_ErrMsgBackCheckBill() { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { //ä¿ååæ§å¶========================================= string HBillNote = ""; DataSet ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackCheckBill_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_ErrMsgBackCheckBillMain 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() + "',HCheckEmpID='" + omodel.HCheckEmpID.ToString() + "',HCheckNote='" + omodel.HCheckNote + "'" + ",HCheckResult='" + omodel.HCheckResult + "'" + ",HHCheckDate='" + omodel.HHCheckDate + "'" + ",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_ErrMsgBackCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackCheckBill_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_ErrMsgBackCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackCheckBill_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_ErrMsgBackCheckBillMain" + "(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,HCheckEmpID,HCheckNote,HCheckResult,HHCheckDate,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.HCheckEmpID.ToString() + "','" + omodel.HCheckNote + "','" + omodel.HCheckResult + "','" + omodel.HHCheckDate + "','" + omodel.HErrMsgBackBillNo + "','" + omodel.HErrMsgBackInterID.ToString() + "','" + omodel.HErrMsgBackEntryID.ToString() + "') "; //主表 oCn.RunProc(sql); //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackCheckBill_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_ErrMsgBackCheckBillMain Where HInterID=" + lngBillKey.ToString(), "OA_ErrMsgBackCheckBillMain"); 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_ErrMsgBackCheckBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "OA_ErrMsgBackCheckBillSub"); DetailColl.Clear();//æ¸ ç©º for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) { Model.ClsOA_ErrMsgBackCheckBillSub oSub = new Model.ClsOA_ErrMsgBackCheckBillSub(); // åºå®èµå¼=============================================== 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_ErrMsgBackHandleBill.cs
New file @@ -0,0 +1,323 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsOA_ErrMsgBackHandleBill : DBUtility.ClsXt_BaseBill { public Model.ClsOA_ErrMsgBackHandleBillMain omodel = new Model.ClsOA_ErrMsgBackHandleBillMain(); public List<Model.ClsOA_ErrMsgBackHandleBillSub> DetailColl = new List<Model.ClsOA_ErrMsgBackHandleBillSub>(); public ClsOA_ErrMsgBackHandleBill() { base.MvarItemKeySub = "OA_ErrMsgBackHandleBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey = "OA_ErrMsgBackHandleBillMain"; base.MvarReportTitle = "å¼å¸¸åé¦ç¾å°å"; base.BillType = "4531"; base.HBillSubType = "4531"; } #region åºå®ä»£ç ~ClsOA_ErrMsgBackHandleBill() { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { //ä¿ååæ§å¶========================================= string HBillNote = ""; DataSet ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackHandleBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackHandleBill_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_ErrMsgBackHandleBillMain 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() + "',HHandleEmpID='" + omodel.HHandleEmpID.ToString() + "',HHandleNote='" + omodel.HHandleNote + "'" + ",HHandleResult='" + omodel.HHandleResult + "'" + ",HHandleDate='" + omodel.HHandleDate + "'" + ",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_ErrMsgBackHandleBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackHandleBill_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_ErrMsgBackHandleBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackHandleBill_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_ErrMsgBackHandleBillMain" + "(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,HHandleEmpID,HHandleNote,HHandleResult,HHandleDate,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.HHandleEmpID.ToString() + "','" + omodel.HHandleNote + "','" + omodel.HHandleResult + "','" + omodel.HHandleDate + "','" + omodel.HErrMsgBackBillNo + "','" + omodel.HErrMsgBackInterID.ToString() + "','" + omodel.HErrMsgBackEntryID.ToString() + "') "; //主表 oCn.RunProc(sql); //=========================ä¿ååæ§å¶ DataSet ds2 = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackHandleBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackHandleBill_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_ErrMsgBackHandleBillMain Where HInterID=" + lngBillKey.ToString(), "OA_ErrMsgBackHandleBillMain"); 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_ErrMsgBackHandleBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "OA_ErrMsgBackHandleBillSub"); DetailColl.Clear();//æ¸ ç©º for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) { Model.ClsOA_ErrMsgBackHandleBillSub oSub = new Model.ClsOA_ErrMsgBackHandleBillSub(); // åºå®èµå¼=============================================== 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/¹¤×ʹÜÀí/ClsHR_PostSkillBill.cs
New file @@ -0,0 +1,216 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsHR_PostSkillBill : DBUtility.ClsXt_BaseBill { public Model.ClsHR_PostSkillBillMain omodel = new Model.ClsHR_PostSkillBillMain(); public List<Model.ClsHR_PostSkillBillSub> DetailColl = new List<Model.ClsHR_PostSkillBillSub>(); public ClsHR_PostSkillBill() { base.MvarItemKeySub = "HR_PostSkillBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey="HR_PostSkillBillMain"; base.MvarReportTitle="å²ä½æè½æ¸ å"; base.BillType="2331"; base.HBillSubType = "2331"; } #region åºå®ä»£ç ~ClsHR_PostSkillBill() { DetailColl = null; } #endregion èªå®ä¹æ¹æ³ //ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { // oCn.BeginTran(); //æ´æ°ä¸»è¡¨ oCn.RunProc("UpDate HR_PostSkillBillMain 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() + "',HPostID='" + omodel.HPostID.ToString() + "',HOrgID='" + omodel.HOrgID.ToString() + "'" + " where HInterID=" + lngBillKey.ToString()); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); //å é¤å表 DeleteBillSub(lngBillKey); //æå ¥å表 omodel.HInterID = lngBillKey; foreach (Model.ClsHR_PostSkillBillSub oSub in DetailColl) { oCn.RunProc("Insert into HR_PostSkillBillSub " + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + ",HPostSkillid,HSkillLev" + ") values(" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HPostSkillid.ToString() + "," + oSub.HSkillLev.ToString() + ") "); } 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(); //主表 oCn.RunProc("Insert Into HR_PostSkillBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + ",HDeptID,HPostID,HOrgID" + ") " + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + ",'" + omodel.HDeptID.ToString() + "'," + omodel.HPostID.ToString() + "," + omodel.HOrgID.ToString() + ") "); //æå ¥å表 foreach (Model.ClsHR_PostSkillBillSub oSub in DetailColl) { oCn.RunProc("Insert into HR_PostSkillBillSub " + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + ",HPostSkillid,HSkillLev" + ") values(" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HPostSkillid.ToString() + ",'" + oSub.HSkillLev.ToString() + "') "); } 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 HR_PostSkillBillMain Where HInterID=" + lngBillKey.ToString(), "HR_PostSkillBillMain"); 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.HPostID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPostID"]); omodel.HOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"]); // //å¾ªç¯ DataSet DsSub ; DsSub = oCn.RunProcReturn("Select * from HR_PostSkillBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "HR_PostSkillBillSub"); DetailColl.Clear();//æ¸ ç©º for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) { Model.ClsHR_PostSkillBillSub oSub = new Model.ClsHR_PostSkillBillSub(); // åºå®èµå¼=============================================== 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.HPostSkillid = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPostSkillid"]); oSub.HSkillLev = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSkillLev"]); DetailColl.Add(oSub); } sReturn = "æ¾ç¤ºåæ®æåï¼"; return true; } catch (Exception e) { sReturn = e.Message; throw (e); } } } } Model/Model.csproj
@@ -286,9 +286,13 @@ <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ComFileBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ComFileBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_EmpMinMessage.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackCheckBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackHandleBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackCheckBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackSignBill.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackReceiveBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackBillMain.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackHandleBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackSignBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackReceiveBillSub.cs" /> <Compile Include="ä¿¡æ¯å¹³å°\ClsOA_ErrMsgBackBillSub.cs" /> @@ -474,6 +478,8 @@ <Compile Include="å·¥èµç®¡ç\ClsPay_SubsidyChangeBillSub.cs" /> <Compile Include="å·¥èµç®¡ç\ClsPay_SumBalBillMain .cs" /> <Compile Include="å·¥èµç®¡ç\ClsPay_SumBalBillSub.cs" /> <Compile Include="å·¥èµç®¡ç\ClsHR_PostSkillBillMain.cs" /> <Compile Include="å·¥èµç®¡ç\ClsHR_PostSkillBillSub.cs" /> <Compile Include="åºæ¶ç®¡ç\ClsYS_ReceiveOtherBillSub.cs" /> <Compile Include="ææ¬ç®¡ç\ClsCB_ChangeMoneyBillMain.cs" /> <Compile Include="ææ¬ç®¡ç\ClsCB_ChangeMoneyBillSub.cs" /> Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackCheckBillMain.cs
New file @@ -0,0 +1,32 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsOA_ErrMsgBackCheckBillMain : 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 HCheckEmpID; // éªæ¶äººï¼Gy_Employeeï¼ public string HCheckNote; // éªæ¶å 容 public string HCheckResult; // éªæ¶ç»æï¼å¤çå®æï¼æªå¤çï¼æ æ³å¤çï¼ public DateTime HHCheckDate; // éªæ¶æ¶é´ï¼å¹´ææ¥æ¶åç§ï¼ public string HErrMsgBackBillNo; //å¼å¸¸åé¦åå· public int HErrMsgBackInterID; //å¼å¸¸åé¦å主å ç public int HErrMsgBackEntryID; //å¼å¸¸åé¦ååå ç } } Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackCheckBillSub.cs
New file @@ -0,0 +1,11 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsOA_ErrMsgBackCheckBillSub : DBUtility.ClsXt_BaseBillSub { } } Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackHandleBillMain.cs
New file @@ -0,0 +1,32 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsOA_ErrMsgBackHandleBillMain : 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 HHandleEmpID; // å¤ç人ï¼Gy_Employeeï¼ public string HHandleNote; // å¤çå 容 public string HHandleResult; // å¤çç»æï¼å¤çå®æï¼æªå¤çï¼æ æ³å¤çï¼ public DateTime HHandleDate; // å¤ç宿æ¶é´ï¼å¹´ææ¥æ¶åç§ï¼ public string HErrMsgBackBillNo; //å¼å¸¸åé¦åå· public int HErrMsgBackInterID; //å¼å¸¸åé¦å主å ç public int HErrMsgBackEntryID; //å¼å¸¸åé¦ååå ç } } Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackHandleBillSub.cs
New file @@ -0,0 +1,11 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsOA_ErrMsgBackHandleBillSub : DBUtility.ClsXt_BaseBillSub { } } Model/¹¤×ʹÜÀí/ClsHR_PostSkillBillMain.cs
New file @@ -0,0 +1,13 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsHR_PostSkillBillMain : DBUtility.ClsXt_BaseBillMain { public Int64 HDeptID;// é¨é¨ public Int64 HPostID;// å²ä½ public Int64 HOrgID; //ç»ç» } } Model/¹¤×ʹÜÀí/ClsHR_PostSkillBillSub.cs
New file @@ -0,0 +1,13 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsHR_PostSkillBillSub : DBUtility.ClsXt_BaseBillSub { public Int64 HPostSkillid;// int å²ä½æè½ç¼ç public Int64 HSkillLev;// int è½åççº§éæ± } } WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -747,7 +747,7 @@ } #endregion #region å¼å¸¸åé¦ æ¥æ¶/ç¾å° åå表 æ ¹æ®å¼å¸¸åé¦å䏿¨è·åæ°æ® #region å¼å¸¸åé¦ æ¥æ¶/ç¾å°/å¤ç åå表 æ ¹æ®å¼å¸¸ åé¦/æ¥æ¶/ç¾å°/å¤ç å䏿¨è·åæ°æ® [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackList")] [HttpGet] @@ -776,7 +776,12 @@ string sql = "select * from h_v_OA_ErrMsgBackReceiveBillMainList where hmainid = '" + HInterID + "'"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillMainList"); } else if (num == 3) //å¼å¸¸åé¦å¤çå { string sql = "select * from h_v_OA_ErrMsgBackHandleBillMainList where hmainid = '" + HInterID + "'"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainList "); } //æ·»å åå foreach (DataColumn col in ds.Tables[0].Columns) { @@ -805,6 +810,8 @@ #endregion #region å¼å¸¸å馿¥æ¶å #region å¼å¸¸å馿¥æ¶å æ°å¢/ç¼è¾ [Route("Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackReceiveBill")] @@ -1660,6 +1667,10 @@ } #endregion #endregion #region å¼å¸¸åé¦ç¾å°å #region å¼å¸¸åé¦ç¾å°å æ°å¢/ç¼è¾ [Route("Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackSignBill")] [HttpPost] @@ -2514,5 +2525,1716 @@ } #endregion #endregion #region å¼å¸¸åé¦å¤çå #region å¼å¸¸åé¦å¤çå æ°å¢/ç¼è¾ [Route("Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackHandleBill")] [HttpPost] public object SaveOA_ErrMsgBackHandleBill([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_ErrMsgBackHandleBillMain_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } // OA_ErrMsgBackHandleBill DAL.ClsOA_ErrMsgBackHandleBill oBill = new DAL.ClsOA_ErrMsgBackHandleBill(); List<Model.ClsOA_ErrMsgBackHandleBillMain> lsmain = new List<Model.ClsOA_ErrMsgBackHandleBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_OA_ErrMsgBackHandleBill(msg2); foreach (Model.ClsOA_ErrMsgBackHandleBillMain 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 = "4531"; oItem.HBillSubType = "4531"; 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_ErrMsgBackHandleBill")] [HttpGet] public object Edit_OA_ErrMsgBackHandleBill(string HID) { try { List<object> columnNameList = new List<object>(); string sql = "select * from h_v_OA_ErrMsgBackHandleBillMainList where hmainid='" + HID + "'"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainList"); //æ·»å åå 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_ErrMsgBackHandleBillList")] [HttpGet] public object Get_OA_ErrMsgBackHandleBillList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackHandleBillMain_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_ErrMsgBackHandleBillMainList order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainList"); } else { string sql1 = "select * from h_v_OA_ErrMsgBackHandleBillMainList where 1 = 1 "; string sql = sql1 + sWhere + " order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainList"); } //æ·»å åå 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/DeleteOA_ErrMsgBackHandleBill")] [HttpGet] public object DeleteOA_ErrMsgBackHandleBill(string HInterID, string user) { try { string s = ""; DAL.ClsOA_ErrMsgBackHandleBill BillOld = new DAL.ClsOA_ErrMsgBackHandleBill(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackHandleBillMain_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_ErrMsgBackHandleBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackHandleBill_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_ErrMsgBackHandleBillMain where HInterID = " + HInterID); oCN.RunProc("delete from OA_ErrMsgBackHandleBillSub where HInterID= " + HInterID); //å é¤åæ§å¶================================================================================== string sql2 = "exec h_p_OA_ErrMsgBackHandleBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql2, "h_p_OA_ErrMsgBackHandleBill_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_ErrMsgBackHandleBill")] [HttpGet] public object AuditOA_ErrMsgBackHandleBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackHandleBillMain_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_ErrMsgBackHandleBill oBill = new DAL.ClsOA_ErrMsgBackHandleBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ 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_ErrMsgBackHandleBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackHandleBill_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_ErrMsgBackHandleBill_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_ErrMsgBackHandleBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackHandleBill_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_ErrMsgBackHandleBill_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_ErrMsgBackHandleBill")] [HttpGet] public object CloseOA_ErrMsgBackHandleBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackHandleBillMain_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_ErrMsgBackHandleBill oBill = new DAL.ClsOA_ErrMsgBackHandleBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ 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_ErrMsgBackHandleBill")] [HttpGet] public object DeleteOA_ErrMsgBackHandleBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackHandleBillMain_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_ErrMsgBackHandleBill oBill = new DAL.ClsOA_ErrMsgBackHandleBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ 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 #endregion #region å¼å¸¸åé¦éªæ¶å #region å¼å¸¸åé¦éªæ¶å æ°å¢/ç¼è¾ [Route("Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackCheckBill")] [HttpPost] public object SaveOA_ErrMsgBackCheckBill([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_ErrMsgBackCheckBillMain_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } // OA_ErrMsgBackCheckBill DAL.ClsOA_ErrMsgBackCheckBill oBill = new DAL.ClsOA_ErrMsgBackCheckBill(); List<Model.ClsOA_ErrMsgBackCheckBillMain> lsmain = new List<Model.ClsOA_ErrMsgBackCheckBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_OA_ErrMsgBackCheckBill(msg2); foreach (Model.ClsOA_ErrMsgBackCheckBillMain 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 = "4532"; oItem.HBillSubType = "4532"; 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_ErrMsgBackCheckBill")] [HttpGet] public object Edit_OA_ErrMsgBackCheckBill(string HID) { try { List<object> columnNameList = new List<object>(); string sql = "select * from h_v_OA_ErrMsgBackCheckBillMainList where hmainid='" + HID + "'"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackCheckBillMainList"); //æ·»å åå 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_ErrMsgBackCheckBillList")] [HttpGet] public object Get_OA_ErrMsgBackCheckBillList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackCheckBillMain_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_ErrMsgBackCheckBillMainList order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackCheckBillMainList"); } else { string sql1 = "select * from h_v_OA_ErrMsgBackCheckBillMainList where 1 = 1 "; string sql = sql1 + sWhere + " order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackCheckBillMainList"); } //æ·»å åå 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/DeleteOA_ErrMsgBackCheckBill")] [HttpGet] public object DeleteOA_ErrMsgBackCheckBill(string HInterID, string user) { try { string s = ""; DAL.ClsOA_ErrMsgBackCheckBill BillOld = new DAL.ClsOA_ErrMsgBackCheckBill(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackCheckBillMain_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_ErrMsgBackCheckBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackCheckBill_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_ErrMsgBackCheckBillMain where HInterID = " + HInterID); oCN.RunProc("delete from OA_ErrMsgBackCheckBillSub where HInterID= " + HInterID); //å é¤åæ§å¶================================================================================== string sql2 = "exec h_p_OA_ErrMsgBackCheckBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql2, "h_p_OA_ErrMsgBackCheckBill_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_ErrMsgBackCheckBill")] [HttpGet] public object AuditOA_ErrMsgBackCheckBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackCheckBillMain_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_ErrMsgBackCheckBill oBill = new DAL.ClsOA_ErrMsgBackCheckBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ 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_ErrMsgBackCheckBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackCheckBill_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_ErrMsgBackCheckBill_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_ErrMsgBackCheckBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackCheckBill_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_ErrMsgBackCheckBill_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_ErrMsgBackCheckBill")] [HttpGet] public object CloseOA_ErrMsgBackCheckBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackCheckBillMain_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_ErrMsgBackCheckBill oBill = new DAL.ClsOA_ErrMsgBackCheckBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ 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_ErrMsgBackCheckBill")] [HttpGet] public object DeleteOA_ErrMsgBackCheckBill(int HInterID, int IsAudit, string CurUserName) { string ModRightNameCheck = "OA_ErrMsgBackCheckBillMain_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_ErrMsgBackCheckBill oBill = new DAL.ClsOA_ErrMsgBackCheckBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ 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 #endregion } } WebAPI/Controllers/¹¤×ʹÜÀí/HR_PostSkillBillController.cs
New file @@ -0,0 +1,817 @@ 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 { public class HR_PostSkillBillController : ApiController { public DBUtility.ClsPub.Enum_BillStatus BillStatus; public const string ModName = "2331"; //åæ®ç±»å public const string ModCaption = "å²ä½æè½æ¸ å"; //åæ®åç§° public const string ModRightName = "HR_PostSkillBillMain"; public const string ModRightNameQuery = ModRightName + "_Query"; //æ¥è¯¢ public const string ModRightNameEdit = ModRightName + "_Edit"; //ç¼è¾ public const string ModRightNameCheck = ModRightName + "_Check"; //å®¡æ ¸ public const string ModRightNameClose = ModRightName + "_Close"; //å ³é public const string ModRightNameDelete = ModRightName + "_Delete"; //ä½åº public const string ModRightNameDrop = ModRightName + "_Drop"; //å é¤ public DataSet ds = new DataSet(); private json objJsonResult = new json(); SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); public DAL.ClsHR_PostSkillBill oBill = new DAL.ClsHR_PostSkillBill(); public DAL.ClsHR_PostSkillBill BillNew = new DAL.ClsHR_PostSkillBill(); //对åºåæ®ç±» public DAL.ClsHR_PostSkillBill BillOld = new DAL.ClsHR_PostSkillBill(); //对åºåæ®ç±» // HR_PostSkillBill HR_PostSkillBillMain #region å²ä½æè½æ¸ åå表 /// <summary> /// è·åå²ä½æè½æ¸ ååè¡¨ä¿¡æ¯ /// </summary> /// <returns></returns> [Route("HR_PostSkillBill/GetHR_PostSkillBillList")] [HttpGet] public object GetHR_PostSkillBillList(string sWhere, string HMaker) { try { //夿æé if (!DBUtility.ClsPub.Security_Log(ModRightNameQuery, 3, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } //è¿ååè¡¨ä¿¡æ¯ ds = oCn.RunProcReturn("select * from h_v_HR_PostSkillBillMainList where 1=1 " + sWhere + " order by hmainid desc", "h_v_HR_PostSkillBillMainList"); List<object> columnNameList = new List<object>(); //æ·»å åå 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 = "0"; objJsonResult.count = 1; objJsonResult.Message = "æåï¼"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¥è¯¢å表信æ¯å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region å²ä½æè½æ¸ åå é¤ /// <summary> /// å é¤å²ä½æè½æ¸ å /// </summary> /// <returns></returns> [Route("HR_PostSkillBill/DeleteHR_PostSkillBill")] [HttpGet] public object DeleteHR_PostSkillBill(Int64 HInterID, string HMaker) { try { //夿æé if (!DBUtility.ClsPub.Security_Log(ModRightNameDrop, 3, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åå é¤åè½æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } //夿å卿§ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { //å é¤åæ§å¶========================================= string sql1 = "exec h_p_HR_PostSkillBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + HMaker + "'"; ds = oCn.RunProcReturn(sql1, "h_p_YS_ReceiveOtherBill_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; } //================================================================================== //å é¤åæ®ï¼å å«å é¤åæ§å¶ãåå ¥æ¥å¿ï¼ if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_HR_PostSkillBill_AfterDelCtrl", HMaker, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å 餿åï¼"; objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; 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 å²ä½æè½æ¸ åå®¡æ ¸/åå®¡æ ¸ /// <summary> /// å®¡æ ¸/åå®¡æ ¸å²ä½æè½æ¸ å /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="Type">å®¡æ ¸(1),åå®¡æ ¸(2)</param> /// <param name="HMaker">å®¡æ ¸äºº</param> /// <returns></returns> [Route("HR_PostSkillBill/AuditHR_PostSkillBill")] [HttpGet] public object AuditHR_PostSkillBill(Int64 HInterID, int IsAudit, string HMaker) { try { //夿æé if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 3, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åå®¡æ ¸/åå®¡æ ¸åè½æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ DAL.ClsHR_PostSkillBill oBill = new DAL.ClsHR_PostSkillBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //夿å卿§ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ if (IsAudit == 1) { if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸ï¼ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } 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 == 1) //å®¡æ ¸å¤æ { if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 2) //åå®¡æ ¸å¤æ { if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } //å®¡æ ¸åæ§å¶========================================= string sql1 = "exec h_p_HR_PostSkillBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'"; ds = oCn.RunProcReturn(sql1, "h_p_HR_PostSkillBill_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(HInterID, oBill.omodel.HBillNo, "h_p_HR_PostSkillBill_AfterCheckCtrl", HMaker, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åæ®å·ï¼"+ oBill.omodel.HBillNo+ " å®¡æ ¸æåï¼"; objJsonResult.data = null; return objJsonResult; ; } } else { if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸ï¼ä¸éè¦åå®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } //åå®¡æ ¸åæ§å¶========================================= string sql1 = "exec h_p_HR_PostSkillBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'"; ds = oCn.RunProcReturn(sql1, "h_p_HR_PostSkillBill_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 (!oBill.AbandonCheck(HInterID, oBill.omodel.HBillNo, "h_p_HR_PostSkillBill_AfterUnCheckCtrl", HMaker, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åæ®å·ï¼" + oBill.omodel.HBillNo + " åå®¡æ ¸æåï¼"; objJsonResult.data = null; return objJsonResult; ; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; 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 å²ä½æè½æ¸ åå ³é/åå ³é /// <summary> /// å ³é/åå ³éå²ä½æè½æ¸ å /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="Type">å ³é(1),åå ³é(2)</param> /// <param name="HMaker">å ³é人</param> /// <returns></returns> [Route("HR_PostSkillBill/CloseHR_PostSkillBill")] [HttpGet] public object CloseHR_PostSkillBill(Int64 HInterID, int Type, string HMaker) { try { //夿æé if (!DBUtility.ClsPub.Security_Log(ModRightNameClose, 3, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åå ³é/åå ³éåè½æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } //夿å卿§ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { //Type 1 å ³é 2 åå ³é if (Type == 1) { 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 (oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³éï¼ä¸è½åæ¬¡å ³éï¼"; objJsonResult.data = null; return objJsonResult; } //å ³éåæ® if (!oBill.CloseBill(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "å ³éæåï¼"; objJsonResult.data = null; return objJsonResult; ; } } else { if (oBill.omodel.HCloseMan.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå ³éï¼ä¸éè¦åå ³éï¼"; objJsonResult.data = null; return objJsonResult; } //åå ³éåæ® if (!oBill.CancelClose(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå ³é失败!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "åå ³éæåï¼"; objJsonResult.data = null; return objJsonResult; ; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; 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 å²ä½æè½æ¸ åä½åº/åä½åº /// <summary> /// ä½åº/åä½åºå²ä½æè½æ¸ å /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="Type">ä½åº(1),åä½åº(2)</param> /// <param name="HMaker">ä½åºäºº</param> /// <returns></returns> [Route("HR_PostSkillBill/DropHR_PostSkillBill")] [HttpGet] public object DropHR_PostSkillBill(Int64 HInterID, int Type, string HMaker) { try { //夿æé if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 3, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åä½åº/åä½åºåè½æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } //夿å卿§ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { //Type 1 ä½åº 2 åä½åº if (Type == 1) { if (oBill.omodel.HChecker.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 (!oBill.Cancelltion(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = " ä½åºæåï¼"; objJsonResult.data = null; return objJsonResult; ; } } else { if (oBill.omodel.HDeleteMan.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªä½åºï¼ä¸éè¦åä½åºï¼"; objJsonResult.data = null; return objJsonResult; } //åä½åºåæ® if (!oBill.AbandonCancelltion(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = " åä½åºæåï¼"; objJsonResult.data = null; return objJsonResult; ; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; 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 å²ä½æè½æ¸ åç¼è¾ /// <summary> /// å²ä½æè½æ¸ åç¼è¾æ¶ï¼æ ¹æ®åæ®IDè·ååæ®ä¿¡æ¯ /// </summary> /// <returns></returns> [Route("HR_PostSkillBill/EditHR_PostSkillBill")] [HttpGet] public object EditHR_PostSkillBill(Int64 HInterID, string HMaker) { try { //夿æé if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 3, false, HMaker)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åç¼è¾æé,请ä¸ç®¡çåèç³»ï¼"; objJsonResult.data = null; return objJsonResult; } //è¿ååè¡¨ä¿¡æ¯ ds = oCn.RunProcReturn("select * from h_v_HR_PostSkillBillMainList where 1=1 and hmainid=" + HInterID + " order by hmainid desc", "h_v_HR_PostSkillBillMainList"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æªæ¥è¯¢å°è¯¥å²ä½æè½æ¸ åï¼è¯·å·æ°æ°æ®åéæ°éæ©ï¼"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "æåï¼"; objJsonResult.data = ds.Tables[0]; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è¿åå²ä½æè½æ¸ åä¿¡æ¯å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region å²ä½æè½æ¸ å æ°å¢/ç¼è¾ [Route("HR_PostSkillBill/SaveHR_PostSkillBill")] [HttpPost] public object SaveHR_PostSkillBill([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[2].ToString();//æä½æ¹å¼æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ string msg4 = sArray[3].ToString();//ç¨æ·å DBUtility.ClsPub.CurUserName = msg4; string UserName = ""; string s = ""; ListModels oListModels = new ListModels(); try { //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("HR_PostSkillBillMain_Edit", 1, false, msg4)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsHR_PostSkillBill oBill = new DAL.ClsHR_PostSkillBill(); List<Model.ClsHR_PostSkillBillMain> lsmain = new List<Model.ClsHR_PostSkillBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_HR_PostSkillBillMain(msg2); foreach (Model.ClsHR_PostSkillBillMain oItem in lsmain) { if (refSav == "Add") { //忮巿¯å¦éå¤ if (BillNew.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 (BillOld.ShowBill(oItem.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; } if (BillOld.omodel.HBillStatus > 1) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤åæ®å¤äºä¸å¯ç¼è¾ç¶æï¼ä¸å 许修æ¹ï¼"; objJsonResult.data = 1; return objJsonResult; } if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = s + "ï¼ä¸å 许修æ¹"; objJsonResult.data = 1; return objJsonResult; } } UserName = oItem.HMaker; //å¶å人 oItem.HBillType = "2002"; oItem.HBillSubType = "2002"; 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; } // è¡¨ä½æ°æ® //æ },{æ¥æåæ°ç» //廿ãåã msg3 = msg3.Substring(1, msg3.Length - 2); msg3 = msg3.Replace("\\", ""); msg3 = msg3.Replace("\n", ""); //\n List<Model.ClsHR_PostSkillBillSub> ls = new List<Model.ClsHR_PostSkillBillSub>(); ls = oListModels.getObjectByJson_HR_PostSkillBillSub(msg3); int i = 0; foreach (Model.ClsHR_PostSkillBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å oBill.DetailColl.Add(oItemSub); } //ä¿å //ä¿å宿¯åå¤ç 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 } } WebAPI/ListModels.cs
@@ -1076,6 +1076,17 @@ } /// <summary> /// å¤çæ°å¢å¼å¸¸åé¦éªæ¶å表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsOA_ErrMsgBackCheckBillMain> getObjectByJson_OA_ErrMsgBackCheckBill(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsOA_ErrMsgBackCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsOA_ErrMsgBackCheckBillMain>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢å¼å¸¸åé¦ç¾å°å表çjson /// </summary> /// <param name="jsonString"></param> @@ -1087,6 +1098,17 @@ return list; } /// <summary> /// å¤çæ°å¢å¼å¸¸åé¦å¤çå表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsOA_ErrMsgBackHandleBillMain> getObjectByJson_OA_ErrMsgBackHandleBill(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsOA_ErrMsgBackHandleBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsOA_ErrMsgBackHandleBillMain>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢å¼å¸¸åé¦ç±»å表çjson /// </summary> @@ -1134,6 +1156,31 @@ List<Models.ClsGy_StockCheckItemBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_StockCheckItemBill>>(jsonString); return list; } /// <summary> /// å¤çæ°å²ä½æè½æ¸ å主表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsHR_PostSkillBillMain> getObjectByJson_HR_PostSkillBillMain(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsHR_PostSkillBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsHR_PostSkillBillMain>>(jsonString); return list; } /// <summary> /// å¤çæ°å²ä½æè½æ¸ åå表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsHR_PostSkillBillSub> getObjectByJson_HR_PostSkillBillSub(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsHR_PostSkillBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsHR_PostSkillBillSub>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢å¨æ»ç»è¡¨çjson /// </summary> WebAPI/WebAPI.csproj
@@ -570,6 +570,7 @@ <Compile Include="Controllers\QC_POStockInCheckBillController.cs" /> <Compile Include="Controllers\å·¥èµç®¡ç\Gy_GroupEmpBillController.cs" /> <Compile Include="Controllers\å·¥èµç®¡ç\Pay_PurchaseWallclothBillController.cs" /> <Compile Include="Controllers\å·¥èµç®¡ç\HR_PostSkillBillController.cs" /> <Compile Include="Controllers\å·¥èµç®¡ç\Pay_WorkTimesBillController.cs" /> <Compile Include="Controllers\å·¥èµç®¡ç\Pay_SingleBalBillController.cs" /> <Compile Include="Controllers\ProductionOrderController.cs" />