private static void FlagReconcile(SessionInfo sessioninfo,bool unlock) { ProcessingDateBusiness _pcdBusiness = new ProcessingDateBusiness(); MA_PROCESS_DATE processdate; processdate = _pcdBusiness.Get(); if (processdate == null) throw new UIPException(new Exception(), "Process date data not found!"); processdate.FLAG_RECONCILE = unlock; processdate.LOG.MODIFYBYUSERID = sessioninfo.CurrentUserId; processdate.LOG.MODIFYDATE = DateTime.Now; _pcdBusiness.Update(sessioninfo, processdate); }
public static object CheckFlagReconcile(SessionInfo sessioninfo) { ProcessingDateBusiness _pcdBusiness = new ProcessingDateBusiness(); UserBusiness _userBusiness = new UserBusiness(); MA_PROCESS_DATE processdate; MA_USER user; try { processdate = _pcdBusiness.Get(); if (processdate == null) throw new UIPException(new Exception(), "Process date data not found!"); if (processdate.FLAG_RECONCILE.HasValue && processdate.FLAG_RECONCILE.Value == true) { user = _userBusiness.GetByID(sessioninfo, processdate.LOG.MODIFYBYUSERID.Value); return new { Result = "UNAVAILBLE", Message = string.Format("Please wait. System is on processing by {0}", user != null ? user.NAME : string.Empty) }; } else { //processdate.FLAG_RECONCILE = true; //processdate.LOG.MODIFYBYUSERID = sessioninfo.CurrentUserId; //processdate.LOG.MODIFYDATE = DateTime.Now; //_pcdBusiness.Update(sessioninfo, processdate); return new { Result = "AVAILBLE", Message = string.Empty }; } } catch (Exception ex) { return new { Result = "ERROR", Message = ex.Message }; } }