Пример #1
0
    /// <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;
    }
Пример #2
0
    /// <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 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>
 /// 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);
     }
 }
    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();
    }
    /// <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;
        }
    }
    /// <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);
    }
Пример #8
0
    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;
        }
    }
Пример #9
0
    /// <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;
    }
Пример #10
0
    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");
    }
    /// <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);
    }
    /// <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;
    }
Пример #13
0
    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 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;
    }
Пример #15
0
    /// <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();
    }
Пример #16
0
    /// <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;
        }

        var 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 Collision 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);
            }
        }

        string defaultLookupCondition = userOption.GetCommonOption("defaultLookupCondition", "DefaultLookupCondition");

        ddlDefaultSearchCondition.ClearSelection();
        foreach (ListItem item in ddlDefaultSearchCondition.Items)
        {
            if (string.Equals(item.Value, defaultLookupCondition))
            {
                item.Selected = true;
                break;
            }
        }
    }
Пример #17
0
    private void SetCommonDefaults()
    {
        ActivityFacade.BindLeaderList(UserId, Activity.UserId);

        //Check if the type is being passed as a Param.
        //This should take precedent over a newly created Type default of atAppointment
        if (GetParam("type") != null)
        {
            //TODO: Refactor OUT all references to atMeeting, OR add atMeeting to the ActivityType enum
            string type = GetParam("type") == "atMeeting" ? "atAppointment" : GetParam("type");
            Activity.Type = (ActivityType)Enum.Parse(typeof(ActivityType), type);
        }

        switch (Activity.Type)
        {
        case ActivityType.atAppointment:
            Result.PickListName      = "Meeting Result Codes";
            Category.PickListName    = "Meeting Category Codes";
            Description.PickListName = "Meeting Regarding";
            break;

        case ActivityType.atPhoneCall:
            Result.PickListName      = "Phone Call Result Codes";
            Category.PickListName    = "Phone Call Category Codes";
            Description.PickListName = "Phone Call Regarding";
            break;

        case ActivityType.atToDo:
            Result.PickListName      = "To Do Result Codes";
            Category.PickListName    = "To Do Category Codes";
            Description.PickListName = "To Do Regarding";
            break;

        case ActivityType.atPersonal:
            Result.PickListName      = "Personal Activity Result Codes";
            Description.PickListName = "Personal Activity Regarding";
            break;

        case ActivityType.atEMail:
            Category.PickListName    = "To Do Category Codes";
            Description.PickListName = "To Do Regarding";
            break;

        case ActivityType.atNote:
            Category.PickListName    = "Note Category Codes";
            Description.PickListName = "Note Regarding";
            break;

        default:
            Result.PickListName = "Meeting Result Codes";
            break;
        }

        Result.PickListValue = Result.DefaultPickListItem;

        if (string.IsNullOrEmpty(Result.PickListValue))
        {
            Result.PickListValue = GetLocalResourceObject("Const_Complete").ToString();
        }

        IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>();
        string defFollowUpActivity     = userOption.GetCommonOption("DefaultFollowupActivity", "ActivityAlarm");
        string followupValue           = "None";

        switch (defFollowUpActivity)
        {
        case ("Phone Call"):
            followupValue = "atPhoneCall";
            break;

        case ("Meeting"):
            followupValue = "atMeeting";
            break;

        case ("To-Do"):
            followupValue = "atToDo";
            break;
        }

        FollowUp.SelectedValue = followupValue;

        string carryOverNotes = userOption.GetCommonOption("CarryOverNotes", "ActivityAlarm");

        CarryOverNotes.Checked = (carryOverNotes != "No") && (carryOverNotes != "F");

        string carryOverAttachments = userOption.GetCommonOption("CarryOverAttachments", "ActivityAlarm");

        CarryOverAttachments.Checked = (carryOverAttachments != "No") && (carryOverAttachments != "F");

        Completed.DateTimeValue = DateTime.UtcNow;
        Scheduled.DateTimeValue = Activity.StartDate;

        Duration.Enabled = !Activity.Timeless;
    }
Пример #18
0
 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;
 }