Ejemplo n.º 1
0
        private UIBulkUploadSearch PLoadBulkUpload()
        {
            long?TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
            UIBulkUploadSearch      objUIBulkUploadSearch = new UIBulkUploadSearch();
            List <DOGEN_BulkImport> lstDOGEN_BulkImport   = new List <DOGEN_BulkImport>();

            errorMessage = string.Empty;
            try
            {
                long workBasketLkp = currentUser.WorkBasketLkup.ToInt64();
                objUIBulkUploadSearch.WorkbasketLkup  = workBasketLkp;
                objUIBulkUploadSearch.lstWorkbasket   = CacheUtility.GetAllLookupsFromCache(LookupTypes.WorkBasket.ToInt64());
                objUIBulkUploadSearch.lstDiscCategary = CacheUtility.GetAllLookupMasterCorrelationFromCache((long)LookupTypesCorrelation.WorkBasketVsDiscripancyCategory, workBasketLkp);
                objUIBulkUploadSearch.lstDOGEN_BulkImportExcelTemplateMaster = CacheUtility.GetBulkImportExcelTemplateFromCache().lstDOGEN_BulkImportExcelTemplateMaster.Where(x => x.TemplateTypeLkup == TemplateType.BulkUpload.ToInt64()).ToList();
                objUIBulkUploadSearch.TemplateTypeLkup = TemplateType.BulkUpload.ToLong();
                ExceptionTypes result = _objBLBulkUpload.GetBulkUploadSearchResult(TimeZone, objUIBulkUploadSearch, out lstDOGEN_BulkImport, out errorMessage);
                if (result != (long)ExceptionTypes.Success)
                {
                    BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.BulkUpload, (long)ExceptionTypes.Uncategorized, errorMessage, errorMessage);
                }
                objUIBulkUploadSearch.lstDOGEN_BulkImport = lstDOGEN_BulkImport;

                return(objUIBulkUploadSearch);
            }
            catch (Exception ex)
            {
                BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.BulkUpload, (long)ExceptionTypes.Uncategorized, string.Empty, ex.ToString());
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public ActionResult Add(long lSkillsID = 0, bool isActive = true)
        {
            string errorMessage = string.Empty;

            try
            {
                Session[ConstantTexts.SkillWorkQueueSessionKey] = null;
                DOADM_SkillsMaster objDOADM_SkillsMaster = new DOADM_SkillsMaster();
                objDOADM_SkillsMaster.IsActive = true;
                ViewBag.Roles                    = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Role);
                ViewBag.BusinessSegment          = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.BusinessSegment);
                ViewBag.WorkBasket               = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.WorkBasket);
                ViewBag.lstDiscrepancyCategories = GetDiscrepancyCategories();
                ViewBag.lstDepartments           = GetERSDepartments();

                if (lSkillsID != 0)
                {
                    GetSkillForEdit(lSkillsID, isActive, out objDOADM_SkillsMaster);
                    List <DOCMN_LookupMasterCorrelations> lstDOCMN_LookupMaster = CacheUtility.GetAllLookupMasterCorrelationFromCache((long)LookupTypesCorrelation.DiscripancyCategoryVQueue, objDOADM_SkillsMaster.DiscrepancyCategoryLkup);
                    lstDOCMN_LookupMaster = lstDOCMN_LookupMaster.Where(x => x.CMN_LookupMasterParentRef == objDOADM_SkillsMaster.DiscrepancyCategoryLkup).ToList();
                    ViewBag.WorkQueues    = lstDOCMN_LookupMaster;
                    Session[ConstantTexts.SkillWorkQueueSessionKey]           = objDOADM_SkillsMaster.lstDOADM_SkillWorkQueuesCorrelation;
                    objDOADM_SkillsMaster.lstDOADM_SkillWorkQueuesCorrelation = objDOADM_SkillsMaster.lstDOADM_SkillWorkQueuesCorrelation.Where(x => x.IsActive == true).ToList();
                }
                return(View(objDOADM_SkillsMaster));
            }
            catch (Exception ex)
            {
                BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.ManageSkills, (long)ExceptionTypes.Uncategorized, ex.ToString(), ex.ToString());
                return(RedirectToAction("Maintenance", "Error", routeValues: ex.ToString()));
            }
        }
Ejemplo n.º 3
0
 public ActionResult GetQueues(long?lDiscrepancyCatLkup)
 {
     try
     {
         List <DOCMN_LookupMasterCorrelations> lstDOCMN_LookupMaster = CacheUtility.GetAllLookupMasterCorrelationFromCache((long)LookupTypesCorrelation.DiscripancyCategoryVQueue, lDiscrepancyCatLkup);
         lstDOCMN_LookupMaster = lstDOCMN_LookupMaster.Where(x => x.CMN_LookupMasterParentRef == lDiscrepancyCatLkup).ToList();
         return(Json(lstDOCMN_LookupMaster));
     }
     catch (Exception ex)
     {
         BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.ManageSkills, (long)ExceptionTypes.Uncategorized, ex.ToString(), ex.ToString());
         return(RedirectToAction("Maintenance", "Error", routeValues: ex.ToString()));
     }
 }
Ejemplo n.º 4
0
        public ActionResult CreateRPRCase(string memberFName = "", string memberLName = "", string memberDOB = "", string hICN = "", string mIIMReferenceId = "")
        {
            ViewBag.PageName = ConstantTexts.MiimPageName;
            try
            {
                string requestData = "memberFName : " + memberFName + ",memberLName : " + memberLName + ",memberDOB : " + memberDOB + ",string hICN : " + hICN + ",string mIIMReferenceId : " + mIIMReferenceId;

                MIIMServiceLog(MethodBase.GetCurrentMethod().Name, requestData, ConstantTexts.MIIMNew, _currentLoginUserId, TarceMethodLkup.New.ToLong(), (long)MIIMServiceMethod.CreateRPRCase);
                #region Create Session
                ExceptionTypes result = CreateSession(WorkBasket.RPR);
                #endregion

                if (result == ExceptionTypes.Success)
                {
                    MIIMServiceLog(MethodBase.GetCurrentMethod().Name, requestData, ConstantTexts.MIIMUserAuthSucc, _currentLoginUserId, TarceMethodLkup.InProgress.ToLong(), (long)MIIMServiceMethod.CreateRPRCase);
                    DOGEN_Queue objDOGEN_Queue = new DOGEN_Queue();
                    #region Dropdowns Binding
                    List <DOADM_UserMaster> lstUsers;
                    DOADM_UserMaster        objDOADM_UserMaster = new DOADM_UserMaster();
                    objDOADM_UserMaster.IsActive = true;
                    BLUserAdministration objBLUserAdministration = new BLUserAdministration();
                    long?TimeZone = (long)DefaultTimeZone.CentralStandardTime;
                    result = objBLUserAdministration.SearchUser(TimeZone, objDOADM_UserMaster, out lstUsers, out string errorMessage);
                    objDOGEN_Queue.ComplianceStartDate  = DateTime.UtcNow;
                    objDOGEN_Queue.DiscrepancyStartDate = objDOGEN_Queue.ComplianceStartDate.Value.AddMonths(1);
                    objDOGEN_Queue.DiscrepancyStartDate = new DateTime(objDOGEN_Queue.DiscrepancyStartDate.Value.Year, objDOGEN_Queue.DiscrepancyStartDate.Value.Month, 1);
                    objDOGEN_Queue.lstUsers             = lstUsers.Where(x => x.ADM_UserMasterId > 1000 && x.IsManager).OrderBy(x => x.Email).ToList();//Filtered 1st three Users as Admin.sort list by email id
                    objDOGEN_Queue.lstLob                = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.LOB);
                    objDOGEN_Queue.lstDiscCategary       = CacheUtility.GetAllLookupMasterCorrelationFromCache((long)LookupTypesCorrelation.WorkBasketVsDiscripancyCategory, (long)WorkBasket.RPR);
                    objDOGEN_Queue.lstContractid         = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Contract);
                    objDOGEN_Queue.lstPbpid              = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.PBPID);
                    objDOGEN_Queue.lstActionRequested    = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.RPRActionRequested);
                    objDOGEN_Queue.lstTaskBeingPerformed = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Taskbeingperformedwhenthisdiscrepancywasidentified);
                    objDOGEN_Queue.lstDiscType           = CacheUtility.GetAllLookupMasterCorrelationFromCache((long)LookupTypesCorrelation.DiscripancyCategoryVsDiscripancyType, (long)DiscripancyCategory.RPR);
                    #endregion

                    objDOGEN_Queue.MemberFirstName = memberFName;
                    objDOGEN_Queue.MemberLastName  = memberLName;
                    objDOGEN_Queue.MIIMReferenceId = mIIMReferenceId;
                    bool isDobCorrect = DateTime.TryParse(memberDOB, out DateTime dtMemberDob);
                    if (isDobCorrect)
                    {
                        objDOGEN_Queue.MemberDOB = dtMemberDob.AddDays(1);
                    }
                    objDOGEN_Queue.MemberCurrentHICN = hICN;
                    MIIMServiceLog(MethodBase.GetCurrentMethod().Name, requestData, ConstantTexts.MIIMRequestCompleted, _currentLoginUserId, TarceMethodLkup.Completed.ToLong(), (long)MIIMServiceMethod.CreateRPRCase);
                    return(View("~/Views/RPR/Create.cshtml", objDOGEN_Queue));
                }
                else if (result == ExceptionTypes.UnknownError)
                {
                    MIIMServiceLog(MethodBase.GetCurrentMethod().Name, requestData, ConstantTexts.MIIMUserAuthFail, _currentLoginUserId, TarceMethodLkup.Completed.ToLong(), (long)MIIMServiceMethod.CreateRPRCase);
                    ViewBag.ErrorMessage = "\nYou are not part of ERS DB.\nPlease contact administrator";
                    return(View("~/Views/Shared/Error.cshtml"));
                }
                else
                {
                    MIIMServiceLog(MethodBase.GetCurrentMethod().Name, requestData, ConstantTexts.MIIMUserAuthFail, _currentLoginUserId, TarceMethodLkup.Completed.ToLong(), (long)MIIMServiceMethod.CreateRPRCase);
                    ViewBag.ErrorMessage = "\nYou do not have permission to access this page.\nPlease contact administrator";
                    return(View("~/Views/Shared/Error.cshtml"));
                }
            }
            catch (Exception ex)
            {
                MIIMServiceLog(MethodBase.GetCurrentMethod().Name, "", ex.ToString(), _currentLoginUserId, TarceMethodLkup.Failed.ToLong(), (long)MIIMServiceMethod.CreateRPRCase);
                BLCommon.LogError(_currentLoginUserId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.MIIMConnector, (long)ExceptionTypes.Uncategorized, ex.ToString(), ex.Message);
                return(View("~/Views/Shared/Error.cshtml"));
            }
        }
Ejemplo n.º 5
0
 private List <DOCMN_LookupMasterCorrelations> GetDiscrepancyCategories()
 {
     try
     {
         List <DOCMN_LookupMasterCorrelations> lstDOCMN_LookupMasterCorrelations = CacheUtility.GetAllLookupMasterCorrelationFromCache(
             (long)LookupTypesCorrelation.WorkBasketVsDiscripancyCategory, null);
         return(lstDOCMN_LookupMasterCorrelations);
     }
     catch (Exception ex)
     {
         BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.ManageSkills, (long)ExceptionTypes.Uncategorized, ex.ToString(), ex.ToString());
         return(null);
     }
 }
Ejemplo n.º 6
0
        public ActionResult AddWorkQueuesToSession(DOADM_SkillWorkQueuesCorrelation objDOADM_SkillWorkQueuesCorrelation, long lDiscrepancyCatLkup = 0, long lPreviousWorkQueue = 0, int mode = 0)
        {
            long?TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
            List <DOADM_SkillWorkQueuesCorrelation> lstDOADM_SkillWorkQueuesCorrelation = new List <DOADM_SkillWorkQueuesCorrelation>();

            try
            {
                if (Session[ConstantTexts.SkillWorkQueueSessionKey] != null)
                {
                    lstDOADM_SkillWorkQueuesCorrelation = Session[ConstantTexts.SkillWorkQueueSessionKey] as List <DOADM_SkillWorkQueuesCorrelation>;
                }
                switch (mode)
                {
                case 0:    //Add new WQ to the list
                    if (lstDOADM_SkillWorkQueuesCorrelation.Where(xx => xx.WorkQueuesLkup == objDOADM_SkillWorkQueuesCorrelation.WorkQueuesLkup).Count() == 0)
                    {
                        objDOADM_SkillWorkQueuesCorrelation.IsActive          = true;
                        objDOADM_SkillWorkQueuesCorrelation.CreatedByRef      = currentUser.ADM_UserMasterId;
                        objDOADM_SkillWorkQueuesCorrelation.CreatedByName     = currentUser.FullName;
                        objDOADM_SkillWorkQueuesCorrelation.UTCCreatedOn      = ZoneLookupUI.ConvertToTimeZone(DateTime.UtcNow, TimeZone);
                        objDOADM_SkillWorkQueuesCorrelation.LastUpdatedByRef  = currentUser.ADM_UserMasterId;
                        objDOADM_SkillWorkQueuesCorrelation.LastUpdatedByName = currentUser.FullName;
                        objDOADM_SkillWorkQueuesCorrelation.UTCLastUpdatedOn  = ZoneLookupUI.ConvertToTimeZone(DateTime.UtcNow, TimeZone);
                        lstDOADM_SkillWorkQueuesCorrelation.Add(objDOADM_SkillWorkQueuesCorrelation);
                    }
                    else
                    {
                        objDOADM_SkillWorkQueuesCorrelation                   = lstDOADM_SkillWorkQueuesCorrelation.Where(xx => xx.WorkQueuesLkup == objDOADM_SkillWorkQueuesCorrelation.WorkQueuesLkup).FirstOrDefault();
                        objDOADM_SkillWorkQueuesCorrelation.IsActive          = true;
                        objDOADM_SkillWorkQueuesCorrelation.LastUpdatedByRef  = currentUser.ADM_UserMasterId;
                        objDOADM_SkillWorkQueuesCorrelation.LastUpdatedByName = currentUser.FullName;
                        objDOADM_SkillWorkQueuesCorrelation.UTCLastUpdatedOn  = ZoneLookupUI.ConvertToTimeZone(DateTime.UtcNow, TimeZone);
                    }
                    break;

                case 1:    //delete work queue from added list
                    if (lstDOADM_SkillWorkQueuesCorrelation.Where(xx => xx.WorkQueuesLkup == objDOADM_SkillWorkQueuesCorrelation.WorkQueuesLkup).Count() > 0)
                    {
                        objDOADM_SkillWorkQueuesCorrelation = lstDOADM_SkillWorkQueuesCorrelation.Where(xx => xx.WorkQueuesLkup == objDOADM_SkillWorkQueuesCorrelation.WorkQueuesLkup).FirstOrDefault();
                        objDOADM_SkillWorkQueuesCorrelation.LastUpdatedByRef  = currentUser.ADM_UserMasterId;
                        objDOADM_SkillWorkQueuesCorrelation.LastUpdatedByName = currentUser.FullName;
                        objDOADM_SkillWorkQueuesCorrelation.UTCLastUpdatedOn  = ZoneLookupUI.ConvertToTimeZone(DateTime.UtcNow, TimeZone);
                        objDOADM_SkillWorkQueuesCorrelation.IsActive          = false;
                    }
                    break;

                case 2:    //update existing work Queue
                    long NewWorkQueuesLkup = objDOADM_SkillWorkQueuesCorrelation.WorkQueuesLkup;
                    objDOADM_SkillWorkQueuesCorrelation = lstDOADM_SkillWorkQueuesCorrelation.Where(x => x.WorkQueuesLkup == lPreviousWorkQueue).FirstOrDefault();
                    if (objDOADM_SkillWorkQueuesCorrelation.ADM_SkillsMasterRef == 0)   //updating a queue for new record
                    {
                        objDOADM_SkillWorkQueuesCorrelation.CreatedByName = currentUser.FullName;
                        objDOADM_SkillWorkQueuesCorrelation.CreatedByRef  = currentUser.ADM_UserMasterId;
                    }
                    objDOADM_SkillWorkQueuesCorrelation.LastUpdatedByName = currentUser.FullName;
                    objDOADM_SkillWorkQueuesCorrelation.LastUpdatedByRef  = currentUser.ADM_UserMasterId;
                    objDOADM_SkillWorkQueuesCorrelation.UTCLastUpdatedOn  = ZoneLookupUI.ConvertToTimeZone(DateTime.UtcNow, TimeZone);
                    objDOADM_SkillWorkQueuesCorrelation.IsActive          = true;
                    objDOADM_SkillWorkQueuesCorrelation.WorkQueuesLkup    = NewWorkQueuesLkup;
                    break;

                case 3:    //removing all queues from session
                    foreach (var item in lstDOADM_SkillWorkQueuesCorrelation)
                    {
                        item.LastUpdatedByName = currentUser.FullName;
                        item.LastUpdatedByRef  = currentUser.ADM_UserMasterId;
                        item.UTCLastUpdatedOn  = ZoneLookupUI.ConvertToTimeZone(DateTime.UtcNow, TimeZone);
                        item.IsActive          = false;
                    }
                    break;
                }

                List <DOCMN_LookupMasterCorrelations> lstDOCMN_LookupMaster = CacheUtility.GetAllLookupMasterCorrelationFromCache((long)LookupTypesCorrelation.DiscripancyCategoryVQueue, lDiscrepancyCatLkup);
                lstDOCMN_LookupMaster = lstDOCMN_LookupMaster.Where(x => x.CMN_LookupMasterParentRef == lDiscrepancyCatLkup).ToList();
                ViewBag.WorkQueues    = lstDOCMN_LookupMaster;

                Session[ConstantTexts.SkillWorkQueueSessionKey] = lstDOADM_SkillWorkQueuesCorrelation;
                return(PartialView("_WorkQueue", lstDOADM_SkillWorkQueuesCorrelation.Where(xx => xx.IsActive == true).ToList()));
            }
            catch (Exception ex)
            {
                BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.ManageSkills, (long)ExceptionTypes.Uncategorized, ex.ToString(), ex.ToString());
                return(RedirectToAction("Maintenance", "Error", routeValues: ex.ToString()));
            }
        }