| | |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | |
| | | string UserName; |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | |
| | | lsmain = oListModels.getObjectByJson_Reportlist(msg2); |
| | | foreach (Model.ClsSc_ProcessReportMain oItem in lsmain) |
| | | { |
| | | //oItem.HMaker = ""; |
| | | //UserName = oItem.HMaker; |
| | | UserName = oItem.HMaker; |
| | | oItem.HMaker = UserName; |
| | | oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); |
| | |
| | | public object CloseProcessReportList(int HInterID,int IsClose,string CurUserName) |
| | | { |
| | | DataSet ds; |
| | | string ModRightNameCheck = "Sc_ProcessReport_check"; |
| | | try |
| | | { |
| | | //审核权限 |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (HInterID <= 0) |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | var HChecker = ds.Tables[0].Rows[0]["HChecker"].ToString(); |
| | | var HCloseMan = ds.Tables[0].Rows[0]["HCloseMan"].ToString(); |
| | | |
| | | if (IsClose == 0) |
| | | { |
| | | |
| | | if (HCloseMan.Trim() != "" || HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据未审核、已关闭、已作废状态下不允许关闭!!!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update Sc_ProcessReportMain set HCloseMan='" + CurUserName + "' ,HCloseDate=GETDATE() where HInterID=" + HInterID); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | else if(IsClose==1) |
| | | { |
| | | if (HCloseMan.Trim() == "" || HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据未审核、未关闭、已作废状态下不允许撤销关闭!!!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update Sc_ProcessReportMain set HCloseMan='' ,HCloseDate=null where HInterID=" + HInterID); |
| | | objJsonResult.code = "0"; |
| | |
| | | public object AuditProcessReportList(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | DataSet ds; |
| | | string ModRightNameCheck = "Sc_ProcessReport_check"; |
| | | var a = DBUtility.ClsPub.CurUserName; |
| | | try |
| | | { |
| | | //审核权限 |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (HInterID <= 0) |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Sc_ProcessReportMain where HInterID=" + HInterID, "Sc_ProcessReportMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有这个单据,无法审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | return objJsonResult; |
| | | } |
| | | var HChecker = ds.Tables[0].Rows[0]["HChecker"].ToString();//取审核人 |
| | | var HMaker=ds.Tables[0].Rows[0]["HMaker"].ToString();//取制单人 |
| | | var HCloseMan=ds.Tables[0].Rows[0]["HCloseMan"].ToString();//取关闭人 |
| | | if (IsAudit == 0) |
| | | { |
| | | if (HChecker.Trim() != "" || HChecker.Trim() == HMaker || HCloseMan != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已审核、已关闭、已作废状态不允许审核!!!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update Sc_ProcessReportMain set HChecker='" + CurUserName + "' ,HCheckDate=GETDATE() where HInterID=" + HInterID); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* 单据审核成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | return objJsonResult; |
| | | } |
| | | else if (IsAudit == 1) |
| | | { |
| | | if (HChecker.Trim() == "" || HChecker.Trim() == CurUserName || HCloseMan != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据未审核、已关闭、已作废状态下不允许反审核!!!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update Sc_ProcessReportMain set HChecker='' ,HCheckDate=null where HInterID=" + HInterID); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* 单据反审核成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据无法审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |