Beispiel #1
0
 /// <summary>
 /// EditRecordVisibility
 /// </summary>
 /// <param name="lstSearchResults"></param>
 private void EditRecordVisibility(ref List <MostRecentItem> lstMostRecentItem)
 {
     foreach (var item in lstMostRecentItem)
     {
         item.EncryptedCaseID = URLEncoderDecoder.Encode(item.Gen_QueueId.NullToString());
         if (CheckEditButtonVisibility(item.QueueProgressTypeLkup, item.MostRecentWorkQueueLkup, item.AssignedToRef, item.PendedByRef, item.OOALetterStatusLkup, item.CMSTransactionStatusLkup))
         {
             item.EditActionVisibility = true;
         }
     }
 }
        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"));
            }
        }