/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.PreRender"/> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param> protected override void OnPreRender(EventArgs e) { if (!Visible) { return; } DateTime fromDate = DateTime.UtcNow; IUserOptionsService userOptions = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (userOptions != null) { try { fromDate = DateTime.Parse(userOptions.GetCommonOption("LastWebUpdate", "Web", false, fromDate.ToString(), "LastWebUpdate")); } catch { } } SearchOptions.SearchDate = fromDate; var calendarService = ApplicationContext.Current.Services.Get <ICalendarSecurityService>(true); SearchOptions.UserIds.AddRange(calendarService.GetCalendarAccessUserIds(CurrentUserId)); //New History SearchOptions.SearchType = WhatsNewSearchOptions.SearchTypeEnum.New; if (!String.IsNullOrEmpty(grdNewHistory.SortExpression)) { SearchOptions.OrderBy = grdNewHistory.SortExpression; SearchOptions.SortDirection = (grdNewHistory.CurrentSortDirection.Equals("Ascending", StringComparison.CurrentCultureIgnoreCase)) ? ListSortDirection.Ascending : ListSortDirection.Descending; } WNRequest.SearchOptions = SearchOptions; grdNewHistory.DataSource = HistoryNewObjectDataSource; grdNewHistory.DataBind(); //Modified History SearchOptions.SearchType = WhatsNewSearchOptions.SearchTypeEnum.Updated; if (!String.IsNullOrEmpty(grdModifiedHistory.SortExpression)) { SearchOptions.OrderBy = grdModifiedHistory.SortExpression; SearchOptions.SortDirection = (grdModifiedHistory.CurrentSortDirection.Equals("Ascending", StringComparison.CurrentCultureIgnoreCase)) ? ListSortDirection.Ascending : ListSortDirection.Descending; } else { SearchOptions.OrderBy = "ModifyDate"; SearchOptions.SortDirection = ListSortDirection.Ascending; } WNRequest.SearchOptions = SearchOptions; grdModifiedHistory.DataSource = HistoryModifiedObjectDataSource; grdModifiedHistory.DataBind(); base.OnPreRender(e); }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.PreRender"/> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param> protected override void OnPreRender(EventArgs e) { if (Page.Visible) { RegisterClientScripts(); DateTime searchDate = DateTime.UtcNow; WhatsNewSearchOptions.SearchTypeEnum searchTypeEnum = WhatsNewSearchOptions.SearchTypeEnum.New; IUserOptionsService userOpts = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (userOpts != null) { try { searchDate = DateTime.Parse(userOpts.GetCommonOption("LastWebUpdate", "Web", false, searchDate.ToString(), "LastWebUpdate")); var searchType = userOpts.GetCommonOption("WhatsNewSearchType", "Web", false, WhatsNewSearchOptions.SearchTypeEnum.New.ToString(), "WhatsNewSearchType"); if (Enum.IsDefined(typeof(WhatsNewSearchOptions.SearchTypeEnum), searchType)) { searchTypeEnum = (WhatsNewSearchOptions.SearchTypeEnum)Enum.Parse(typeof(WhatsNewSearchOptions.SearchTypeEnum), searchType, true); } } catch { } } WNRequest.SearchOptions.SearchDate = searchDate; WNRequest.SearchOptions.SearchType = searchTypeEnum; WNRequest.ActiveTab = WhatsNewRequest <ILibraryDocs> .ActiveTabEnum.Document; WNRequest.SearchOptions.SortExpression = grdDocuments.SortExpression; WNRequest.SearchOptions.SortDirection = (ListSortDirection)grdDocuments.SortDirection; grdDocuments.DataSource = WNRequest.GetRemoteDocumentsWhatsNew(); grdDocuments.DataBind(); } }
protected void _save_Click(object sender, EventArgs e) { // save values ActivityAlarmOptions options = new ActivityAlarmOptions(Server.MapPath(@"App_Data\LookupValues")); options.DefaultView = _defaultView.SelectedValue; options.DefaultFollowupActivity = _defaultFollowupActivity.SelectedValue; options.CarryOverNotes = _carryOverNotes.SelectedValue; options.CarryOverAttachments = _carryOverAttachments.SelectedValue; options.AlarmDefaultLead = _alarmDefaultLead.SelectedValue; options.AlarmDefaultLeadValue = System.Convert.ToInt32(_alarmDefaultLeadValue.Text); options.Save(); IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>(); userOption.SetCommonOption("DisplayActivityReminders", _Category, _ShowReminders.Items[0].Selected ? "T" : "F", false); userOption.SetCommonOption("RemindPastDue", _Category, _ShowPastDue.Items[0].Selected ? "T" : "F", false); userOption.SetCommonOption("RemindConfirmations", _Category, _ShowConfirms.Items[0].Selected ? "T" : "F", false); userOption.SetCommonOption("RemindAlarms", _Category, _ShowAlarms.Items[0].Selected ? "T" : "F", false); IContextService context = ApplicationContext.Current.Services.Get <IContextService>(true); string value = string.Format("{0}|{1}|{2}|{3}", _ShowReminders.Items[0].Selected, _ShowAlarms.Items[0].Selected, _ShowPastDue.Items[0].Selected, _ShowConfirms.Items[0].Selected); context.SetContext("ActivityRemindersDisplay", value); }
/// <summary> /// Loads the sales process. /// </summary> /// <param name="opportunityId">The opportunity id.</param> private void LoadSalesProcess(string opportunityId) { ISalesProcesses salesProcess = Helpers.GetSalesProcess(opportunityId); _salesProcess = salesProcess; if (salesProcess != null) { IList <ISalesProcessAudit> list = salesProcess.GetSalesProcessAudits(); LoadStagesDropDown(list); SalesProcessGrid.DataSource = list; SalesProcessGrid.DataBind(); SetDDLSalesProcess(salesProcess.Name); txtNumOfStepsCompleted.Value = Convert.ToString(salesProcess.NumberOfStepsCompleted()); txtCurrentSalesProcessName.Value = salesProcess.Name; txtCurrentSalesProcessId.Value = salesProcess.Id.ToString(); } else { LoadStagesDropDown(null); List <ISalesProcessAudit> list = new List <ISalesProcessAudit>(); SalesProcessGrid.DataSource = list; SalesProcessGrid.DataBind(); IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>(); string defSalesProcess = userOption.GetCommonOption("cboSalesProcess", "OpportunityDefaults"); if (string.IsNullOrEmpty(defSalesProcess)) { defSalesProcess = "NONE"; } SetDDLSalesProcess(defSalesProcess); txtNumOfStepsCompleted.Value = "0"; txtCurrentSalesProcessName.Value = String.Empty; txtCurrentSalesProcessId.Value = String.Empty; } }
protected void Page_Load(object sender, EventArgs e) { m_SLXUserService = ApplicationContext.Current.Services.Get <IUserService>() as SLXUserService; _UserOptions = ApplicationContext.Current.Services.Get <IUserOptionsService>(); _Context = ApplicationContext.Current.Services.Get <IContextService>(true); object cacheDisplayRem = _Context.GetContext("ActivityRemindersDisplay"); if (cacheDisplayRem != null) { string[] temp = cacheDisplayRem.ToString().Split('|'); _DisplayReminders = Convert.ToBoolean(temp[0]); _Alarms = Convert.ToBoolean(temp[1]); _PastDue = Convert.ToBoolean(temp[2]); _Confirms = Convert.ToBoolean(temp[3]); } else { _DisplayReminders = (_UserOptions.GetCommonOption("DisplayActivityReminders", "Calendar") != "F"); _Alarms = (_UserOptions.GetCommonOption("RemindAlarms", "Calendar") != "F"); _PastDue = (_UserOptions.GetCommonOption("RemindPastDue", "Calendar") != "F"); _Confirms = (_UserOptions.GetCommonOption("RemindConfirmations", "Calendar") != "F"); string value = string.Format("{0}|{1}|{2}|{3}", _DisplayReminders, _Alarms, _PastDue, _Confirms); _Context.SetContext("ActivityRemindersDisplay", value); } if (!Page.IsPostBack) { btnShowHideDetail.OnClientClick = String.Format("javascript:btnShowHideDetails('{0}', '{1}', '{2}')", ClientID, GetLocalResourceObject("btnHideDetail.Caption"), GetLocalResourceObject("btnShowDetail.Caption")); btnShowHideDetail.Attributes["onClick"] = "return false;"; } }
/// <summary> /// Sets the user option defaults. /// </summary> /// <param name="activity">The activity.</param> private void SetUserOptionDefaults(Sage.SalesLogix.Activity.Activity activity) { IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>(); string alarmLeadUnit = userOption.GetCommonOption("AlarmDefaultLead", "ActivityAlarm"); string alarmLeadValue = userOption.GetCommonOption("AlarmDefaultLeadValue", "ActivityAlarm"); int alarmLeadMinutes = 15; //default if ((alarmLeadUnit != "") && (alarmLeadValue != "")) { try { alarmLeadMinutes = Convert.ToInt32(alarmLeadValue); } catch { alarmLeadMinutes = 15; } switch (alarmLeadUnit) { case "Days": alarmLeadMinutes = alarmLeadMinutes * 24 * 60; break; case "Hours": alarmLeadMinutes = alarmLeadMinutes * 60; break; } } activity.ReminderDuration = alarmLeadMinutes; }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.PreRender"/> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param> protected override void OnPreRender(EventArgs e) { if (Page.Visible) { RegisterClientScripts(); DateTime searchDate = DateTime.UtcNow; WhatsNewSearchOptions.SearchTypeEnum searchTypeEnum = WhatsNewSearchOptions.SearchTypeEnum.New; IUserOptionsService userOpts = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (userOpts != null) { try { string searchType; searchDate = DateTime.Parse(userOpts.GetCommonOption("LastWebUpdate", "Web", false, searchDate.ToString(), "LastWebUpdate")); searchType = userOpts.GetCommonOption("WhatsNewSearchType", "Web", false, WhatsNewSearchOptions.SearchTypeEnum.New.ToString(), "WhatsNewSearchType"); if (Enum.IsDefined(typeof(WhatsNewSearchOptions.SearchTypeEnum), searchType)) { searchTypeEnum = (WhatsNewSearchOptions.SearchTypeEnum)Enum.Parse(typeof(WhatsNewSearchOptions.SearchTypeEnum), searchType, true); } } catch { } } WNRequest.SearchOptions.SearchDate = searchDate; WNRequest.SearchOptions.SearchType = searchTypeEnum; WNRequest.ActiveTab = WhatsNewRequest <IOpportunity> .ActiveTabEnum.Opportunity; SetActiveGridDisplay(searchTypeEnum, WNRequest); } }
public ManagePageNotificationService( IUserOptionsService userOptionsService, INewNotification newNotification) { _userOptionsService = userOptionsService; _newNotification = newNotification; }
/// <summary> /// Handles the Click event of the _save control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void _save_Click(object sender, EventArgs e) { if (txtRecentTemplates.Visible) { int iCount; if (int.TryParse(txtRecentTemplates.Text, out iCount)) { if (iCount < 0 || iCount > 10) { throw new ValidationException(htxtMenuRangeMessage.Value); } } else { throw new ValidationException(htxtMenuRangeMessage.Value); } } // save values GeneralSearchOptions options = new GeneralSearchOptions(Server.MapPath(_optionsMapPath)); options.ShowOnStartup = GetStartupUrl(_showOnStartup.SelectedValue); options.DefaultOwnerTeam = _defaultOwnerTeam.LookupResultValue.ToString(); options.LogToHistory = _logToHistory.SelectedValue; //Defect 1-80914 // DThompson - "Please only hide the options for now. We may re-enable them in Sawgrass depending on the direction we choose to take." //options.PromptForDuplicateContacts = _promptDuplicateContacts.Checked; //options.PromptForContactNotFound = _promptContactNotFound.Checked; options.UseActiveReporting = _useActiveReporting.Checked; options.AutoLogoff = _autoLogoff.Checked; options.LogoffDuration = Convert.ToInt32(_logoffDuration.Text); options.LogoffUnits = _logoffUnits.SelectedValue; options.EmailBaseTemplate = txtEmailBaseTemplateId.Text; options.LetterBaseTemplate = txtLetterBaseTemplateId.Text; options.FaxBaseTemplate = txtFaxBaseTemplateId.Text; options.RecentTemplates = txtRecentTemplates.Text; options.PromptForUnsavedData = chkPromptForUnsavedData.Checked; if (FaxProviderSelectedValue.Value != "undefined") { options.FaxProvider = FaxProviderSelectedValue.Value; } else { options.FaxProvider = txtFaxProvider.Text; } if (luMyCurrency.LookupResultValue != null) { options.MyCurrencyCode = ((IExchangeRate)(luMyCurrency.LookupResultValue)).Id.ToString(); } // Saves the intellisync group IUserOptionsService _UserOptions = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (_intellisyncGroup.SelectedItem != null) { _UserOptions.SetCommonOption("SyncGroup", "Intellisync", _intellisyncGroup.SelectedValue, false); options.Save(); } }
public InviteAcceptPrivacyAgreementJob( IUserOptionsService userOptionsService, INewNotification newNotification, ILogger <InviteAcceptPrivacyAgreementJob> logger) { _userOptionsService = userOptionsService; _newNotification = newNotification; _logger = logger; }
public CloudServiceFactory( ILogger <CloudServiceFactory> logger, IUserOptionsService userOptionsService, ILifetimeScope lifetimeScope) { _logger = logger; _userOptionsService = userOptionsService; _lifetimeScope = lifetimeScope; _lifetimeScope = lifetimeScope; }
/// <summary> /// Handles the Init event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Init(object sender, EventArgs e) { _Context = ApplicationContext.Current.Services.Get <IContextService>(); _State = _Context.GetContext("AddProductStateInfo") as AddProductStateInfo; if (_State == null) { _State = new AddProductStateInfo(); } _UserOptions = ApplicationContext.Current.Services.Get <IUserOptionsService>(); }
public TagsManager( ILogger <TagsManager> logger, IIndexedDbRepo <BkTag, string> tagsRepo, IClock clock, IUserOptionsService userOptionsService) { _logger = logger; _tagsRepo = tagsRepo; _clock = clock; _userOptionsService = userOptionsService; }
protected void Page_PreRender(object sender, EventArgs e) { IUserOptionsService opts = Sage.Platform.Application.ApplicationContext.Current.Services.Get <IUserOptionsService>(); string defPage = opts.GetCommonOption("ShowOnStartup", "General"); if (defPage != "") { Response.Redirect(defPage, true); return; } }
/// <summary> /// Called when [search_ click]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void OnSearch_Click(object sender, EventArgs e) { IUserOptionsService userOpts = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (userOpts != null) { userOpts.SetCommonOption("LastWebUpdate", "Web", dteChangeDate.DateTimeValue.Value.ToString(), false); userOpts.SetCommonOption("WhatsNewSearchType", "Web", GetSeletectedSearchType(), false); } RefreshActiveTab(); }
public static string GetDefaultFollowUpActivityType() { IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>(); string key = userOption.GetCommonOption("DefaultFollowupActivity", "ActivityAlarm"); IDictionary <string, string> map = new Dictionary <string, string>(); map.Add("None", "None"); map.Add("Phone Call", "atPhoneCall"); map.Add("Meeting", "atMeeting"); map.Add("To-Do", "atToDo"); return(map.ContainsKey(key) ? map[key] : "None"); }
protected void Page_PreRender(object sender, EventArgs e) { ActivityAlarmOptions options = null; options = ActivityAlarmOptions.Load(Server.MapPath(@"App_Data\LookupValues")); // set defaults Utility.SetSelectedValue(_defaultView, options.DefaultView); Utility.SetSelectedValue(_defaultFollowupActivity, options.DefaultFollowupActivity); Utility.SetSelectedValue(_carryOverNotes, options.CarryOverNotes); Utility.SetSelectedValue(_carryOverAttachments, options.CarryOverAttachments); Utility.SetSelectedValue(_alarmDefaultLead, options.AlarmDefaultLead); _alarmDefaultLeadValue.Text = options.AlarmDefaultLeadValue.ToString(); IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (userOption.GetCommonOption("DisplayActivityReminders", _Category) == "F") { _ShowReminders.SelectedIndex = 1; _ShowPastDue.Enabled = false; _ShowConfirms.Enabled = false; _ShowAlarms.Enabled = false; lblShowAlarms.Enabled = false; lblShowConfirms.Enabled = false; lblShowPastDue.Enabled = false; } else { _ShowReminders.SelectedIndex = 0; _ShowPastDue.Enabled = true; _ShowConfirms.Enabled = true; _ShowAlarms.Enabled = true; lblShowAlarms.Enabled = true; lblShowConfirms.Enabled = true; lblShowPastDue.Enabled = true; } if (userOption.GetCommonOption("RemindPastDue", _Category) == "F") { _ShowPastDue.SelectedIndex = 1; } if (userOption.GetCommonOption("RemindConfirmations", _Category) == "F") { _ShowConfirms.SelectedIndex = 1; } if (userOption.GetCommonOption("RemindAlarms", _Category) == "F") { _ShowAlarms.SelectedIndex = 1; } GenerateScript(); }
protected void OnSearch(object sender, EventArgs e) { IUserOptionsService userOpts = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (userOpts != null) { userOpts.SetCommonOption("LastWebUpdate", "Web", ChangeDate.DateTimeValue.Value.ToString(), false); } Sage.Platform.WebPortal.Services.IPanelRefreshService refresher = Locator.GetPageWorkItem().Services.Get <IPanelRefreshService>(); if (refresher != null) { refresher.RefreshAll(); } }
/// <summary> /// Gets the last web update. /// </summary> /// <returns></returns> private static DateTime GetLastWebUpdate() { DateTime dt = DateTime.UtcNow; IUserOptionsService userOpts = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (userOpts != null) { try { dt = DateTime.Parse(userOpts.GetCommonOption("LastWebUpdate", "Web", false, dt.ToString(), "LastWebUpdate")); } catch { } } return(dt.Date); }
public void ConfigureUserOptions(IUserOptionsService userOptionsService, UserRoles userRoles) { OptionCategory defaultCategory = new OptionCategory(OptionCategoryIds.General, () => "General"); /* Add options to the following collection and they will be * automatically displayed on the options page. * Each UserOption object must have a unique key. * Lambda expression are used for most of the properties * to allow your app to switch languages without requiring a restart. * You can specify a template for the option by setting its TemplateFunc property. * See the UserOptionBase implementations. */ var generalOptions = new List <IUserOption> { new StringUserOption(() => "String 1", String1Key, () => string1DefaultValue), new BooleanUserOption(() => "Boolean 1", Boolean1Key, () => boolean1DefaultValue) }; userOptionsService.Register(generalOptions, defaultCategory); }
/// <summary> /// Saves the options. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void SaveOption(object sender, EventArgs e) { IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>(); userOption.SetCommonOption(DefaultGroupOptionName(), "DefaultGroup", GetFamNameFromId(ddlGroup.SelectedValue), false); userOption.SetCommonOption(DefaultGroupOptionName(), "LookupLayoutGroup", GetFamNameFromId(ddlLookupLayoutGroup.SelectedValue), false); var egis = GroupContext.GetGroupContext().EntityGroupInfos; if (egis != null) { foreach (var egi in egis) { if (egi.EntityName.Equals(DefaultGroupOptionName(), StringComparison.OrdinalIgnoreCase)) { egi.ClearCache(true); break; } } } userOption.SetCommonOption("defaultLookupCondition", "DefaultLookupCondition", ddlDefaultSearchCondition.SelectedValue, false); }
/// <summary> /// Saves the options. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void SaveOption(object sender, EventArgs e) { IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>(); userOption.SetCommonOption(DefaultGroupOptionName(), "DefaultGroup", GetFamNameFromId(ddlGroup.SelectedValue), false); userOption.SetCommonOption(DefaultGroupOptionName(), "LookupLayoutGroup", GetFamNameFromId(ddlLookupLayoutGroup.SelectedValue), false); var egis = GroupContext.GetGroupContext().EntityGroupInfos; if (egis != null) { foreach (var egi in egis) { if (egi.EntityName.Equals(DefaultGroupOptionName(), StringComparison.OrdinalIgnoreCase)) { egi.ClearCache(true); break; } } } userOption.SetCommonOption("autoFitColumns", "GroupGridView", cbAutoFitColumns.Checked.ToString(CultureInfo.InvariantCulture), false); }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } DateTime dt = DateTime.UtcNow; IUserOptionsService userOpts = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (userOpts != null) { try { dt = DateTime.Parse(userOpts.GetCommonOption("LastWebUpdate", "Web", false, dt.ToString(), "LastWebUpdate")); } catch {} } ChangeDate.DateTimeValue = dt; }
protected void grdProducts_RowDataBound(object sender, GridViewRowEventArgs e) { string oppCurrencyCode; if (e.Row.RowType == DataControlRowType.DataRow) { // added for automation testing e.Row.Attributes.Add("id", string.Format("node_{0}", ((IProduct)((IOpportunityProduct)e.Row.DataItem).Product).Id)); IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (userOption != null) { oppCurrencyCode = userOption.GetCommonOption("lveCurrency", "OpportunityDefaults"); if (string.IsNullOrEmpty(oppCurrencyCode)) { oppCurrencyCode = "USD"; } IExchangeRate rate = EntityFactory.GetById <IExchangeRate>(oppCurrencyCode); // Calculated Price Sage.SalesLogix.Web.Controls.Currency curr = (Sage.SalesLogix.Web.Controls.Currency)e.Row.FindControl("curCalcPriceMC"); if (curr != null) { curr.ExchangeRate = rate.Rate.GetValueOrDefault(1); curr.CurrentCode = rate.Id.ToString(); } //Extended Price Sage.SalesLogix.Web.Controls.Currency curExtPriceMC = (Sage.SalesLogix.Web.Controls.Currency)e.Row.FindControl("curExtPriceMC"); if (curExtPriceMC != null) { curExtPriceMC.ExchangeRate = rate.Rate.GetValueOrDefault(1); curExtPriceMC.CurrentCode = rate.Id.ToString(); } } } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } DateTime searchDate = DateTime.UtcNow; IUserOptionsService userOpts = ApplicationContext.Current.Services.Get <IUserOptionsService>(); if (userOpts != null) { try { searchDate = DateTime.Parse(userOpts.GetCommonOption("LastWebUpdate", "Web", false, searchDate.ToString(), "LastWebUpdate")); SetSelectedSearchType(userOpts.GetCommonOption("WhatsNewSearchType", "Web", false, WhatsNewSearchOptions.SearchTypeEnum.New.ToString(), "WhatsNewSearchType")); } catch (Exception) { } } dteChangeDate.DateTimeValue = searchDate; }
/// <summary> /// Handles the PreRender event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_PreRender(object sender, EventArgs e) { string family = "ACCOUNT"; if (ddlMainView.SelectedItem != null) { family = ddlMainView.SelectedItem.Value; } System.Collections.Generic.IList <Plugin> GroupList = PluginManager.GetPluginList(GroupInfo.GetGroupPluginType(family), true, false); for (int i = GroupList.Count - 1; i >= 0; i--) { if (GroupList[i].Family.ToLower() != family.ToLower()) { GroupList.RemoveAt(i); continue; } if (String.IsNullOrEmpty(GroupList[i].DisplayName)) { GroupList[i].DisplayName = GroupList[i].Name; } } /***** Name Collistion with Blob.PluginId *****************************************************/ //ddlGroup.DataSource = GroupList; //ddlGroup.DataTextField = "DisplayName"; //ddlGroup.DataValueField = "PluginId"; //ddlGroup.DataBind(); /*********************************************************************************************/ ddlGroup.Items.Clear(); ddlLookupLayoutGroup.Items.Clear(); foreach (Plugin gl in GroupList) { ddlGroup.Items.Add(new ListItem(gl.DisplayName, gl.PluginId)); ddlLookupLayoutGroup.Items.Add(new ListItem(gl.DisplayName, gl.PluginId)); } IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>(); string defFamName = userOption.GetCommonOption(DefaultGroupOptionName(), "DefaultGroup"); foreach (Plugin grp in GroupList) { if ((grp.Family.ToLower() == defFamName.Split(':')[0].ToLower()) && (grp.Name == defFamName.Split(':')[1])) { Utility.SetSelectedValue(ddlGroup, grp.PluginId); } } string defLayoutGroup = userOption.GetCommonOption(DefaultGroupOptionName(), "LookupLayoutGroup"); defLayoutGroup = (string.IsNullOrEmpty(defLayoutGroup)) ? defFamName : defLayoutGroup; foreach (Plugin grp in GroupList) { if ((grp.Family.ToLower() == defLayoutGroup.Split(':')[0].ToLower()) && (grp.Name == defLayoutGroup.Split(':')[1])) { Utility.SetSelectedValue(ddlLookupLayoutGroup, grp.PluginId); } } bool autoFitColumns; string autoFitColumnsValue = userOption.GetCommonOption("autoFitColumns", "GroupGridView"); if (!Boolean.TryParse(autoFitColumnsValue, out autoFitColumns)) { autoFitColumns = true; } cbAutoFitColumns.Checked = autoFitColumns; }
protected void Page_Load(object sender, EventArgs e) { m_SLXUserService = ApplicationContext.Current.Services.Get<IUserService>() as SLXUserService; _UserOptions = ApplicationContext.Current.Services.Get<IUserOptionsService>(); _Context = ApplicationContext.Current.Services.Get<IContextService>(true); _TimeZone = (TimeZone)_Context.GetContext("TimeZone"); object cacheDisplayRem = _Context.GetContext("ActivityRemindersDisplay"); if (cacheDisplayRem != null) { string[] temp = cacheDisplayRem.ToString().Split('|'); _DisplayReminders = Convert.ToBoolean(temp[0]); _Alarms = Convert.ToBoolean(temp[1]); _PastDue = Convert.ToBoolean(temp[2]); _Confirms = Convert.ToBoolean(temp[3]); } else { _DisplayReminders = (_UserOptions.GetCommonOption("DisplayActivityReminders", "Calendar") != "F"); _Alarms = (_UserOptions.GetCommonOption("RemindAlarms", "Calendar") != "F"); _PastDue = (_UserOptions.GetCommonOption("RemindPastDue", "Calendar") != "F"); _Confirms = (_UserOptions.GetCommonOption("RemindConfirmations", "Calendar") != "F"); string value = string.Format("{0}|{1}|{2}|{3}", _DisplayReminders, _Alarms, _PastDue, _Confirms); _Context.SetContext("ActivityRemindersDisplay", value); } _UserId = m_SLXUserService.GetUser().Id; }
/// <summary> /// Handles the Click event of the btnFlushCache control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void btnFlushCache_Click(object sender, EventArgs e) { IUserOptionsService _UserOptions = ApplicationContext.Current.Services.Get <IUserOptionsService>(); _UserOptions.ClearCache(); }
/// <summary> /// Handles the PreRender event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_PreRender(object sender, EventArgs e) { GeneralSearchOptions options; options = GeneralSearchOptions.Load(Server.MapPath(_optionsMapPath)); // set defaults Utility.SetSelectedValue(_showOnStartup, GetStartupValFromUrl(options.ShowOnStartup)); if (options.DefaultOwnerTeam != string.Empty) { _defaultOwnerTeam.LookupResultValue = EntityFactory.GetById <IOwner>(options.DefaultOwnerTeam); } Utility.SetSelectedValue(_logToHistory, "T"); const string falseValues = "F,FALSE,N,NO,0"; if (falseValues.IndexOf(options.LogToHistory.ToUpperInvariant()) > -1) { Utility.SetSelectedValue(_logToHistory, "F"); } //Defect 1-80914 // DThompson - "Please only hide the options for now. We may re-enable them in Sawgrass depending on the direction we choose to take." //_promptDuplicateContacts.Checked = options.PromptForDuplicateContacts; //_promptContactNotFound.Checked = options.PromptForContactNotFound; _useActiveReporting.Checked = options.UseActiveReporting; _autoLogoff.Checked = options.AutoLogoff; _logoffDuration.Text = options.LogoffDuration.ToString(); Utility.SetSelectedValue(_logoffUnits, options.LogoffUnits); txtEmailBaseTemplateId.Text = options.EmailBaseTemplate; txtLetterBaseTemplateId.Text = options.LetterBaseTemplate; txtFaxBaseTemplateId.Text = options.FaxBaseTemplate; txtRecentTemplates.Text = options.RecentTemplates; txtFaxProvider.Text = options.FaxProvider; chkPromptForUnsavedData.Checked = options.PromptForUnsavedData; txtEmailBaseTemplate.Text = Utility.GetSingleValue("Name", "Plugin", "PluginId", txtEmailBaseTemplateId.Text); txtLetterBaseTemplate.Text = Utility.GetSingleValue("Name", "Plugin", "PluginId", txtLetterBaseTemplateId.Text); txtFaxBaseTemplate.Text = Utility.GetSingleValue("Name", "Plugin", "PluginId", txtFaxBaseTemplateId.Text); var systemInfo = Sage.Platform.Application.ApplicationContext.Current.Services.Get <Sage.SalesLogix.Services.ISystemOptionsService>(true); if (systemInfo.MultiCurrency) { lblMyCurrency.Visible = true; luMyCurrency.Visible = true; if (!String.IsNullOrEmpty(options.MyCurrencyCode)) { luMyCurrency.LookupResultValue = EntityFactory.GetById <IExchangeRate>(options.MyCurrencyCode); } } else { lblMyCurrency.Visible = false; luMyCurrency.Visible = false; } txtEmailBaseTemplateId.Attributes.Add("style", "display:none"); txtLetterBaseTemplateId.Attributes.Add("style", "display:none"); txtFaxBaseTemplateId.Attributes.Add("style", "display:none"); txtRecentTemplates.Attributes.Add("onchange", "javascript:checkMenuRange()"); var optionSvc = ApplicationContext.Current.Services.Get <Sage.SalesLogix.Services.ISystemOptionsService>(true); int dbType = optionSvc.DbType; const int dbRemote = 2; if (dbType != dbRemote) { // If this is *not* a remote database then hide the "Use ActiveReporting" option. _useActiveReporting.Attributes.Add("style", "display:none"); } IUserOptionsService _UserOptions = ApplicationContext.Current.Services.Get <IUserOptionsService>(); string _group = _UserOptions.GetCommonOption("SyncGroup", "Intellisync"); _defaultOwnerTeam.Enabled = !_UserOptions.GetCommonOptionLocked("InsertSecCodeID", "General"); if (!string.IsNullOrEmpty(_group)) { Utility.SetSelectedValue(_intellisyncGroup, _group); _intellisyncGroup.Enabled = false; } else { _intellisyncGroup.Enabled = true; } bool AllowUserToChange = !_UserOptions.GetCommonOptionLocked("DefaultMemoTemplate", "General"); txtEmailBaseTemplate.Enabled = AllowUserToChange; txtLetterBaseTemplate.Enabled = AllowUserToChange; txtFaxBaseTemplate.Enabled = AllowUserToChange; if (!AllowUserToChange) { txtEmailBaseTemplateImg.Attributes.Add("onclick", ""); txtLetterBaseTemplateImg.Attributes.Add("onclick", ""); txtFaxBaseTemplateImg.Attributes.Add("onclick", ""); } LoadScript(); }
/// <summary> /// Handles the Init event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Init(object sender, EventArgs e) { ScriptManager.GetCurrent(Page).Scripts.Add(new ScriptReference("~/SmartParts/Options/DefaultOpportunityProduct.js")); _Context = ApplicationContext.Current.Services.Get<IContextService>(); _State = _Context.GetContext("AddProductStateInfo") as AddProductStateInfo; if (_State == null) { _State = new AddProductStateInfo(); } _UserOptions = ApplicationContext.Current.Services.Get<IUserOptionsService>(); }
public CalendarOptions(IUserOptionsService userOptionsService) { OptionsService = userOptionsService; }
protected void Page_Load(object sender, EventArgs e) { IContextService context = ApplicationContext.Current.Services.Get <IContextService>(true); if (Page.Request["useWelcomeCriteria"] == "T" && !setWelcomeCriteria) { string timeFrame = (string)context.GetContext("WelcomeSearchTimeframe"); SLXUserService slxUserService = ApplicationContext.Current.Services.Get <IUserService>() as SLXUserService; if (slxUserService != null) { string userid = slxUserService.GetUser().Id.ToString(); // store the Current UserID in the Group context object SetCurrentTab("0", true); FilterManager.SetPersistedData(FilterManager.AppliedFiltersKey, FilterManager.GetWelcomeCriteria(userid, "1")); setWelcomeCriteria = true; } } //ScriptManager.RegisterClientScriptBlock( // Page, // typeof(Page), // "filter-client-script", // String.Format( // @"<script pin=""pin"" type=""text/javascript"" src=""{0}""></script>", // Page.ClientScript.GetWebResourceUrl(typeof(Sage.SalesLogix.Client.GroupBuilder.BaseFilter), "Sage.SalesLogix.Client.GroupBuilder.jscript.Filter_ClientScript.js") // ), // false); /* * ScriptManager.GetCurrent(Page).Scripts.Add( * new ScriptReference("Sage.SalesLogix.Client.GroupBuilder.jscript.Filter_ClientScript.js", * "Sage.SalesLogix.Client.GroupBuilder")); */ IUserOptionsService _UserOptions = ApplicationContext.Current.Services.Get <IUserOptionsService>(true); StringBuilder script = new StringBuilder(); script.AppendFormat( "\nvar {0};$(document).ready(function(){{if (!{0} && (Sage.FilterManager))\n{{ {0} = new Sage.FilterManager({{id: \"{0}\",clientId: \"{1}\", allText: \"({2})\"}});{0}.init();Sage.PopulateFilterList();}}}});\n", ID, ClientID, GetLocalResourceObject("All").ToString()); script.Append("var LocalizedActivityStrings={"); string[] ActivityTypes = new string[] { "atToDo", "atAppointment", "atPhoneCall", "atPersonal", "atLiterature", "Change", "Confirm", "Deleted", "Leader", "New" }; foreach (string v in ActivityTypes) { script.AppendFormat("\"{0}\": \"{1}\", ", v, GetLocalResourceObject(v).ToString()); } script.Append("\"null\": \"null\"};\n"); script.AppendFormat("Sage.FilterStrings={{\"allText\": \"({0})\"}};\n", GetLocalResourceObject("All").ToString()); script.AppendFormat("Sage.AppliedActivityFilterData={0};\n", FilterManager.GetPersistedData(FilterManager.AppliedFiltersKey)); script.AppendFormat("Sage.HiddenActivityFilterData={0};\n", FilterManager.GetPersistedData(FilterManager.HiddenFiltersKey)); ScriptManager.RegisterStartupScript(this.Page, typeof(Page), ID, script.ToString(), true); HyperLink clear = new HyperLink(); clear.NavigateUrl = string.Format("javascript:{0}.ClearFilters();", ID); clear.Attributes.Add("style", "display: block; margin-bottom: 0.5em"); clear.Text = GetLocalResourceObject("Clear_Filters").ToString(); this.Controls.Add(clear); string[] ActivityEntities = { "Activity", "UserNotification", "LitRequest", "Event" }; foreach (string table in ActivityEntities) { IList <BaseFilter> filterList = FilterManager.GetFiltersForEntity(table, this.Page.Server.MapPath(@"Filters\")); foreach (BaseFilter f in filterList) { this.Controls.Add(f); } } edit.NavigateUrl = string.Format("javascript:{0}.EditFilters();", ID); edit.Text = GetLocalResourceObject("Edit_Filters").ToString(); }
/// <summary> /// Handles the Init event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Init(object sender, EventArgs e) { _Context = ApplicationContext.Current.Services.Get<IContextService>(); _State = _Context.GetContext("AddProductStateInfo") as AddProductStateInfo; if (_State == null) { _State = new AddProductStateInfo(); } _UserOptions = ApplicationContext.Current.Services.Get<IUserOptionsService>(); }