public void SalvaOpzioni(UserOption options, string codice, int idUtente) { var daoFactory = _windsorRepository.GetDaoFactory(_info.Azienda); var utente = daoFactory.GetUtenteDao().GetById(idUtente, false); var service = _windsorRepository.GetContainer(_info.Azienda).Resolve<IOpzioni>(); service.Save(options, codice, utente); }
public void SalvaOpzioni(UserOption opzioni, string codice) { base.GetServiceClient().SalvaOpzioni(opzioni, codice, GetUserInfo()); _cache.Add("UserOption", opzioni, CacheItemPriority.Normal, null, new AbsoluteTime(new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 23, 59, 59))); base.CloseService(); }
public void Save(UserOption options, string codice, Utente utente) { Gipasoft.Business.GestioneCondomini.Domain.Opzioni opzioni = _opzioniDao.GetByCodice(codice, utente); if (opzioni == null) opzioni = new Gipasoft.Business.GestioneCondomini.Domain.Opzioni(codice, utente); opzioni.ToolBarIcon = options.ToolbarIconType; opzioni.MenuIcon = options.MenuIconType; opzioni.CurrentStyle = options.CurrentStyle; opzioni.MouseOverActionMenuScomparsa = options.MouseOverMenuScomparsa; _opzioniDao.SaveOrUpdate(opzioni); }
public override void LoadOptions() { base.LoadOptions(); UserOption options = new UserOption(); _container = new WindsorContainer(new XmlInterpreter()); IOpzioni opzioniService = (IOpzioni)_container[typeof(IOpzioni)]; options = opzioniService.GetUserOptions(Key, Gipasoft.Security.Login.Instance.CurrentLogin().LoginName); if (File.Exists(Application.StartupPath + "/Style/" + options.CurrentStyle)) Infragistics.Win.AppStyling.StyleManager.Load(Application.StartupPath + "/Style/" + options.CurrentStyle); opzioniService.Close(); }
private void btnOkClick(object sender, EventArgs e) { CommonMessages.DisplayWarning("Per attivare le modifiche di stile occorre riavviare l'applicazione."); var toolbarIconType = IconType.Default; var menuIconType = IconType.Default; switch (grandezzaIconeToolBar.Value.ToString()) { case "Large": toolbarIconType = IconType.Large; break; case "Small": toolbarIconType = IconType.Small; break; } switch (grandezzaIconeMenu.Value.ToString()) { case "Large": menuIconType = IconType.Large; break; case "Small": menuIconType = IconType.Small; break; } var options = new UserOption { ToolbarIconType = toolbarIconType, MenuIconType = menuIconType, CurrentStyle = stile.Value.ToString(), MouseOverMenuScomparsa = (MouseOverAction) Enum.Parse(typeof (MouseOverAction), menuScomparsa.Value.ToString()) }; _opzioniService.SalvaOpzioni(options, "default"); var parentForm = _parentForm as IOptionable; parentForm?.LoadOptions(); Close(); }
public void SalvaOpzioni(UserOption options, string codice, UserInfo userinfo) { var windsorRep = new WindsorConfigRepository(); try { windsorRep.BeginTransaction(userinfo); var repo = new OpzioniRepository(userinfo, windsorRep); repo.SalvaOpzioni(options, codice, userinfo.Utente); windsorRep.Commit(); } catch (Exception ex) { _log.Error("Errore nel salvataggio delle opzioni per utente - " + Utility.GetMethodDescription() + " - codice:" + codice + " - utente:" + userinfo.Utente, ex); windsorRep.Rollback(); throw; } }