public JsonResult GetCompanyVendorType(string companyId, string type) { logMessage = new StringBuilder(); objComapnyDashBoard = new Models.CompanyDashBoard(); try { objDecisionPointEngine = new DecisionPointEngine(); objConfigurationSettingDetail = new ConfigurationSettingDetail(); if (!string.IsNullOrEmpty(Convert.ToString(Session["UserId"], CultureInfo.InvariantCulture))) { logMessage.AppendLine(string.Format(CultureInfo.InvariantCulture, DecisionPointR.logmessagestart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); objConfigurationSettingDetail.CompanyVendorTypeDetails = objDecisionPointEngine.GetCompanyVendorType(companyId, type).Where(x => x.IsUserBased == false); } else { objConfigurationSettingDetail.CompanyVendorTypeDetails = null; objactionresult = RedirectToAction("Login", "Login"); } } catch (Exception ex) { log.ErrorFormat(DecisionPointR.logmessageerror, ex.ToString(), typeof(LoginController).Name, MethodBase.GetCurrentMethod().Name); } finally { logMessage.AppendLine(string.Format(CultureInfo.InvariantCulture, DecisionPointR.logmessagend, MethodBase.GetCurrentMethod().Name)); log.Info(logMessage.ToString()); } return(Json(objConfigurationSettingDetail.CompanyVendorTypeDetails, JsonRequestBehavior.AllowGet)); }
public int SaveConfigSettings(ConfigurationSettingDetail objConfigurationSettingDetail) { int isInserted = 0; logMessage = new StringBuilder(); try { logMessage.AppendLine(string.Format(CultureInfo.InvariantCulture, DecisionPointR.logmessagestart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); if (!string.IsNullOrEmpty(Convert.ToString(Session["UserId"], CultureInfo.InvariantCulture))) { userId = Convert.ToInt32(HttpContext.Session["UserId"], CultureInfo.InvariantCulture); objDecisionPointEngine = new DecisionPointEngine(); objConfiguratonSettingRequest = new ConfiguratonSettingRequest() { #region Config Properties IsCoveragearea = objConfigurationSettingDetail.IsCoveragearea, IsClient = objConfigurationSettingDetail.IsClient, IsIc = objConfigurationSettingDetail.IsIc, IsServices = objConfigurationSettingDetail.IsServices, IsClientOnMyProfile = objConfigurationSettingDetail.IsClientOnMyProfile, IsVendor = objConfigurationSettingDetail.IsVendor, IsICFreeBasicMembership = objConfigurationSettingDetail.IsICFreeBasicMembership, IsWebinarApply = objConfigurationSettingDetail.IsWebinarApply, IsScormApply = objConfigurationSettingDetail.IsScormApply, IsICUsePackages = objConfigurationSettingDetail.IsICUsePackages, IsICInsApply = objConfigurationSettingDetail.IsICInsApply, IsICCommApply = objConfigurationSettingDetail.IsICCommApply, IsStaffCommApply = objConfigurationSettingDetail.IsStaffCommApply, IsStaffInsApply = objConfigurationSettingDetail.IsStaffInsApply, IsBgCheckForIC = objConfigurationSettingDetail.IsBgCheckForIC, IsLiceInsForIC = objConfigurationSettingDetail.IsICLicenseApply, IsAddCreForIC = objConfigurationSettingDetail.IsAddCreForIC, IsCoverageAreaForIC = objConfigurationSettingDetail.IsCoverageAreaForIC, IsServicesForIC = objConfigurationSettingDetail.IsAddCreForIC, IsICClientOnMyProfile = objConfigurationSettingDetail.IsICClientOnMyProfile, IsAddCreForStaff = objConfigurationSettingDetail.IsAddCreForStaff, IsBgCheckForStaff = objConfigurationSettingDetail.IsBgCheckForStaff, IsCoverageAreaForStaff = objConfigurationSettingDetail.IsCoverageAreaForStaff, IsServicesForStaff = objConfigurationSettingDetail.IsServicesForStaff, IsStaffClientOnMyProfile = objConfigurationSettingDetail.IsStaffClientOnMyProfile, IsLicenseForStaff = objConfigurationSettingDetail.IsLicenseForStaff, IsClientNameApplyForIC = objConfigurationSettingDetail.IsClientNameApplyForIC, IsContractApply = objConfigurationSettingDetail.IsContractApply, #endregion #region Other UserId = objConfigurationSettingDetail.UserId, CompanyId = objConfigurationSettingDetail.CompanyId, CreatedBy = userId #endregion }; isInserted = objDecisionPointEngine.SaveConfigSetting(objConfiguratonSettingRequest); } else { objactionresult = RedirectToAction("Login", "Login"); } } catch (Exception ex) { log.ErrorFormat(DecisionPointR.logmessageerror, ex.ToString(), typeof(LoginController).Name, MethodBase.GetCurrentMethod().Name); } finally { logMessage.AppendLine(string.Format(CultureInfo.InvariantCulture, DecisionPointR.logmessagend, MethodBase.GetCurrentMethod().Name)); log.Info(logMessage.ToString()); } return(isInserted); }
public ActionResult ConfigurationSetting(int userId, string companyId) { logMessage = new StringBuilder(); try { logMessage.AppendLine(string.Format(CultureInfo.InvariantCulture, DecisionPointR.logmessagestart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); objDecisionPointEngine = new DecisionPointEngine(); objConfigurationSettingDetail = new ConfigurationSettingDetail(); objConfigurationSettingDetail.UserId = userId; objConfigurationSettingDetail.CompanyId = companyId; //get config setting details objConfiguratonSettingRequest = new ConfiguratonSettingRequest(); objConfiguratonSettingRequest = objDecisionPointEngine.GetConfigSetting(companyId); if (!object.Equals(objConfiguratonSettingRequest, null)) { #region Config Properties objConfigurationSettingDetail.IsCoveragearea = objConfiguratonSettingRequest.IsCoveragearea; objConfigurationSettingDetail.IsClient = objConfiguratonSettingRequest.IsClient; objConfigurationSettingDetail.IsIc = objConfiguratonSettingRequest.IsIc; objConfigurationSettingDetail.IsServices = objConfiguratonSettingRequest.IsServices; objConfigurationSettingDetail.IsClientOnMyProfile = objConfiguratonSettingRequest.IsClientOnMyProfile; objConfigurationSettingDetail.IsVendor = objConfiguratonSettingRequest.IsVendor; objConfigurationSettingDetail.IsWebinarApply = objConfiguratonSettingRequest.IsWebinarApply; objConfigurationSettingDetail.IsScormApply = objConfiguratonSettingRequest.IsScormApply; objConfigurationSettingDetail.IsICFreeBasicMembership = objConfiguratonSettingRequest.IsICFreeBasicMembership; objConfigurationSettingDetail.IsICUsePackages = objConfiguratonSettingRequest.IsICUsePackages; objConfigurationSettingDetail.IsICInsApply = objConfiguratonSettingRequest.IsICInsApply; objConfigurationSettingDetail.IsStaffInsApply = objConfiguratonSettingRequest.IsStaffInsApply; objConfigurationSettingDetail.IsStaffCommApply = objConfiguratonSettingRequest.IsStaffCommApply; objConfigurationSettingDetail.IsICCommApply = objConfiguratonSettingRequest.IsICCommApply; objConfigurationSettingDetail.IsBgCheckForIC = objConfiguratonSettingRequest.IsBgCheckForIC; objConfigurationSettingDetail.IsICLicenseApply = objConfiguratonSettingRequest.IsLiceInsForIC; objConfigurationSettingDetail.IsAddCreForIC = objConfiguratonSettingRequest.IsAddCreForIC; objConfigurationSettingDetail.IsCoverageAreaForIC = objConfiguratonSettingRequest.IsCoverageAreaForIC; objConfigurationSettingDetail.IsServicesForIC = objConfiguratonSettingRequest.IsAddCreForIC; objConfigurationSettingDetail.IsICClientOnMyProfile = objConfiguratonSettingRequest.IsICClientOnMyProfile; objConfigurationSettingDetail.IsAddCreForStaff = objConfiguratonSettingRequest.IsAddCreForStaff; objConfigurationSettingDetail.IsBgCheckForStaff = objConfiguratonSettingRequest.IsBgCheckForStaff; objConfigurationSettingDetail.IsCoverageAreaForStaff = objConfiguratonSettingRequest.IsCoverageAreaForStaff; objConfigurationSettingDetail.IsServicesForStaff = objConfiguratonSettingRequest.IsServicesForStaff; objConfigurationSettingDetail.IsStaffClientOnMyProfile = objConfiguratonSettingRequest.IsStaffClientOnMyProfile; objConfigurationSettingDetail.IsLicenseForStaff = objConfiguratonSettingRequest.IsLicenseForStaff; objConfigurationSettingDetail.IsClientNameApplyForIC = objConfiguratonSettingRequest.IsClientNameApplyForIC; objConfigurationSettingDetail.IsContractApply = objConfiguratonSettingRequest.IsContractApply; #endregion } companyId = Convert.ToString(Session["CompanyId"], CultureInfo.InvariantCulture); objConfigurationSettingDetail.VendorTypeDetails = objDecisionPointEngine.GetVendorType(Shared.None, companyId).ToList(); //objConfigurationSettingDetail.CompanyVendorTypeDetails = objDecisionPointEngine.GetCompanyVendorType(companyId, string.Empty); ViewData.Model = objConfigurationSettingDetail; objactionresult = View(); } catch (Exception ex) { log.ErrorFormat(DecisionPointR.logmessageerror, ex.ToString(), typeof(LoginController).Name, MethodBase.GetCurrentMethod().Name); } finally { logMessage.AppendLine(string.Format(CultureInfo.InvariantCulture, DecisionPointR.logmessagend, MethodBase.GetCurrentMethod().Name)); log.Info(logMessage.ToString()); } return(objactionresult); }