//Process Lock Record public bool ProcessLockRecord(long UserID, long ScreenType, long CaseID, bool IsRelockRequired) { UIRecordsLock objRecordsLocked = new UIRecordsLock(); bool isSuccess = false; try { BLCommon objBLCommon = new BLCommon(); _retValue = objBLCommon.GetLockedRecordOrLockRecord(UserID, ScreenType, CaseID, IsRelockRequired, out objRecordsLocked); if (_retValue == ExceptionTypes.Success && objRecordsLocked.Status == (long)ExceptionTypes.Success && objRecordsLocked.CreatedByRef == UserID) { isSuccess = true; } } catch (Exception ex) { BLCommon.LogError(_lCurrentMasterUserId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.BGPSendOOALetter, (long)ExceptionTypes.Uncategorized, ex.Message.ToString(), ex.Message.ToString()); //ErrorMessage += ex.Message + ex.StackTrace; } return(isSuccess); }
public JsonResult GetLockedRecordOrLockRecord(long caseId, long screenLkup, bool isForcedLocked) { UIRecordsLock objRecordsLocked = new UIRecordsLock(); try { long currentLoginUserId = currentUser.ADM_UserMasterId; BLCommon objCommon = new BLCommon(); ExceptionTypes result = objCommon.GetLockedRecordOrLockRecord(currentLoginUserId, screenLkup, caseId, isForcedLocked, out objRecordsLocked); if (result == (long)ExceptionTypes.Success) { return(Json(objRecordsLocked)); } } catch (Exception ex) { BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.RecordsLocked, (long)ExceptionTypes.Uncategorized, ex.ToString(), ex.ToString()); } objRecordsLocked.Status = (long)ExceptionTypes.UnknownError; objRecordsLocked.ErrorMessage = "The record is locked for editing by other user. Please retry."; return(Json(objRecordsLocked, JsonRequestBehavior.AllowGet)); }
public ActionResult GMURecord(DateTime dtpStartDate, DateTime dtpEndDate, long queueLkup, long?queueIdToSkip, string DiscrepancyCategory) { BLQueueSummary objBLQueueSummary = new BLQueueSummary(); BLCommon objCommon = new BLCommon(); DOGEN_Queue objDOGEN_Queue = new DOGEN_Queue(); string strErrorMessage = string.Empty; bool isForcedLock = false; try { if (queueIdToSkip > 0) { ExceptionTypes exceptionResult = objCommon.UnlockRecord((long)ScreenType.Queue, (long)queueIdToSkip); if (exceptionResult != ExceptionTypes.Success) { BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.EligibilityGetQueue, (long)ExceptionTypes.Uncategorized, strErrorMessage, strErrorMessage); return(RedirectToAction("Maintenance", "Error", new { Error = strErrorMessage })); } } int lockCount = 1; do { ExceptionTypes dbresult = objBLQueueSummary.GetGMURecord(dtpStartDate, dtpEndDate, (long)currentUser.BusinessSegmentLkup, queueLkup, queueIdToSkip, currentUser.ADM_UserMasterId, currentUser.IsRestrictedUser, out objDOGEN_Queue, out strErrorMessage); if (dbresult == ExceptionTypes.Success) { //Locking the record. if (objDOGEN_Queue.LockedByRef == currentUser.ADM_UserMasterId) { isForcedLock = true; } UIRecordsLock objRecordsLocked; ExceptionTypes exceptionResult = objCommon.GetLockedRecordOrLockRecord(currentUser.ADM_UserMasterId, (long)ScreenType.Queue, (long)objDOGEN_Queue.GEN_QueueId, false, out objRecordsLocked); if (exceptionResult == (long)ExceptionTypes.Success && objRecordsLocked != null) { if (objRecordsLocked.CreatedByRef != currentUser.ADM_UserMasterId) { lockCount = lockCount + 1; continue; } lockCount = 11; } else { lockCount = lockCount + 1; } } else { lockCount = lockCount + 1; } } while (lockCount <= 10); ViewBag.Name = DiscrepancyCategory; return(PartialView("_GetEligibilityWorkItem", objDOGEN_Queue)); } catch (Exception ex) { BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.EligibilityGetQueue, (long)ExceptionTypes.Uncategorized, string.Empty, ex.Message); return(RedirectToAction("Maintenance", "Error", new { Error = ex.ToString() })); } }
long _currentLoginUserId = 11;//for MIIM System will be set in Create session // GET: MIIMConnector public ActionResult GetCaseDetails(string caseId) { ViewBag.PageName = ConstantTexts.MiimPageName; try { MIIMServiceLog(MethodBase.GetCurrentMethod().Name, caseId, ConstantTexts.MIIMNew, _currentLoginUserId, TarceMethodLkup.New.ToLong(), (long)MIIMServiceMethod.GetCaseDetails); if (long.TryParse(caseId, out long lQueueID))// to check if case exists in DB { #region Create Session ExceptionTypes result = CreateSession(WorkBasket.OST); #endregion if (result == ExceptionTypes.Success) { ///Log For User Authentication Success MIIMServiceLog(MethodBase.GetCurrentMethod().Name, caseId, ConstantTexts.MIIMUserAuthSucc, _currentLoginUserId, TarceMethodLkup.InProgress.ToLong(), (long)MIIMServiceMethod.GetCaseDetails); #region validate Record Lock UIRecordsLock objRecordsLocked = new UIRecordsLock(); bool isAvailable = true; try { BLCommon objCommon = new BLCommon(); result = objCommon.GetLockedRecordOrLockRecord(_currentLoginUserId, (long)ScreenType.Queue, lQueueID, false, out objRecordsLocked); if (result == (long)ExceptionTypes.Success) { isAvailable = objRecordsLocked.LockedHours.IsNullOrEmpty(); } } catch (Exception ex) { MIIMServiceLog(MethodBase.GetCurrentMethod().Name, caseId, "Record locking failed", _currentLoginUserId, TarceMethodLkup.Completed.ToLong(), (long)MIIMServiceMethod.GetCaseDetails); BLCommon.LogError(_currentLoginUserId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.MIIMConnector, (long)ExceptionTypes.Uncategorized, ex.ToString(), ex.ToString()); ViewBag.ErrorMessage = "\nError Locking the Record Please try Again."; return(View("~/Views/Shared/Error.cshtml")); } #endregion if (isAvailable) { #region Get Case Discrepancy Category result = _objBLMIIMIntegration.GetCaseDiscrepancyCategory(lQueueID, out long lDiscrepancyCategory, out string errorMessage); if (result != (long)ExceptionTypes.Success && result != ExceptionTypes.ZeroRecords) { MIIMServiceLog(MethodBase.GetCurrentMethod().Name, caseId, ConstantTexts.MIIMRecordNotFound, _currentLoginUserId, TarceMethodLkup.Completed.ToLong(), (long)MIIMServiceMethod.GetCaseDetails); BLCommon.LogError(_currentLoginUserId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.MIIMConnector, (long)ExceptionTypes.Uncategorized, errorMessage, "Error occured while getting Discrepancy Category."); ViewBag.ErrorMessage = "\nDetails Not available for selected Case."; return(View("~/Views/Shared/Error.cshtml")); } #endregion #region Redirect to Process Work Screen based on Work Basket string strEncodedCaseId = URLEncoderDecoder.Encode(lQueueID.ToString()); MIIMServiceLog(MethodBase.GetCurrentMethod().Name, caseId, ConstantTexts.MIIMRequestCompleted, _currentLoginUserId, TarceMethodLkup.Completed.ToLong(), (long)MIIMServiceMethod.GetCaseDetails); switch (lDiscrepancyCategory) { case (long)DiscripancyCategory.RPR: return(RedirectToAction("RPRProcessWork", "RPR", new { queueId = strEncodedCaseId, pageName = ConstantTexts.MiimPageName })); case (long)DiscripancyCategory.Eligibility: return(RedirectToAction("EligibilityProcessWork", "Eligibility", new { queueId = strEncodedCaseId, pageName = ConstantTexts.MiimPageName })); case (long)DiscripancyCategory.DOB: return(RedirectToAction("DOBProcessWork", "Eligibility", new { queueId = strEncodedCaseId, pageName = ConstantTexts.MiimPageName })); case (long)DiscripancyCategory.Gender: return(RedirectToAction("GenderProcessWork", "Eligibility", new { queueId = strEncodedCaseId, pageName = ConstantTexts.MiimPageName })); case (long)DiscripancyCategory.OOA: return(RedirectToAction("OOAProcessWork", "OST", new { queueId = strEncodedCaseId, pageName = ConstantTexts.MiimPageName })); case (long)DiscripancyCategory.SCC: return(RedirectToAction("SCCProcessWork", "OST", new { queueId = strEncodedCaseId, pageName = ConstantTexts.MiimPageName })); case (long)DiscripancyCategory.TRR: return(RedirectToAction("TRRProcessWork", "OST", new { queueId = strEncodedCaseId, pageName = ConstantTexts.MiimPageName })); } #endregion } else { MIIMServiceLog(MethodBase.GetCurrentMethod().Name, caseId, "Record is locked by User Id :" + objRecordsLocked.CreatedByRef, _currentLoginUserId, TarceMethodLkup.Completed.ToLong(), (long)MIIMServiceMethod.GetCaseDetails); ViewBag.ErrorMessage = "\nRecord is Locked by " + objRecordsLocked.CreatedByName + " and Not Available for Processing"; return(View("~/Views/Shared/Error.cshtml")); } } else if (result == ExceptionTypes.UnknownError) { MIIMServiceLog(MethodBase.GetCurrentMethod().Name, caseId, ConstantTexts.MIIMUserAuthFail, _currentLoginUserId, TarceMethodLkup.Completed.ToLong(), (long)MIIMServiceMethod.GetCaseDetails); ViewBag.ErrorMessage = "\nYou are not part of ERS DB.\nPlease contact administrator"; return(View("~/Views/Shared/Error.cshtml")); } else { MIIMServiceLog(MethodBase.GetCurrentMethod().Name, caseId, ConstantTexts.MIIMUserAuthFail, _currentLoginUserId, TarceMethodLkup.Completed.ToLong(), (long)MIIMServiceMethod.GetCaseDetails); ViewBag.ErrorMessage = "\nYou do not have permission to access this page.\nPlease contact administrator"; return(View("~/Views/Shared/Error.cshtml")); } } MIIMServiceLog(MethodBase.GetCurrentMethod().Name, caseId, "Invalid ERS case Id :" + caseId, _currentLoginUserId, TarceMethodLkup.Completed.ToLong(), (long)MIIMServiceMethod.GetCaseDetails); ViewBag.ErrorMessage = "\nInvalid Case Id."; return(View("~/Views/Shared/Error.cshtml")); } catch (Exception ex) { MIIMServiceLog(MethodBase.GetCurrentMethod().Name, caseId, ex.ToString(), _currentLoginUserId, TarceMethodLkup.Failed.ToLong(), (long)MIIMServiceMethod.GetCaseDetails); BLCommon.LogError(_currentLoginUserId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.MIIMConnector, (long)ExceptionTypes.Uncategorized, ex.ToString(), ex.Message); return(View("~/Views/Shared/Error.cshtml")); } }