public HapagHomeController(IConfigurationFacade configFacade, IWhereClauseFacade whereClauseFacade, I18NResolver i18Nresolver) { _configFacade = configFacade; _whereClauseFacade = whereClauseFacade; _i18Nresolver = i18Nresolver; BuildDict(); }
public HomeController(IConfigurationFacade facade, I18NResolver i18NResolver, ContextLookuper lookuper) { // _controllerFactory = (IAPIControllerFactory)GlobalConfiguration.Configuration.DependencyResolver.GetService(typeof(IAPIControllerFactory)); _facade = facade; _i18NResolver = i18NResolver; _lookuper = lookuper; }
public ActionResult ConfigurationList(ConfigureUrlSearchFilter searchFilter) { Logger.Info(_logMsg.Clear().SetPrefixMsg("Search Configuration").Add("SystemName", searchFilter.SystemName) .Add("Url", searchFilter.Url).Add("Status", searchFilter.Status)); try { if (ModelState.IsValid) { _commonFacade = new CommonFacade(); _configFacade = new ConfigurationFacade(); ConfigurationViewModel configVM = new ConfigurationViewModel(); configVM.SearchFilter = searchFilter; configVM.ConfigureUrlList = _configFacade.GetConfigureURL(searchFilter); ViewBag.PageSize = configVM.SearchFilter.PageSize; ViewBag.PageSizeList = _commonFacade.GetPageSizeList(); return(PartialView("~/Views/Configuration/_ConfigurationList.cshtml", configVM)); } return(Json(new { Valid = false, Error = string.Empty, Errors = GetModelValidationErrors() })); } catch (Exception ex) { Logger.Error("Exception occur:\n", ex); Logger.Info(_logMsg.Clear().SetPrefixMsg("Search Configuration").Add("Error Message", ex.Message).ToFailLogString()); return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString()))); } }
public string GetMessage() { if (ConfigurationFacade == null) { ConfigurationFacade = new Facade.ConfigurationFacade(); } var messageSource = ConfigurationFacade.GetMessageSource(); IMessageRepository messageRepository = null; switch (messageSource) { case Enums.MessageSources.AppSetting: messageRepository = new AppSettingMessageRepository(); break; case Enums.MessageSources.SQLServer: messageRepository = new SQLMessageRepository(); break; case Enums.MessageSources.Twitter: //ToDo break; case Enums.MessageSources.Facebook: //ToDo break; } var message = messageRepository.GetMessage(); LoggingHelper.LogRequest(messageSource.ToString(), message); return(message); }
public PersonGroupAssociationSyncManager(SWDBHibernateDAO dao, IConfigurationFacade facade, HlagLocationManager locationManager, PersonGroupSyncManager personGroupSyncManager, HapagPersonGroupHelper hapagHelper, EntityRepository repository) : base(dao, facade, repository) { _locationManager = locationManager; _personGroupSyncManager = personGroupSyncManager; _hapagHelper = hapagHelper; }
public ReportFilterController(DataController dataController, IConfigurationFacade configFacade, IWhereClauseFacade whereClauseFacade, I18NResolver i18Nresolver) { _dataController = dataController; _configFacade = configFacade; _whereClauseFacade = whereClauseFacade; _i18Nresolver = i18Nresolver; }
public ScheduleController(IConfigurationFacade configuration) { _ruleEngine = configuration.RuleEngine; _whiteSpaceCalculator = configuration.WhiteSpaceCalculator; _noteExtractor = configuration.NoteExtractor; ScheduleEntries = new List <ScheduleEntry>(); }
public ApplicationController(DataController dataController, ExcelUtil excelUtil, IConfigurationFacade facade, I18NResolver i18NResolver, IContextLookuper contextLookuper) { _dataController = dataController; _excelUtil = excelUtil; _facade = facade; _i18NResolver = i18NResolver; _contextLookuper = contextLookuper; }
private ConfigurationViewModel GetFont(int?currentPage, string isNext, ref int refPageIndex) { _configFacade = new ConfigurationFacade(); var lstAllFont = _configFacade.GetFont(); ConfigurationViewModel configVM = new ConfigurationViewModel(); configVM.FontList = new List <FontViewModel>(); int pageIndex = 0; if (currentPage.HasValue == false || string.IsNullOrEmpty(isNext)) { pageIndex = 0; } else { pageIndex = isNext.Equals("1") ? currentPage.Value + 1 : currentPage.Value - 1; pageIndex = pageIndex <= 0 ? 0 : pageIndex; } int itemPerPage = 16; int startPageIndex = pageIndex == 0 ? 0 : (pageIndex * itemPerPage); int totalRecords = lstAllFont.Count(); if (startPageIndex >= totalRecords) { startPageIndex = 0; pageIndex = 1; } var lstFont = lstAllFont.Skip(startPageIndex).Take(itemPerPage).ToList <FontEntity>(); var cntOfIndex = lstFont.Count(); int index = 0; for (; ;) { configVM.FontList.Add (new FontViewModel { Font_1 = (index < cntOfIndex) ? lstFont[index].FontName : string.Empty, Font_2 = (index + 1 < cntOfIndex) ? lstFont[index + 1].FontName : string.Empty, Font_3 = (index + 2 < cntOfIndex) ? lstFont[index + 2].FontName : string.Empty, Font_4 = (index + 3 < cntOfIndex) ? lstFont[index + 3].FontName : string.Empty, }); index = index + 4; if (index >= cntOfIndex) { break; } } refPageIndex = pageIndex; return(configVM); }
public void Setup() { _configuration = new ConfigurationFacade() { RuleEngine = new DefaultDataColumnRuleEngine(), NoteExtractor = new DefaultNoteExtractor(), WhiteSpaceCalculator = new DefaultWhiteSpaceSizeCalculator() }; _dataLines = new List <string>(); _mockFileReader = new Mock <IReader>(); _mockFileReader.Setup(x => x.Read()).Returns(_dataLines); }
public SignInController(IConfigurationFacade facade, LdapManager ldapManager) { _facade = facade; _ldapManager = ldapManager; }
public UserSyncManager(SWDBHibernateDAO dao, IConfigurationFacade facade, EntityRepository repository) : base(dao, facade, repository) { }
public LdapManager(IConfigurationFacade facade, SWDBHibernateDAO dao) { _facade = facade; _dao = dao; }
public R0042ExtractorJob(EntityRepository entityRepository, IConfigurationFacade configFacade, SWDBHibernateDAO dao) { _entityRepository = entityRepository; ConfigFacade = configFacade; DAO = dao; }
public ActionResult Edit(ConfigurationViewModel configVM) { Logger.Info(_logMsg.Clear().SetPrefixMsg("Save Configuration").Add("SystemName", configVM.SystemName) .Add("URL", configVM.Url).ToInputLogString()); try { //if (configVM.ConfigureUrlId != null) //{ // ModelState.Remove("File"); //} if (ModelState.IsValid) { var selectedRole = configVM.RoleCheckBoxes.Where(x => x.Checked == true) .Select(x => new RoleEntity { RoleId = x.Value.ToNullable <int>() }).ToList(); if (!selectedRole.Any(x => x.IsDelete == false)) { ViewBag.ErrorMessage = Resource.ValErr_AtLeastOneItem; goto Outer; } //var file = configVM.File; ConfigureUrlEntity configUrlEntity = new ConfigureUrlEntity(); configUrlEntity.ConfigureUrlId = configVM.ConfigureUrlId ?? 0; configUrlEntity.SystemName = configVM.SystemName; configUrlEntity.Url = configVM.Url; configUrlEntity.Status = configVM.Status; configUrlEntity.CreateUser = UserInfo; configUrlEntity.UpdateUser = UserInfo; configUrlEntity.Menu = new MenuEntity { MenuId = configVM.MenuId ?? 0 }; configUrlEntity.FontName = configVM.FontName; #region "Check Duplicate" // Check Duplicate _configFacade = new ConfigurationFacade(); if (_configFacade.IsDuplicateConfigureUrl(configUrlEntity) == true) { ViewBag.ErrorMessage = Resource.Error_SaveUrl; goto Outer; } #endregion #region "comment out" //if (file != null && file.ContentLength > 0) //{ // _commonFacade = new CommonFacade(); // ParameterEntity paramSingleFileSize = _commonFacade.GetCacheParamByName(Constants.ParameterName.SingleFileSize); // int? limitSingleFileSize = paramSingleFileSize.ParamValue.ToNullable<int>(); // if (file.ContentLength > limitSingleFileSize)//2MB = 2097152 , 1MB = 1048576 // { // ViewBag.ErrorMessage = Resource.ValError_FileSizeUploadMaxLimit; // goto Outer; // } // // extract only the filename // var fiWithoutExt = Path.GetFileNameWithoutExtension(file.FileName); // var fiExt = Path.GetExtension(file.FileName); // var fileName = string.Format("{0}_{1}{2}", fiWithoutExt, DateTime.Now.FormatDateTime("yyyyMMddHHmmssfff"), fiExt); // //const string regexPattern = @"^.*\.(jpg|jpeg|doc|docx|xls|xlsx|ppt|txt)$"; // ParameterEntity param = _commonFacade.GetCacheParamByName(Constants.ParameterName.RegexConfigIcon); // Match match = Regex.Match(fileName, param.ParamValue, RegexOptions.IgnoreCase); // if (!match.Success) // { // ViewBag.ErrorMessage = Resource.ValError_FileExtensionConfigUrl; // goto Outer; // } // string imgPath = StreamDataHelpers.GetApplicationPath(string.Format("{0}{1}", Constants.ConfigUrlPath, fileName)); // file.SaveAs(imgPath); // configUrlEntity.ImageFile = fileName; //} #endregion #region "Get Roles" if (configVM.RoleList != null && configVM.RoleList.Count > 0) { var prevRoles = (from rl in configVM.RoleList select new RoleEntity { RoleId = rl.RoleId, RoleName = rl.RoleName, IsDelete = !selectedRole.Select(x => x.RoleId).Contains(rl.RoleId) }).ToList(); var dupeRoles = new List <RoleEntity>(selectedRole); dupeRoles.AddRange(prevRoles); var duplicates = dupeRoles.GroupBy(x => new { x.RoleId }) .Where(g => g.Count() > 1) .Select(g => (object)g.Key.RoleId); if (duplicates.Any()) { Logger.Info(_logMsg.Clear().SetPrefixMsg("Duplicate ID in list") .Add("IDs", StringHelpers.ConvertListToString(duplicates.ToList(), ",")) .ToInputLogString()); prevRoles.RemoveAll(x => duplicates.Contains(x.RoleId)); } selectedRole.AddRange(prevRoles); } configUrlEntity.Roles = selectedRole; #endregion bool success = _configFacade.SaveConfigurationUrl(configUrlEntity); if (success) { CacheLayer.Clear(Constants.CacheKey.MainMenu); return(RedirectToAction("Search", "Configuration")); } ViewBag.ErrorMessage = Resource.Error_SaveFailed; } Outer: TempData["configurationVM"] = configVM; return(InitEdit()); } catch (Exception ex) { Logger.Error("Exception occur:\n", ex); Logger.Info(_logMsg.Clear().SetPrefixMsg("Save Configuration").Add("Error Message", ex.Message).ToFailLogString()); return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString()))); } }
public ConfigurationRegistry(IConfigurationFacade facade) { facade.Register(ConfigurationConstants.MainIconKey, new PropertyDefinition() { Description = "Icon that will appear alongside the entire application, after login", //represents base64 of logo_hapag.gif. Got from: http://webcodertools.com/imagetobase64converter/Create StringValue = "data:image/gif;base64,R0lGODlhygBTAHAAACH5BAEAAPwALAAAAADKAFMAhwAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDVAADVMwDVZgDVmQDVzADV/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMrADMrMzMrZjMrmTMrzDMr/zNVADNVMzNVZjNVmTNVzDNV/zOAADOAMzOAZjOAmTOAzDOA/zOqADOq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RoRMpOZYdfK0jJt8eWJI6FU0J42HCnyC4sgyQpiSLjErpFxUojCyrLA2BEWludmQpOLFtnYkbecjU0KtBufPjNG0IxJWqGi40aQNhCntexsqrpRITUmSJAQEH1MpE4jWcJCoaCvaJNsif36VDvyZPIlTRuaZD75EvQ5DVukXIlccCdCI6VyJVcfTIjInPhKkhhKKqOpZUri1jiuzEeXKOllIYFJTIEEBAA7", Renderer = "attachment" }); facade.Register(ConfigurationConstants.UserRowstampKey, new PropertyDefinition { Description = "current user rowstamp from maximo", StringValue = "0", DataType = "long", Contextualized = false }); facade.Register(ConfigurationConstants.PersonGroupRowstampKey, new PropertyDefinition { Description = "current person group rowstamp from maximo", StringValue = "0", DataType = "long", Contextualized = false }); facade.Register(ConfigurationConstants.PersonGroupAssociationRowstampKey, new PropertyDefinition { Description = "current person group association rowstamp from maximo", StringValue = "0", DataType = "long", Contextualized = false }); facade.Register(ConfigurationConstants.MyProfileEnabled, new PropertyDefinition { Description = "Is My Profile Module Enabled for the system", StringValue = "true", DataType = "boolean", Contextualized = false }); facade.Register(ConfigurationConstants.MyProfileReadOnly, new PropertyDefinition { Description = "Is My Profile Module ReadOnly for the system", StringValue = "true", DataType = "boolean", Contextualized = false }); facade.Register(ConfigurationConstants.ClientSideLogLevel, new PropertyDefinition { Description = "Level of client side logs", StringValue = "warn", DataType = "string", Contextualized = false }); facade.Register(ConfigurationConstants.MaxQuerySizeChunk, new PropertyDefinition { Description = "Max number of entries to be fetch from database before applying chunk", StringValue = "50000", DataType = "long", Contextualized = false }); facade.Register(ConfigurationConstants.R0042Rowstamp, new PropertyDefinition { Description = "current rowstamp to be used to filter assets for the job", StringValue = "0", DataType = "long", Contextualized = false }); // facade.Register(ConfigurationConstants.LdapAuthNonMaximoUsers, new PropertyDefinition() { // Description = "Allow non maximo users to login into the system", // StringValue = "true", // DataType = "boolean", // }); }
public CacheCleanupJob(IConfigurationFacade facade) { _facade = facade; }
protected AMaximoRowstampManager(SWDBHibernateDAO dao, IConfigurationFacade facade, EntityRepository repository) { DAO = dao; ConfigFacade = facade; EntityRepository = repository; }
public PersonGroupSyncManager(SWDBHibernateDAO dao, IConfigurationFacade facade, EntityRepository repository, HlagLocationManager hlagLocationManager) : base(dao, facade, repository) { _hlagLocationManager = hlagLocationManager; }
public ComConfigurationRegistry(IConfigurationFacade facade, IWhereClauseFacade wcFacade, SWDBHibernateDAO dao) { _wcFacade = wcFacade; _facade = facade; }
public ActionResult InitEdit(int?ConfigureUrlId = null) { ConfigurationViewModel configVM = null; if (TempData["configurationVM"] != null) { configVM = (ConfigurationViewModel)TempData["configurationVM"]; } else { configVM = new ConfigurationViewModel { ConfigureUrlId = ConfigureUrlId }; } _commonFacade = new CommonFacade(); var statusList = _commonFacade.GetStatusSelectList(); configVM.StatusList = new SelectList((IEnumerable)statusList, "Key", "Value", string.Empty); #region "For show in hint" //ParameterEntity param = _commonFacade.GetCacheParamByName(Constants.ParameterName.RegexConfigIcon); //ParameterEntity paramSingleFileSize = _commonFacade.GetCacheParamByName(Constants.ParameterName.SingleFileSize); //int? limitSingleFileSize = paramSingleFileSize.ParamValue.ToNullable<int>(); //var singleLimitSize = limitSingleFileSize.HasValue ? (limitSingleFileSize / 1048576) : 0; //ViewBag.UploadLimitType = string.Format(param.ParamDesc, singleLimitSize); #endregion _configFacade = new ConfigurationFacade(); var menuList = _configFacade.GetAllMenu(); configVM.MenuList = new SelectList((IEnumerable)menuList, "Key", "Value", string.Empty); List <RoleEntity> roles = _configFacade.GetAllRole(); if (roles != null && roles.Count > 0) { configVM.RoleCheckBoxes = roles.Select(x => new CheckBoxes { Value = x.RoleId.ToString(), Text = x.RoleName, Checked = false }).ToList(); } if (configVM.ConfigureUrlId != null) { ConfigureUrlEntity configUrlEntity = _configFacade.GetConfigureURLById(configVM.ConfigureUrlId.Value); configVM.ConfigureUrlId = configUrlEntity.ConfigureUrlId; configVM.SystemName = configUrlEntity.SystemName; configVM.Url = configUrlEntity.Url; configVM.Status = configUrlEntity.Status; configVM.MenuId = configUrlEntity.Menu.MenuId; configVM.FileUrl = configUrlEntity.ImageUrl; configVM.FontName = configUrlEntity.FontName; configVM.CreateUser = configUrlEntity.CreateUser != null ? configUrlEntity.CreateUser.FullName : ""; configVM.CreatedDate = configUrlEntity.CreatedDate.FormatDateTime(Constants.DateTimeFormat.DefaultFullDateTime); configVM.UpdateDate = configUrlEntity.Updatedate.FormatDateTime(Constants.DateTimeFormat.DefaultFullDateTime); configVM.UpdateUser = configUrlEntity.UpdateUser != null ? configUrlEntity.UpdateUser.FullName : ""; if (configVM.RoleCheckBoxes != null && configUrlEntity.Roles != null) { configVM.JsonRole = JsonConvert.SerializeObject(configUrlEntity.Roles); configVM.RoleCheckBoxes.Where(x => configUrlEntity.Roles.Select(r => r.RoleId.ToString()).Contains(x.Value)) .ToList().ForEach(x => x.Checked = true); } } else { // default UserLogin if (this.UserInfo != null) { var today = DateTime.Now; configVM.CreateUser = this.UserInfo.FullName; configVM.CreatedDate = today.FormatDateTime(Constants.DateTimeFormat.DefaultFullDateTime); configVM.UpdateDate = today.FormatDateTime(Constants.DateTimeFormat.DefaultFullDateTime); configVM.UpdateUser = this.UserInfo.FullName; } } // List Font int refPageIndex = 0; configVM.FontList = GetFont(null, null, ref refPageIndex).FontList; configVM.PageIndexOfFont = refPageIndex; return(View("~/Views/Configuration/Edit.cshtml", configVM)); }