protected void Save_OnClick(object sender, EventArgs e) { IUser user = (IUser)BindingSource.Current; _userId = user.Id.ToString(); Sage.SalesLogix.Web.WebUserOptionsService userOptions = new Sage.SalesLogix.Web.WebUserOptionsService(_userId); // ApplicationContext.Current.Services.Get<IUserOptionsService>(true); userOptions.LoadOptionsNow(); userOptions.SetCommonOption("InsertSecCodeID", "General", ownAccount.LookupResultValue.ToString(), !chkbxAllowChange.Checked); userOptions.SetCommonOption("DefaultMemoTemplate", "General", txtEmailTemplateName.Value, !chkbxAllowChangeTemplates.Checked); userOptions.SetCommonOption("DefaultMemoTemplateID", "General", txtEmailTemplateId.Value, !chkbxAllowChangeTemplates.Checked); userOptions.SetCommonOption("DefaultLetterTemplate", "General", txtLetterTemplateName.Value, !chkbxAllowChangeTemplates.Checked); userOptions.SetCommonOption("DefaultLetterTemplateId", "General", txtLetterTemplateId.Value, !chkbxAllowChangeTemplates.Checked); userOptions.SetCommonOption("DefaultFaxTemplate", "General", txtFaxTemplateName.Value, !chkbxAllowChangeTemplates.Checked); userOptions.SetCommonOption("DefaultFaxTemplateId", "General", txtFaxTemplateId.Value, !chkbxAllowChangeTemplates.Checked); }
private void LoadView() { Sage.SalesLogix.Web.WebUserOptionsService userOptions = new Sage.SalesLogix.Web.WebUserOptionsService(_userId);// ApplicationContext.Current.Services.Get<IUserOptionsService>(); userOptions.LoadOptionsNow(); ownAccount.LookupResultValue = userOptions.GetCommonOption("InsertSecCodeID", "General", false, Owner.SystemEveryone, String.Empty); chkbxAllowChange.Checked = !userOptions.GetCommonOptionLocked("InsertSecCodeID", "General"); txtEmailTemplateName.Value = userOptions.GetCommonOption("DefaultMemoTemplate", "General"); txtEmailTemplateId.Value = userOptions.GetCommonOption("DefaultMemoTemplateId", "General"); txtLetterTemplateName.Value = userOptions.GetCommonOption("DefaultLetterTemplate", "General"); txtLetterTemplateId.Value = userOptions.GetCommonOption("DefaultLetterTemplateId", "General"); txtFaxTemplateName.Value = userOptions.GetCommonOption("DefaultFaxTemplate", "General"); txtFaxTemplateId.Value = userOptions.GetCommonOption("DefaultFaxTemplateId", "General"); chkbxAllowChangeTemplates.Checked = !userOptions.GetCommonOptionLocked("DefaultMemoTemplate", "General"); IUser user = (IUser)BindingSource.Current; if ((user.Type == UserType.WebViewer) || (user.Type == UserType.AddOn)) { txtFaxTemplateName.Attributes.Add("DISABLED", ""); txtFaxTemplateName.Attributes["onclick"] = ""; FaxTemplateFindIcon.Attributes["onclick"] = ""; txtLetterTemplateName.Attributes.Add("DISABLED", ""); txtLetterTemplateName.Attributes["onclick"] = ""; LetterTemplateFindIcon.Attributes["onclick"]= ""; txtEmailTemplateName.Attributes.Add("DISABLED", ""); txtEmailTemplateName.Attributes["onclick"] = ""; EmailTemplateFindIcon.Attributes["onclick"] = ""; chkbxAllowChangeTemplates.Enabled = false; } }