| | |
| | | public DAL.ClsPM_WorkPlanMonthBillMain BillNew1 = new DAL.ClsPM_WorkPlanMonthBillMain(); //å·¥ä½å¨æ»ç»å¯¹åºåæ®ç±» |
| | | public DAL.ClsPM_WorkPlanMonthBillMain BillOld1 = new DAL.ClsPM_WorkPlanMonthBillMain(); |
| | | |
| | | public DAL.ClsPM_WorkPlanMonthBillMain BillNew2 = new DAL.ClsPM_WorkPlanMonthBillMain(); //æåº¦é¶æ®µè®¡å对åºåæ®ç±» |
| | | public DAL.ClsPM_WorkPlanMonthBillMain BillOld2 = new DAL.ClsPM_WorkPlanMonthBillMain(); |
| | | |
| | | public DAL.ClsPM_CustomerTaskBillMain BillNew3 = new DAL.ClsPM_CustomerTaskBillMain(); //项ç®éæ±åé®é¢æ¸
å对åºåæ®ç±» |
| | | public DAL.ClsPM_CustomerTaskBillMain BillOld3 = new DAL.ClsPM_CustomerTaskBillMain(); |
| | | |
| | | public DAL.ClsPM_ProjectMoneyBillMain BillNew4 = new DAL.ClsPM_ProjectMoneyBillMain(); //项ç®è´¹ç¨å对åºåæ®ç±» |
| | | public DAL.ClsPM_ProjectMoneyBillMain BillOld4 = new DAL.ClsPM_ProjectMoneyBillMain(); |
| | | |
| | | #region å·¥ç¨é¡¹ç® æ°å¢/ç¼è¾ |
| | | #region å·¥ç¨é¡¹ç® è¡¨å¤´æ°æ® |
| | | public class PM_ProjectBill_Main |
| | |
| | | if (refSav == "Add") |
| | | { |
| | | //忮巿¯å¦éå¤ |
| | | if (BillNew1.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) |
| | | if (BillNew2.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | if (refSav == "Update") |
| | | { |
| | | if (BillOld1.ShowBill(oItem.HInterID, ref s) == false) |
| | | if (BillOld2.ShowBill(oItem.HInterID, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦å¯ç¼è¾ |
| | | if (BillOld1.omodel.HChecker != "" && BillOld1.omodel.HChecker != null) |
| | | if (BillOld2.omodel.HChecker != "" && BillOld2.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld1.omodel.HBillStatus > 1) |
| | | if (BillOld2.omodel.HBillStatus > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | 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 = "4758"; |
| | |
| | | #region æåº¦é¶æ®µè®¡å å®¡æ ¸/åå®¡æ ¸åè½ |
| | | [Route("PM_ProjectBill/CheckPM_WorkPlanMonthBillMain")] |
| | | [HttpGet] |
| | | public object CheckPM_WorkPlanMonthBillMain(string HInterID, int IsAudit, string user) |
| | | public object CheckPM_WorkPlanMonthBillMain(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("PM_WorkPlanMonthBillMain_Check", 1, false, user)) |
| | | if (!DBUtility.ClsPub.Security_Log_second("PM_WorkPlanMonthBillMain_Check", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from PM_WorkPlanMonthBillMain where HInterID=" + HInterID, "PM_WorkPlanMonthBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | //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.ClsPM_WorkPlanMonthBillMain oBill = new DAL.ClsPM_WorkPlanMonthBillMain(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å
³æä½ |
| | | |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | 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 (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | //è¿è¡éè¦è¿è¡çå®¡æ ¸/åå®¡æ ¸æä½ |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | oCN.RunProc("update PM_WorkPlanMonthBillMain set HChecker='" + user + "',HCheckDate=getdate() where HInterID=" + HInterID); |
| | | oCN.BeginTran(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | //è®°å½è¿åä¿¡æ¯ |
| | | string msg = ""; |
| | | |
| | | |
| | | |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_PM_WorkPlanMonthBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_PM_WorkPlanMonthBill_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_PM_WorkPlanMonthBill_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) //åå®¡æ ¸å¤æ |
| | | if (IsAudit == 1) //åå®¡æ ¸æäº¤ |
| | | { |
| | | oCN.RunProc("update PM_WorkPlanMonthBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | //åå®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_PM_WorkPlanMonthBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_PM_WorkPlanMonthBill_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_PM_WorkPlanMonthBill_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; |
| | | } |
| | | } |
| | | oCN.Commit(); |
| | | |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè
åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); |
| | |
| | | if (refSav == "Add") |
| | | { |
| | | //忮巿¯å¦éå¤ |
| | | if (BillNew1.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) |
| | | if (BillNew3.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | if (refSav == "Update") |
| | | { |
| | | if (BillOld1.ShowBill(oItem.HInterID, ref s) == false) |
| | | if (BillOld3.ShowBill(oItem.HInterID, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦å¯ç¼è¾ |
| | | if (BillOld1.omodel.HChecker != "" && BillOld1.omodel.HChecker != null) |
| | | if (BillOld3.omodel.HChecker != "" && BillOld3.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld1.omodel.HBillStatus > 1) |
| | | if (BillOld3.omodel.HBillStatus > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | 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 = "4759"; |
| | |
| | | #region 项ç®éæ±åé®é¢æ¸
åå表 å®¡æ ¸/åå®¡æ ¸åè½ |
| | | [Route("PM_ProjectBill/CheckPM_CustomerTaskBillMain")] |
| | | [HttpGet] |
| | | public object CheckPM_CustomerTaskBillMain(string HInterID, int IsAudit, string user) |
| | | public object CheckPM_CustomerTaskBillMain(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("PM_CustomerTaskBillMain_Check", 1, false, user)) |
| | | if (!DBUtility.ClsPub.Security_Log_second("PM_CustomerTaskBillMain_Check", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from PM_CustomerTaskBillMain where HInterID=" + HInterID, "PM_CustomerTaskBillMain "); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | //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.ClsPM_CustomerTaskBillMain oBill = new DAL.ClsPM_CustomerTaskBillMain(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å
³æä½ |
| | | |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | 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 (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | //è¿è¡éè¦è¿è¡çå®¡æ ¸/åå®¡æ ¸æä½ |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | oCN.RunProc("update PM_CustomerTaskBillMain set HChecker='" + user + "',HCheckDate=getdate() where HInterID=" + HInterID); |
| | | oCN.BeginTran(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | //è®°å½è¿åä¿¡æ¯ |
| | | string msg = ""; |
| | | |
| | | |
| | | |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_PM_CustomerTaskBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_PM_CustomerTaskBill_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_PM_CustomerTaskBill_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) //åå®¡æ ¸å¤æ |
| | | if (IsAudit == 1) //åå®¡æ ¸æäº¤ |
| | | { |
| | | oCN.RunProc("update PM_CustomerTaskBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | //åå®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_PM_CustomerTaskBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_PM_CustomerTaskBill_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_PM_CustomerTaskBill_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; |
| | | } |
| | | } |
| | | oCN.Commit(); |
| | | |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè
åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); |
| | |
| | | if (refSav == "Add") |
| | | { |
| | | //忮巿¯å¦éå¤ |
| | | if (BillNew1.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) |
| | | if (BillNew4.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | if (refSav == "Update") |
| | | { |
| | | if (BillOld1.ShowBill(oItem.HInterID, ref s) == false) |
| | | if (BillOld4.ShowBill(oItem.HInterID, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦å¯ç¼è¾ |
| | | if (BillOld1.omodel.HChecker != "" && BillOld1.omodel.HChecker != null) |
| | | if (BillOld4.omodel.HChecker != "" && BillOld4.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld1.omodel.HBillStatus > 1) |
| | | if (BillOld4.omodel.HBillStatus > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | 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 = "4762"; |
| | |
| | | #region 项ç®è´¹ç¨å表 å®¡æ ¸/åå®¡æ ¸åè½ |
| | | [Route("PM_ProjectBill/CheckPM_ProjectMoneyBillMain")] |
| | | [HttpGet] |
| | | public object CheckPM_ProjectMoneyBillMain(string HInterID, int IsAudit, string user) |
| | | public object CheckPM_ProjectMoneyBillMain(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("PM_ProjectMoneyBillMain_Check", 1, false, user)) |
| | | if (!DBUtility.ClsPub.Security_Log_second("PM_ProjectMoneyBillMain_Check", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from PM_ProjectMoneyBillMain where HInterID=" + HInterID, "PM_ProjectMoneyBillMain "); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | //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.ClsPM_ProjectMoneyBillMain oBill = new DAL.ClsPM_ProjectMoneyBillMain(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å
³æä½ |
| | | |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | 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 (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | //è¿è¡éè¦è¿è¡çå®¡æ ¸/åå®¡æ ¸æä½ |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | oCN.RunProc("update PM_ProjectMoneyBillMain set HChecker='" + user + "',HCheckDate=getdate() where HInterID=" + HInterID); |
| | | oCN.BeginTran(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | //è®°å½è¿åä¿¡æ¯ |
| | | string msg = ""; |
| | | |
| | | |
| | | |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_PM_ProjectMoneyBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_PM_ProjectMoneyBill_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_PM_ProjectMoneyBill_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) //åå®¡æ ¸å¤æ |
| | | if (IsAudit == 1) //åå®¡æ ¸æäº¤ |
| | | { |
| | | oCN.RunProc("update PM_ProjectMoneyBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | //åå®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_PM_ProjectMoneyBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_PM_ProjectMoneyBill_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_PM_ProjectMoneyBill_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; |
| | | } |
| | | } |
| | | oCN.Commit(); |
| | | |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè
åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); |
| | |
| | | |
| | | //è®°å½è¿åä¿¡æ¯ |
| | | string msg = ""; |
| | | |
| | | if (oBill.omodel.HMainSourceInterID != 0) |
| | | { |
| | | //æ£éªæºåæ¯å¦åå¨ååæ®ç¶æ |
| | | string sql = "select * from PM_ProjectEndBillMain where HInterID = " + oBill.omodel.HMainSourceInterID; |
| | | ds = oCN.RunProcReturn(sql, "PM_ProjectEndBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :æºå-ç¹æ¹ç³è¯·åä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if (ds.Tables[0].Rows[0]["HBillStatus"].ToString() != "2") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :æºå-ç¹æ¹ç³è¯·åæªå¤äºå·²å®¡æ ¸ç¶æ!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_PM_ProjectEndBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |