示例#1
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()));
            }
        }
        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;
            }
        }
示例#3
0
 public ActionResult Search()
 {
     try
     {
         string   strErrorMessage = string.Empty;
         BLSkills _objBLSkills    = new BLSkills();
         DOADM_SkillMasterExtended objDOADM_SkillMasterExtended = new DOADM_SkillMasterExtended();
         objDOADM_SkillMasterExtended.lstRoles           = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Role);
         objDOADM_SkillMasterExtended.lstBusinessSegment = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.BusinessSegment);
         objDOADM_SkillMasterExtended.lstDepartment      = GetERSDepartments();
         objDOADM_SkillMasterExtended.lstWorkBasket      = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.WorkBasket);
         List <DOADM_SkillsMaster> lstDOADM_SkillsMaster = new List <DOADM_SkillsMaster>();
         DOADM_SkillsMaster        objDOADM_SkillsMaster = new DOADM_SkillsMaster();
         objDOADM_SkillsMaster.IsActive = true;
         long?          TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
         ExceptionTypes result   = _objBLSkills.SearchSkills(TimeZone, objDOADM_SkillsMaster, out lstDOADM_SkillsMaster, out strErrorMessage);
         objDOADM_SkillMasterExtended.lstSkillsMaster = lstDOADM_SkillsMaster;
         return(View(objDOADM_SkillMasterExtended));
     }
     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()));
     }
 }
示例#4
0
        public ActionResult ValidateLookupMaster(long lookupTypeId, long lookupMasterID = 0, string lookupMasterValue = "", int priority = 0)
        {
            try
            {
                CacheUtility.ClearCache(ConstantTexts.LookupMasterCacheKey);
                List <DOCMN_LookupMaster> lstDOCMN_LookupMaster = new List <DOCMN_LookupMaster>();
                lstDOCMN_LookupMaster = CacheUtility.GetAllLookupsFromCache(lookupTypeId);


                if (lstDOCMN_LookupMaster.Where(xx => xx.LookupValue.ToUpper() == lookupMasterValue.ToUpper() && xx.CMN_LookupMasterId != lookupMasterID).Count() > 0)
                {
                    return(Json(new { ID = 1, Message = "Lookup value already exists." }));
                }

                else if (lstDOCMN_LookupMaster.Where(xx => xx.DisplayOrder == priority && xx.CMN_LookupMasterId != lookupMasterID).Count() > 0)
                {
                    return(Json(new { ID = 1, Message = "Priority value already exists." }));
                }

                return(Json(new { ID = 0, Message = "" }));
            }
            catch (Exception ex)
            {
                BLCommon.LogError(0, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Lookups, (long)ExceptionTypes.Uncategorized, string.Empty, ex.ToString());
                return(Json(new { ID = 1, Message = "An error occured while validating" }));
            }
        }
        public ActionResult UserAccess()
        {
            ENRLReconSystem.DO.UIUserLogin loggedInUser = System.Web.HttpContext.Current.Session[ENRLReconSystem.Utility.ConstantTexts.CurrentUserSessionKey] as ENRLReconSystem.DO.UIUserLogin;
            ViewBag.userRole   = ((ENRLReconSystem.Utility.RoleLkup)loggedInUser.RoleLkup).ToString();
            ViewBag.workBasket = ((ENRLReconSystem.Utility.WorkBasket)loggedInUser.WorkBasketLkup).ToString();

            ViewBag.businessSegment = CacheUtility.GetAllLookupsFromCache((long)ENRLReconSystem.Utility.LookupTypes.BusinessSegment).Where(x => x.CMN_LookupMasterId.Equals(@loggedInUser.BusinessSegmentLkup)).FirstOrDefault().LookupValue;

            string strAccessGroups = string.Empty;

            if (loggedInUser.UserAccessGroup != null && loggedInUser.UserAccessGroup.Count > 0)
            {
                foreach (var item in loggedInUser.UserAccessGroup.Where(x => x.RoleLkup == loggedInUser.RoleLkup && x.WorkBasketLkup == loggedInUser.WorkBasketLkup).ToList())
                {
                    if (strAccessGroups.Length == 0)
                    {
                        strAccessGroups = item.AccessGroupName;
                    }
                    else
                    {
                        strAccessGroups = strAccessGroups + "," + item.AccessGroupName;
                    }
                }
            }
            ViewBag.strAccessGroups = strAccessGroups;
            return(PartialView("_UserAccess"));
        }
        public ActionResult Add(long UserId = 0, bool IsActive = true)
        {
            string errorMessage = string.Empty;

            Session[ConstantTexts.UserAccessGroupSessionKey] = null;
            try
            {
                DOADM_UserMaster     objDOADM_UserMaster     = new DOADM_UserMaster();
                BLUserAdministration objBLUserAdministration = new BLUserAdministration();
                objDOADM_UserMaster.IsManager = false;//set value since it is nullable
                objDOADM_UserMaster.StartDate = DateTime.UtcNow;
                objDOADM_UserMaster.EndDate   = DateTime.UtcNow.AddYears(10);
                objDOADM_UserMaster.IsActive  = true;
                long?TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;

                if (UserId != 0)
                {
                    List <DOADM_UserMaster> lstDOADM_UserMaster = new List <DOADM_UserMaster>();
                    objDOADM_UserMaster.ADM_UserMasterId = UserId;
                    objDOADM_UserMaster.IsActive         = IsActive;
                    objBLUserAdministration.SearchUser(TimeZone, objDOADM_UserMaster, out lstDOADM_UserMaster, out errorMessage);
                    if (lstDOADM_UserMaster.Count > 0)
                    {
                        objDOADM_UserMaster = lstDOADM_UserMaster.FirstOrDefault();
                        Session[ConstantTexts.UserAccessGroupSessionKey] = objDOADM_UserMaster.lstDOADM_AccessGroupUserCorrelation;
                    }
                }

                DOADM_UserMaster objManagerSearch = new DOADM_UserMaster()
                {
                    IsActive  = true,
                    IsManager = true
                };

                ExceptionTypes result = objBLUserAdministration.SearchUser(TimeZone, objManagerSearch, out List <DOADM_UserMaster> lstManagers, out errorMessage);

                objDOADM_UserMaster.lstManagers = lstManagers.OrderBy(x => x.FullName).ToList();
                if (UserId != 0)
                {
                    objDOADM_UserMaster.lstManagers.RemoveAll(x => x.ADM_UserMasterId == UserId);
                }

                objDOADM_UserMaster.lstLocation   = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Location);
                objDOADM_UserMaster.lstTimeZone   = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Timezone);
                objDOADM_UserMaster.lstState      = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.State);
                objDOADM_UserMaster.lstSalutation = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Salutation);
                ViewBag.AccessGroups = GetAllAccessGroups();

                return(View(objDOADM_UserMaster));
            }
            catch (Exception ex)
            {
                BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.ManageUsers, (long)ExceptionTypes.Uncategorized, string.Empty, ex.ToString());
                return(RedirectToAction("Maintenance", "Error", new { Error = MethodBase.GetCurrentMethod().Name + " Action terminated and redirected to Maintenance. Error:" + ex.ToString() }));
            }
        }
示例#7
0
        public ActionResult Add(long ResourceId = 0, bool isActive = true)
        {
            long?TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
            DOADM_ResourceDetails objDOADM_ResourceDetails = new DOADM_ResourceDetails();

            objDOADM_ResourceDetails.IsActive = true;
            string errorMessage = string.Empty;

            try
            {
                ExceptionTypes result;
                //get list of Depatments for Department drop down
                List <DOCMN_Department> lstCMN_Department;
                BLDepartment            objBLDepartment     = new BLDepartment();
                DOCMN_Department        objDOCMN_Department = new DOCMN_Department();
                objDOCMN_Department.IsActive = true;
                result = objBLDepartment.SearchDepartment(TimeZone, objDOCMN_Department, out lstCMN_Department, out errorMessage);
                //check result for DB action
                if (result != (long)ExceptionTypes.Success)
                {
                    BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Resources, (long)ExceptionTypes.Uncategorized, errorMessage, errorMessage);
                }
                //sort list by Depatment name
                lstCMN_Department = lstCMN_Department.OrderBy(x => x.ERSDepartmentName).ToList();

                if (ResourceId != 0)
                {
                    //temporary list to hold search Resource results
                    List <DOADM_ResourceDetails> lstDOADM_ResourceDetails = new List <DOADM_ResourceDetails>();
                    //temporary object for search resources function
                    DOADM_ResourceDetails objDOADM_ResourceDetails_Find = new DOADM_ResourceDetails();
                    objDOADM_ResourceDetails_Find.ADM_ResourceDetailsId = ResourceId;
                    objDOADM_ResourceDetails_Find.IsActive = isActive;
                    result = _objBLResources.SearchResources(TimeZone, objDOADM_ResourceDetails_Find, out lstDOADM_ResourceDetails, out errorMessage);
                    //check result for DB action
                    if (result != (long)ExceptionTypes.Success)
                    {
                        BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Resources, (long)ExceptionTypes.Uncategorized, errorMessage, errorMessage);
                    }
                    if (lstDOADM_ResourceDetails.Count > 0)
                    {
                        objDOADM_ResourceDetails = lstDOADM_ResourceDetails.FirstOrDefault();
                    }
                }
                //Alert Time Zone lookup from Cache
                objDOADM_ResourceDetails.lstTimeZone       = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Timezone);
                objDOADM_ResourceDetails.lstCMN_Department = lstCMN_Department;
                return(View(objDOADM_ResourceDetails));
            }
            catch (Exception ex)
            {
                BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Resources, (long)ExceptionTypes.Uncategorized, ex.ToString(), ex.ToString());
                return(RedirectToAction("Maintenance", "Error", ex.ToString()));
            }
        }
示例#8
0
        private DO.UIUserLogin LoadDataForLogin(DO.UIUserLogin objUIUserLogin)
        {
            try
            {
                if (objUIUserLogin.UserSkills != null && objUIUserLogin.UserSkills.Count > 0)
                {
                    List <DOCMN_LookupMaster> lstAllDOCMN_LookupMaster = CacheUtility.GetAllLookupsFromCache(null);
                    List <DOCMN_LookupMaster> lstDOCMN_LookupMaster;


                    List <UserSkills> Correlations = objUIUserLogin.UserSkills.GroupBy(x => new { x.BusinessSegmentLkup, x.WorkBasketLkup, x.RoleLkup }).Select(x => x.First()).ToList();
                    objUIUserLogin.Correlations = Correlations;

                    lstDOCMN_LookupMaster = new List <DOCMN_LookupMaster>();
                    //Business Segment
                    Correlations.Select(x => x.BusinessSegmentLkup).Distinct().ToList().ForEach(BusinessSegmentId =>
                    {
                        if (BusinessSegmentId > 0)
                        {
                            lstDOCMN_LookupMaster.Add(lstAllDOCMN_LookupMaster.Where(x => x.CMN_LookupMasterId.Equals(BusinessSegmentId)).FirstOrDefault());
                        }
                    });
                    //Work Basket
                    Correlations.Select(x => x.WorkBasketLkup).Distinct().ToList().ForEach(WorkBasketId =>
                    {
                        if (WorkBasketId > 0)
                        {
                            lstDOCMN_LookupMaster.Add(lstAllDOCMN_LookupMaster.Where(x => x.CMN_LookupMasterId.Equals(WorkBasketId)).FirstOrDefault());
                        }
                    });
                    //Role
                    Correlations.Select(x => x.RoleLkup).Distinct().ToList().ForEach(RoleId =>
                    {
                        if (RoleId > 0)
                        {
                            lstDOCMN_LookupMaster.Add(lstAllDOCMN_LookupMaster.Where(x => x.CMN_LookupMasterId.Equals(RoleId)).FirstOrDefault());
                        }
                    });
                    objUIUserLogin.LookUps = lstDOCMN_LookupMaster;
                }
                if (objUIUserLogin.ADM_UserPreference != null)
                {
                    objUIUserLogin.BusinessSegmentLkup = objUIUserLogin.ADM_UserPreference.BusinessSegmentLkup;
                    objUIUserLogin.WorkBasketLkup      = objUIUserLogin.ADM_UserPreference.WorkBasketLkup;
                    objUIUserLogin.RoleLkup            = objUIUserLogin.ADM_UserPreference.RoleLkup;
                }
            }
            catch (Exception ex)
            {
                BLCommon.LogError(0, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Login, (long)ExceptionTypes.Uncategorized, string.Empty, ex.ToString());
            }
            return(objUIUserLogin);
        }
示例#9
0
        public ActionResult Add(long DepId = 0, bool isActive = true)
        {
            long?TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
            // Bind Dropdown List for Business Segment and Department.
            string errorMessage = string.Empty;
            List <DOCMN_LookupMaster> lstBusinessSegment;
            List <DOCMN_LookupMaster> lstDepartment;
            List <DOCMN_LookupMaster> lstTimezone;
            BLDepartment            objBLDepartment     = new BLDepartment();
            List <DOCMN_Department> lstDOCMN_Department = new List <DOCMN_Department>();
            DOCMN_Department        objDOCMN_Department = new DOCMN_Department();

            lstBusinessSegment = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.BusinessSegment);

            lstDepartment = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Department);

            lstTimezone = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Timezone);
            objDOCMN_Department.IsActive = true;
            if (DepId != 0)
            {
                // Fetch Record By Department ID.
                objDOCMN_Department.CMN_DepartmentId = DepId;
                objDOCMN_Department.IsActive         = isActive;
                ExceptionTypes result = objBLDepartment.SearchDepartmentById(TimeZone, objDOCMN_Department, out lstDOCMN_Department, out errorMessage);
                if (result != (long)ExceptionTypes.Success)
                {
                    //Log Error
                    BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Department, (long)ExceptionTypes.Uncategorized, errorMessage.ToString(), errorMessage.ToString());
                }
                if (lstDOCMN_Department.Count > 0)
                {
                    objDOCMN_Department = lstDOCMN_Department.FirstOrDefault();
                }
            }
            else
            {
                objDOCMN_Department.EffectiveDate = DateTime.UtcNow;
            }
            objDOCMN_Department.lstBusinessSegment = lstBusinessSegment;
            objDOCMN_Department.lstCMN_Department  = lstDepartment;
            objDOCMN_Department.lstTimeZone        = lstTimezone;

            return(View("Add", objDOCMN_Department));
        }
示例#10
0
        public ActionResult Add(long ADM_AccessGroupMasterId = 0, bool isActive = true)
        {
            try
            {
                long?TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
                Session[ConstantTexts.AccessGroupSkillSessionKey]  = null;
                Session[ConstantTexts.AccessGroupReportSessionKey] = null;
                ViewBag.RoleList       = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Role);
                ViewBag.WorkBasketList = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.WorkBasket);
                ViewBag.Reports        = ViewBag.Reports = CacheUtility.GetAllReportsFromCache(null, "");
                UIDOAccessGroup objUIDOAccessGroup = new UIDOAccessGroup();
                objUIDOAccessGroup.IsActive = true;
                objUIDOAccessGroup.lstDOADM_AccessGroupSkillsCorrelation = new List <DOADM_AccessGroupSkillsCorrelation>();
                objUIDOAccessGroup.lstDOADM_AccessGroupReportCorrelation = new List <DOADM_AccessGroupReportCorrelation>();

                if (ADM_AccessGroupMasterId != 0)
                {
                    DOADM_AccessGroupMaster objDOADM_AccessGroupMaster = new DOADM_AccessGroupMaster();
                    BLAccessGroup           objBLAccessGroup           = new BLAccessGroup();

                    objDOADM_AccessGroupMaster.ADM_AccessGroupMasterId = ADM_AccessGroupMasterId;
                    objDOADM_AccessGroupMaster.IsActive = isActive;
                    ExceptionTypes result = objBLAccessGroup.GetAccessGroupForEdit(objDOADM_AccessGroupMaster, out objUIDOAccessGroup);
                    Session[ConstantTexts.AccessGroupSkillSessionKey]  = objUIDOAccessGroup.lstDOADM_AccessGroupSkillsCorrelation;
                    Session[ConstantTexts.AccessGroupReportSessionKey] = objUIDOAccessGroup.lstDOADM_AccessGroupReportCorrelation;

                    DOADM_SkillsMaster        objDOADM_SkillsMaster = new DOADM_SkillsMaster();
                    List <DOADM_SkillsMaster> lstDOADM_SkillsMaster = new List <DOADM_SkillsMaster>();
                    BLSkills objBLSkills = new BLSkills();
                    objDOADM_SkillsMaster.IsActive       = true;
                    objDOADM_SkillsMaster.WorkBasketLkup = objUIDOAccessGroup.WorkBasketLkup;
                    objDOADM_SkillsMaster.RoleLkup       = objUIDOAccessGroup.RoleLkup;

                    ExceptionTypes result1 = objBLSkills.SearchSkills(TimeZone, objDOADM_SkillsMaster, out lstDOADM_SkillsMaster, out string errorMesssage);
                    ViewBag.Skills = lstDOADM_SkillsMaster.Where(x => x.IsActive == true).ToList();
                }
                return(View(objUIDOAccessGroup));
            }
            catch (Exception ex)
            {
                BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.ManageAccessGroups, (long)ExceptionTypes.Uncategorized, string.Empty, ex.ToString());
                return(RedirectToAction("Maintenance", "Error", new { Error = MethodBase.GetCurrentMethod().Name + " Action terminated and redirected to Maintenance. Error:" + ex.ToString() }));
            }
        }
示例#11
0
        public ActionResult Search(string SkillsName = "", long RoleLkup = 0, long BusinessSegmentLkup = 0, long CMN_DepartmentRef = 0, long WorkBasketLkup = 0, bool isActive = true)
        {
            try
            {
                BLSkills                  _objBLSkills          = new BLSkills();
                DOADM_SkillsMaster        objDOADM_SkillsMaster = new DOADM_SkillsMaster();
                List <DOADM_SkillsMaster> lstDOADM_SkillsMaster;
                string errorMessage = string.Empty;

                objDOADM_SkillsMaster.IsActive            = isActive;
                objDOADM_SkillsMaster.SkillsName          = SkillsName;
                objDOADM_SkillsMaster.RoleLkup            = RoleLkup;
                objDOADM_SkillsMaster.BusinessSegmentLkup = BusinessSegmentLkup;
                objDOADM_SkillsMaster.CMN_DepartmentRef   = CMN_DepartmentRef;
                objDOADM_SkillsMaster.WorkBasketLkup      = WorkBasketLkup;
                long?          TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
                ExceptionTypes result   = _objBLSkills.SearchSkills(TimeZone, objDOADM_SkillsMaster, out lstDOADM_SkillsMaster, out errorMessage);
                if (result != (long)ExceptionTypes.Success)
                {
                    BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.ManageSkills, (long)ExceptionTypes.Uncategorized, "error while retriving search results", "error while retriving search results");
                }
                else if (result == ExceptionTypes.ZeroRecords)
                {
                    lstDOADM_SkillsMaster.Add(objDOADM_SkillsMaster);
                    lstDOADM_SkillsMaster = new List <DOADM_SkillsMaster>();
                }

                DOADM_SkillMasterExtended objDOADM_SkillMasterExtended = new DOADM_SkillMasterExtended();
                objDOADM_SkillMasterExtended.lstRoles           = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Role);
                objDOADM_SkillMasterExtended.lstBusinessSegment = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.BusinessSegment);
                objDOADM_SkillMasterExtended.lstDepartment      = GetERSDepartments();
                objDOADM_SkillMasterExtended.lstWorkBasket      = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.WorkBasket);
                objDOADM_SkillMasterExtended.lstSkillsMaster    = lstDOADM_SkillsMaster;
                return(PartialView("_SearchResults", objDOADM_SkillMasterExtended));
            }
            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()));
            }
        }
示例#12
0
        public ActionResult Add(long ConfigId = 0, bool isActive = true)
        {
            long?TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
            // Bind Dropdown List.
            string errorMessage = string.Empty;

            List <DOCMN_LookupMaster> lstTimezone;

            lstTimezone = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Timezone);
            BLConfigurations          objBLConfigurations   = new BLConfigurations();
            List <DOMGR_ConfigMaster> lstDOMGR_ConfigMaster = new List <DOMGR_ConfigMaster>();
            DOMGR_ConfigMaster        objDOMGR_ConfigMaster = new DOMGR_ConfigMaster();

            objDOMGR_ConfigMaster.IsActive = true;
            if (ConfigId != 0)
            {
                // Fetch Record By Configuration ID.
                objDOMGR_ConfigMaster.MGR_ConfigMasterId = ConfigId;
                objDOMGR_ConfigMaster.IsActive           = isActive;
                ExceptionTypes result = objBLConfigurations.SearchConfigId(TimeZone, objDOMGR_ConfigMaster, out lstDOMGR_ConfigMaster, out errorMessage);
                if (result != (long)ExceptionTypes.Success)
                {
                    //Log Error
                    BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Configurations, (long)ExceptionTypes.Uncategorized, errorMessage.ToString(), errorMessage.ToString());
                }
                if (lstDOMGR_ConfigMaster.Count > 0)
                {
                    objDOMGR_ConfigMaster = lstDOMGR_ConfigMaster.FirstOrDefault();
                }
            }
            else
            {
                objDOMGR_ConfigMaster.StartDate = DateTime.UtcNow;
            }
            objDOMGR_ConfigMaster.lstTimeZone = lstTimezone;
            return(View("Add", objDOMGR_ConfigMaster));
        }
示例#13
0
        //Custom Dropdown binds data according to lookup type
        public static MvcHtmlString CustomDropDownListFor <TModel, TValue>(this HtmlHelper <TModel> helper, Expression <Func <TModel, TValue> > expression,
                                                                           long lookUpTypeId, string optionalLabel, object htmlAttributes = null, bool IsVerificationState = false)
        {
            try
            {
                IEnumerable <SelectListItem> selectList = null;
                List <DOCMN_LookupMaster>    lstLookups = null;

                lstLookups = CacheUtility.GetAllLookupsFromCache(lookUpTypeId);
                selectList = (IEnumerable <SelectListItem>) new SelectList(lstLookups, "CMN_LookupMasterId", "LookupValue");
                if (htmlAttributes != null && htmlAttributes is RouteValueDictionary)
                {
                    RouteValueDictionary htmlAttr = htmlAttributes as RouteValueDictionary;
                    if (!string.IsNullOrEmpty(optionalLabel))
                    {
                        return(helper.DropDownListFor(expression, selectList, optionalLabel, htmlAttr));
                    }
                    else
                    {
                        return(helper.DropDownListFor(expression, selectList, htmlAttr));
                    }
                }
                if (!string.IsNullOrEmpty(optionalLabel))
                {
                    return(helper.DropDownListFor(expression, selectList, optionalLabel, htmlAttributes));
                }
                else
                {
                    return(helper.DropDownListFor(expression, selectList, htmlAttributes));
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
 /// <summary>
 /// To load all drop down values.
 /// </summary>
 private void LoadCommonData()
 {
     ViewBag.Correlations = currentUser.Correlations;
     ViewBag.LookUps      = currentUser.LookUps;
     ViewBag.TimeZoneList = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Timezone);
 }
        private DOCMN_LookupMasterCorrelationsExtended PGetCorrelationMasterByID(long lkupCorelationTypeID, long lkupCorelationMasterID)
        {
            DOCMN_LookupMasterCorrelationsExtended objDOCMN_LookupMasterCorrelationsExtended = new DOCMN_LookupMasterCorrelationsExtended();
            string errorMessage = string.Empty;

            try
            {
                ExceptionTypes result = _objBLLookupCorrelations.GetCorrelationMasterByID(lkupCorelationTypeID, lkupCorelationMasterID, out objDOCMN_LookupMasterCorrelationsExtended, out errorMessage);
                objDOCMN_LookupMasterCorrelationsExtended.lstDOCMN_LookupMasterParent = CacheUtility.GetAllLookupsFromCache(objDOCMN_LookupMasterCorrelationsExtended.objDOCMN_LookupTypeCorrelations.CMN_LookupTypeParentRef);
                objDOCMN_LookupMasterCorrelationsExtended.lstDOCMN_LookupMasterChild  = CacheUtility.GetAllLookupsFromCache(objDOCMN_LookupMasterCorrelationsExtended.objDOCMN_LookupTypeCorrelations.CMN_LookupTypeChildRef);
                if (result != (long)ExceptionTypes.Success)
                {
                    BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.LookupsCorrelation, (long)ExceptionTypes.Uncategorized, errorMessage, errorMessage);
                }


                return(objDOCMN_LookupMasterCorrelationsExtended);
            }
            catch (Exception ex)
            {
                BLCommon.LogError(0, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.LookupsCorrelation, (long)ExceptionTypes.Uncategorized, string.Empty, ex.ToString());
                throw ex;
            }
        }
示例#16
0
        public ActionResult Add(long AlertId = 0, bool isActive = true)
        {
            DOADM_AlertDetails objDOADM_AlertDetails = new DOADM_AlertDetails();

            objDOADM_AlertDetails.IsActive = true;
            string errorMessage = string.Empty;

            try
            {
                ExceptionTypes result;

                //get list of users for Send ALert to Indiviual drop down
                List <DOADM_UserMaster> lstUsers;
                BLUserAdministration    objBLUserAdministration = new BLUserAdministration();
                DOADM_UserMaster        objDOADM_UserMaster     = new DOADM_UserMaster();
                objDOADM_UserMaster.IsActive = true;
                long?TimeZone = currentUser.ADM_UserPreference.TimezoneLkup != null ? currentUser.ADM_UserPreference.TimezoneLkup : (long)DefaultTimeZone.CentralStandardTime;
                result = objBLUserAdministration.SearchUser(TimeZone, objDOADM_UserMaster, out lstUsers, out errorMessage);
                //check result for DB action
                if (result != (long)ExceptionTypes.Success)
                {
                    BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Alerts, (long)ExceptionTypes.Uncategorized, errorMessage, errorMessage);
                }
                //Filtered 1st three Users as Admin.sort list by email id
                lstUsers = lstUsers.Where(x => x.ADM_UserMasterId > 1000).OrderBy(x => x.Email).ToList();

                //get list of Depatments for Send ALert to Department drop down
                List <DOCMN_Department> lstCMN_Department;
                BLDepartment            objBLDepartment     = new BLDepartment();
                DOCMN_Department        objDOCMN_Department = new DOCMN_Department();
                objDOCMN_Department.IsActive = true;
                result = objBLDepartment.SearchDepartment(TimeZone, objDOCMN_Department, out lstCMN_Department, out errorMessage);
                //check result for DB action
                if (result != (long)ExceptionTypes.Success)
                {
                    BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Alerts, (long)ExceptionTypes.Uncategorized, errorMessage, errorMessage);
                }
                //sort list by Depatment name
                lstCMN_Department = lstCMN_Department.OrderBy(x => x.ERSDepartmentName).ToList();

                if (AlertId != 0)
                {
                    //temporary list to hold search alerts results
                    List <DOADM_AlertDetails> lstDOADM_AlertDetails = new List <DOADM_AlertDetails>();
                    //temporary object for search alerts function
                    DOADM_AlertDetails objDOADM_AlertDetails_Find = new DOADM_AlertDetails();
                    objDOADM_AlertDetails_Find.ADM_AlertDetailsId = AlertId;
                    objDOADM_AlertDetails_Find.IsActive           = isActive;
                    result = _objBLAlerts.SearchAlerts(TimeZone, objDOADM_AlertDetails_Find, out lstDOADM_AlertDetails, out errorMessage);
                    //check result for DB action
                    if (result != (long)ExceptionTypes.Success)
                    {
                        BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Alerts, (long)ExceptionTypes.Uncategorized, errorMessage, errorMessage);
                    }
                    if (lstDOADM_AlertDetails.Count > 0)
                    {
                        objDOADM_AlertDetails = lstDOADM_AlertDetails.FirstOrDefault();
                    }
                }

                objDOADM_AlertDetails.lstUsers          = lstUsers;
                objDOADM_AlertDetails.lstCMN_Department = lstCMN_Department;
                //Alert criticality lookup from Cache
                objDOADM_AlertDetails.lstAlertCriticalityLkup = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.AlertCriticality);
                //Send Alert To lookup from Cache
                objDOADM_AlertDetails.lstSendAlertToLkup = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.SendAlertTo);
                //Alert Time Zone lookup from Cache
                objDOADM_AlertDetails.lstTimeZone = CacheUtility.GetAllLookupsFromCache((long)LookupTypes.Timezone);
                return(View(objDOADM_AlertDetails));
            }
            catch (Exception ex)
            {
                BLCommon.LogError(currentUser.ADM_UserMasterId, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.Alerts, (long)ExceptionTypes.Uncategorized, ex.ToString(), ex.ToString());
                return(RedirectToAction("Maintenance", "Error", new { Error = ex.ToString() }));
            }
        }
        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"));
            }
        }