private void SaveItem()
    {
        if ((string.IsNullOrEmpty(hdPickListItemId.Value)) && (hdMode.Value == "ADD"))
        {
            int      order = System.Convert.ToInt32(txtOrder.Text);
            PickList pl    = PickList.AddNewPickListItem(hdPickListId.Value, txtItemText.Text, txtCode.Text, order, "");
            if (chkIsDefaultItem.Checked)
            {
                PickList.SetAsDefaultItem(hdPickListId.Value, pl.ItemId);
            }
        }
        else
        {
            PickList pl = PickList.GetPickListItemById(hdPickListId.Value, hdPickListItemId.Value);

            pl.Shorttext = txtCode.Text;
            pl.Text      = txtItemText.Text;
            int orderValue = System.Convert.ToInt32(txtOrder.Text);
            pl.Id = orderValue;
            PickList.SavePickListItem(pl);

            if ((chkIsDefaultItem.Checked) && (string.IsNullOrEmpty(hdIsDefault.Value)))
            {
                PickList.SetAsDefaultItem(hdPickListId.Value, pl.ItemId);
            }
            if ((!chkIsDefaultItem.Checked) && (!string.IsNullOrEmpty(hdIsDefault.Value)))
            {
                PickList.SetAsDefaultItem(hdPickListId.Value, "");
            }
        }
        PLS.ClearPickListCache();
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
    /// <summary>
    /// Handles the OnClick event of the cmdCompleteDate 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 cmdCompleteDate_OnClick(object sender, EventArgs e)
    {
        string contextValue = completeDateContext.Value;

        string[]        args         = contextValue.Split(new Char[] { ':' });
        string          spaid        = args[0];
        DateTime        completeDate = ResolveDateTime(args[1]);
        ISalesProcesses salesProcess = Helpers.GetSalesProcess(this.EntityContext.EntityID.ToString());

        string result = salesProcess.CanCompleteStep(spaid);

        if (result == string.Empty)
        {
            salesProcess.CompleteStep(spaid, completeDate);
            salesProcess.Save();
        }
        else
        {
            if (DialogService != null)
            {
                DialogService.ShowMessage(result);
            }
            return;
        }
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
예제 #3
0
 protected void grdPicklistItems_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.Equals("Edit"))
     {
         int rowIndex = Convert.ToInt32(e.CommandArgument);
         if (DialogService != null)
         {
             DialogService.SetSpecs(245, 600, "AddEditPickListItem");
             DialogService.DialogParameters.Clear();
             DialogService.DialogParameters.Add("MODE", "EDIT");
             DialogService.DialogParameters.Add("PickListId", grdPicklistItems.DataKeys[rowIndex].Values[1].ToString());
             DialogService.DialogParameters.Add("PickListItemId", grdPicklistItems.DataKeys[rowIndex].Values[0].ToString());
             DialogService.ShowDialog();
         }
         return;
     }
     if (e.CommandName.Equals("Delete"))
     {
         int rowIndex = Convert.ToInt32(e.CommandArgument);
         PickList.DeletePickListItem(grdPicklistItems.DataKeys[rowIndex].Values[1].ToString(), grdPicklistItems.DataKeys[rowIndex].Values[0].ToString());
         IPickListService pls = ApplicationContext.Current.Services.Get <IPickListService>();
         if (pls != null)
         {
             pls.ClearPickListCache();
         }
         IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();
         refresher.RefreshAll();
     }
 }
    /// <summary>
    /// Handles the SelectedIndexChanged event of the ddlStages 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 ddlStages_SelectedIndexChanged(object sender, EventArgs e)
    {
        object manageStagesDialog = Page.Session["MANAGESTAGESACTIVE"];

        if (manageStagesDialog != null)
        {
            return;
        }

        string          stageId      = ddlStages.SelectedItem.Value;
        ISalesProcesses salesProcess = Helpers.GetSalesProcess(this.EntityContext.EntityID.ToString());
        string          result       = salesProcess.CanMoveToStage(stageId);

        if (result == string.Empty)
        {
            salesProcess.SetToCurrentStage(stageId);
            salesProcess.Save();
        }
        else
        {
            if (DialogService != null)
            {
                DialogService.ShowMessage(result);
            }
        }
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
예제 #5
0
    /// <summary>
    /// Handles the OnClick event of the cmdSave 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 cmdSave_OnClick(object sender, EventArgs e)
    {
        ICampaignStage stage = BindingSource.Current as ICampaignStage;

        stage.Save();
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
    /// <summary>
    /// Called when [my dialog closing].
    /// </summary>
    /// <param name="from">From.</param>
    /// <param name="e">The <see cref="Sage.Platform.WebPortal.Services.WebDialogClosingEventArgs"/> instance containing the event data.</param>
    protected override void OnMyDialogClosing(object from, WebDialogClosingEventArgs e)
    {
        base.OnMyDialogClosing(from, e);
        //we nned to refresh the salesprocess page or we will get un wanted postbacks on the Stages DDL.
        Session.Remove("MANAGESTAGESACTIVE");
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
예제 #7
0
    public void OnStepClosing(object from, WebDialogClosingEventArgs e)
    {
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        if (refresher != null)
        {
            refresher.RefreshAll();
        }
    }
예제 #8
0
    /// <summary>
    /// Refreshes the active tab.
    /// </summary>
    private void RefreshActiveTab()
    {
        IPanelRefreshService refresher = Locator.GetPageWorkItem().Services.Get <IPanelRefreshService>();

        if (refresher != null)
        {
            refresher.RefreshAll();
        }
    }
예제 #9
0
    /// <summary>
    /// Handles the OnClick event of the cmdSave 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 cmdSave_OnClick(object sender, EventArgs e)
    {
        ICampaignStage stage = this.BindingSource.Current as ICampaignStage;

        stage.Save();
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
        DialogService.CloseEventHappened(sender, e); //Close Dialog
    }
예제 #10
0
    /// <summary>
    /// Handles the OnClick event of the btnSave 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 btnSave_OnClick(object sender, EventArgs e)
    {
        SaveActionState(true);
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        if (refresher != null)
        {
            refresher.RefreshAll();
        }
    }
예제 #11
0
    /// <summary>
    /// Handles the OnClick event of the cmdSave 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 cmdSave_OnClick(object sender, EventArgs e)
    {
        ICampaignTask task = BindingSource.Current as ICampaignTask;

        ResolveOwner(task);
        task.Save();

        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
예제 #12
0
 protected override void OnPreRender(EventArgs e)
 {
     if (this.Visible)
     {
         InitializeState();
         if (!string.IsNullOrEmpty(MarkUsedInfo.Value))
         {
             SetItemAsUsed();
             MarkUsedInfo.Value = string.Empty;
         }
         if (!string.IsNullOrEmpty(ReturnResultAction.Value))
         {
             ReturnResult();
             ReturnResultAction.Value = string.Empty;
             WebPortalPage page = Page as WebPortalPage;
             if (page != null)
             {
                 IPanelRefreshService refresher = page.PageWorkItem.Services.Get <IPanelRefreshService>();
                 if (refresher != null)
                 {
                     refresher.RefreshAll();
                 }
             }
         }
         if (!string.IsNullOrEmpty(currentIndex.Value))
         {
             Literal document = new Literal();
             if (currentIndex.Value.Equals("NoAccess"))
             {
                 document.Text = GetLocalResourceObject("SpeedSearch_Result_NoAccess").ToString();
             }
             else
             {
                 int index = (string.IsNullOrEmpty(CurrentPageIndex.Value)) ? 0 : int.Parse(CurrentPageIndex.Value);
                 whichResultsPage = index;
                 //SpeedSearchWebService.SpeedSearchService ss = new SpeedSearchWebService.SpeedSearchService();
                 //ss.Url = ConfigurationManager.AppSettings.Get("SpeedSearchWebService.SpeedSearchService");
                 SpeedSearchService ss  = new SpeedSearchService();
                 SpeedSearchQuery   ssq = BuildQuery();
                 ssq.DocTextItem = int.Parse(currentIndex.Value);
                 string xml = ss.DoSpeedSearch(ssq.GetAsXml());
                 Results       = SpeedSearchResults.LoadFromXml(xml);
                 document.Text = Results.Items[0].HighlightedDoc;
             }
             currentIndex.Value   = "";
             FirstPage.Visible    = true;
             PreviousPage.Visible = true;
             NextPage.Visible     = true;
             LastPage.Visible     = true;
             //SearchDocumentPanel.ContentTemplateContainer.Controls.Add(document);
         }
     }
     base.OnPreRender(e);
 }
예제 #13
0
    /// <summary>
    /// Handles the Click event of the cmdOK 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 cmdOK_Click(object sender, EventArgs e)
    {
        SaveOptions();
        DialogService.CloseEventHappened(sender, e);
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        if (refresher != null)
        {
            refresher.RefreshAll();
        }
    }
    /// <summary>
    /// Handles the SelectedIndexChanged event of the ddLSalesProcess 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 ddLSalesProcess_SelectedIndexChanged(object sender, EventArgs e)
    {
        string          opportunityId = this.EntityContext.EntityID.ToString();
        string          pluginID      = ddLSalesProcess.SelectedItem.Value;
        ISalesProcesses salesProcess  = EntityFactory.Create <ISalesProcesses>();

        salesProcess.InitSalesProcess(pluginID, opportunityId);
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
예제 #15
0
    /// <summary>
    /// Refreshes the data.
    /// </summary>
    protected void RefreshData()
    {
        IPanelRefreshService refreshService = PageWorkItem.Services.Get <IPanelRefreshService>();

        if (refreshService != null)
        {
            refreshService.RefreshAll();
        }
        else
        {
            Response.Redirect(Request.Url.ToString());
        }
    }
예제 #16
0
        public static void btnOK_OnClickStep(IQuickInsertAccountContact form, EventArgs args)
        {
            IUser    currentUser = MySlx.Security.CurrentSalesLogixUser;
            IContact contact     = form.CurrentEntity as IContact;
            IAccount account     = EntityFactory.Create <IAccount>();

            IAddress ad = EntityFactory.Create <IAddress>();

            ad.Description = contact.Address.Description;
            ad.Address1    = contact.Address.Address1;
            ad.Address2    = contact.Address.Address2;
            ad.Address3    = contact.Address.Address3;
            ad.Address4    = contact.Address.Address4;
            ad.City        = contact.Address.City;
            ad.State       = contact.Address.State;
            ad.PostalCode  = contact.Address.PostalCode;
            ad.Country     = contact.Address.Country;
            ad.County      = contact.Address.County;
            ad.Salutation  = contact.Address.Salutation;

            account.Address        = ad;
            account.AccountName    = form.txtAccount.Text;
            account.AccountManager = currentUser;
            account.Owner          = currentUser.DefaultOwner;
            account.Type           = form.pklType.PickListValue;
            account.MainPhone      = form.phAccountMain.Text;

            contact.Account        = account;
            contact.AccountManager = currentUser;
            contact.Owner          = currentUser.DefaultOwner;
            contact.SaveContactAccount(account);

            ISelectionService srv     = ApplicationContext.Current.Services.Get <ISelectionService>(true);
            ISelectionContext sc      = new SimpleSelectionContext();
            SelectionInfo     selInfo = new SelectionInfo();
            SelectionItem     item    = new SelectionItem {
                Id = contact.Id.ToString()
            };

            selInfo.Selections.Add(item);
            sc.Key           = "QuickInsertAccountContact";
            sc.SelectionInfo = selInfo;
            srv.SetSelectionContext(sc.Key, sc);

            IPanelRefreshService refresher = form.Services.Get <IPanelRefreshService>();

            if (refresher != null)
            {
                refresher.RefreshAll();
            }
        }
예제 #17
0
 public void RefreshPage()
 {
     if (PageWorkItem != null)
     {
         IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();
         if (refresher != null)
         {
             refresher.RefreshAll();
         }
     }
     else
     {
         Response.Redirect(Request.Url.ToString());
     }
 }
        /// <summary>
        /// Sets the flag, LostReplaced, on the opportunity competitor indicating that this opportunity
        /// competitor was associated as a competitor lost to.
        /// </summary>
        /// <param name="form">The opportunity closed lost form.</param>
        /// <param name="args">The event arguments.<see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void lueCompetitorLoss_OnChange(IOpportunityClosedLost form, EventArgs args)
        {
            ICompetitor competitor = form.lueCompetitorLoss.LookupResultValue as ICompetitor;

            if (competitor != null)
            {
                IOpportunity opportunity = form.CurrentEntity as IOpportunity;
                opportunity.SetOppCompetitorReplacedFlag(competitor);
            }

            IPanelRefreshService panelRefresh = form.Services.Get <IPanelRefreshService>();

            if (panelRefresh != null)
            {
                panelRefresh.RefreshMainWorkspace();
            }
        }
    /// <summary>
    /// Handles the OnClick event of the cmdCompleteStep 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 cmdCompleteStep_OnClick(object sender, EventArgs e)
    {
        string stepContextValue = stepContext.Value;

        string[]        args         = stepContextValue.Split(new Char[] { ':' });
        string          spaid        = args[0];
        ISalesProcesses salesProcess = Helpers.GetSalesProcess(this.EntityContext.EntityID.ToString());

        if (args[1] == "False")
        {
            string result = salesProcess.CanCompleteStep(spaid);
            if (result == string.Empty)
            {
                salesProcess.CompleteStep(spaid, DateTime.Now);
                salesProcess.Save();
            }
            else
            {
                if (DialogService != null)
                {
                    DialogService.ShowMessage(result);
                }
                return;
            }
        }
        else
        {
            salesProcess.UnCompleteStep(spaid);
            salesProcess.Save();
        }

        if (ddlStages.SelectedItem != null)
        {
            if (ddlStages.SelectedItem.Value != salesProcess.CurrentStageId)
            {
                ddlStages.SelectedIndex = ddlStages.Items.IndexOf(ddlStages.Items.FindByValue(salesProcess.CurrentStageId));
            }
        }

        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();

        this.UpdateSnapShot();
    }
예제 #20
0
 protected void cmdSchedule_Click(object sender, EventArgs e)
 {
     if (lueContactToScheduleFor.LookupResultValue == null)
     {
         throw new ValidationException(GetLocalResourceObject("error_ScheduleFor.Message").ToString());
     }
     try
     {
         LoadOwner();
         if (cboProcessType.DataSource != null)
         {
             Plugin   selectedPlugin = ((IList <Plugin>)cboProcessType.DataSource)[cboProcessType.SelectedIndex];
             object[] objarray       = new[]
             {
                 lueContactToScheduleFor.LookupResultValue,
                 selectedPlugin.PluginId,
                 selectedPlugin.Family,
                 selectedPlugin.Name,
                 ownProcessOwner.LookupResultValue
             };
             Sage.Platform.Orm.DynamicMethodLibraryHelper.Instance.Execute("Contact.ScheduleProcess", objarray);
             DialogService.CloseEventHappened(sender, e);
             IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>(true);
             refresher.RefreshTabWorkspace();
         }
         else
         {
             DialogService.ShowMessage(GetLocalResourceObject("Error_ProcessTypes").ToString(), "SalesLogix");
         }
     }
     catch (Exception ex)
     {
         string sSlxErrorId = null;
         var    sMsg        = ErrorHelper.GetClientErrorHtmlMessage(ex, ref sSlxErrorId);
         if (!string.IsNullOrEmpty(sSlxErrorId))
         {
             log.Error(
                 ErrorHelper.AppendSlxErrorId(
                     "The call to SmartParts_Process_ScheduleProcess.cmdSchedule_Click failed", sSlxErrorId), ex);
         }
         DialogService.ShowHtmlMessage(sMsg, ErrorHelper.IsDevelopmentContext() ? 600 : -1,
                                       ErrorHelper.IsDevelopmentContext() ? 800 : -1);
     }
 }
예제 #21
0
    /// <summary>
    /// Handles the OnClick event of the cmdCompleteStep 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 cmdCompleteStep_OnClick(object sender, EventArgs e)
    {
        //================================================================
        //  Templates are Not Completed
        //================================================================
        int    rowIndex = Convert.ToInt32(rowContext.Value);
        string id       = grdStages.DataKeys[rowIndex].Value.ToString();

        string[] result = id.Split(':');

        if (DialogService != null)
        {
            if (result[1] == "S")
            {
                IOppFulFilStage stage = EntityFactory.GetById <IOppFulFilStage>(result[0]);
                foreach (IOppFulFilTask tmpTSK in stage.OppFulFilTasks)
                {
                    if (tmpTSK.Completed == "T")
                    {
                        //if (tmpTSK.Completed == true) {
                        // Do Nothing as it is allready completed
                    }
                    else
                    {
                        tmpTSK.CompleteTask();
                    }
                }

                // Run Complete Stage Business Rule
            }
            else if (result[1] == "T")
            {
                IOppFulFilTask Task = EntityFactory.GetById <IOppFulFilTask>(result[0]);
                Task.CompleteTask();
            }
        }

        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
        LoadView();
    }
    /// <summary>
    /// Handles the SelectedIndexChanged event of the ddLSalesProcess 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 ddLSalesProcess_SelectedIndexChanged(object sender, EventArgs e)
    {
        string          opportunityId = this.EntityContext.EntityID.ToString();
        string          pluginID      = ddLSalesProcess.SelectedItem.Value;
        ISalesProcesses salesProcess  = EntityFactory.Create <ISalesProcesses>();

        salesProcess.InitSalesProcess(pluginID, opportunityId);
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        this.UpdateSnapShot();
        if (_salesProcess != null)
        {
            IList <ISalesProcessAudit> list = _salesProcess.GetSalesProcessAudits();
            LoadStagesDropDown(list);
        }
        else
        {
            LoadStagesDropDown(null);
        }
        refresher.RefreshAll();
    }
    private void SaveItem()
    {
        if (String.IsNullOrEmpty(txtItemText.Text))
        {
            throw new ValidationException(GetLocalResourceObject("error_InvalidItemName").ToString());
        }
        if ((string.IsNullOrEmpty(hdPickListItemId.Value)) && (hdMode.Value == "ADD"))
        {
            int      order = Convert.ToInt32(txtOrder.Text);
            PickList pl    = PickList.AddNewPickListItem(hdPickListId.Value, txtItemText.Text, txtCode.Text, order, "");
            if (chkIsDefaultItem.Checked)
            {
                PickList.SetAsDefaultItem(hdPickListId.Value, pl.ItemId);
            }
        }
        else
        {
            PickList pl = PickList.GetPickListItemById(hdPickListId.Value, hdPickListItemId.Value);
            pl.Shorttext = txtCode.Text;
            pl.Text      = txtItemText.Text;
            int orderValue = Convert.ToInt32(txtOrder.Text);
            pl.Id = orderValue;
            PickList.SavePickListItem(pl);

            if ((chkIsDefaultItem.Checked) && (string.IsNullOrEmpty(hdIsDefault.Value)))
            {
                PickList.SetAsDefaultItem(hdPickListId.Value, pl.ItemId);
            }
            if ((!chkIsDefaultItem.Checked) && (!string.IsNullOrEmpty(hdIsDefault.Value)))
            {
                PickList.SetAsDefaultItem(hdPickListId.Value, "");
            }
        }
        PLS.ClearPickListCache();
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
    /// <summary>
    /// Handles the OnClick event of the cmdExternalList 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 cmdExternalList_OnClick(object sender, EventArgs e)
    {
        ICampaign campaign = GetParentEntity() as ICampaign;

        if (campaign != null)
        {
            if (txtConfirmExternalList.Value.Equals("T"))
            {
                campaign.UseExternalList = true;
                Rules.DeleteCampaignTargets(campaign);
                IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();
                refresher.RefreshMainWorkspace();
            }
            else //still need to post changes to 'External List' properties
            {
                campaign.UseExternalList           = false;
                campaign.TargetAudienceList        = null;
                campaign.TargetAudienceLocation    = null;
                campaign.TargetAudienceTargetCount = null;
                campaign.Save();
            }
        }
    }
예제 #25
0
    protected void grdProducts_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Page")
        {
            return;
        }
        int rowIndex;

        if (Int32.TryParse(e.CommandArgument.ToString(), out rowIndex))
        {
            dtsProducts.SelectedIndex = rowIndex;
            if (e.CommandName.Equals("Delete"))
            {
                if (grdProducts.DataKeys[0].Values.Count > 0)
                {
                    ITargetResponse targetResponse = BindingSource.Current as ITargetResponse;
                    if (targetResponse != null)
                    {
                        IResponseProduct responseProduct = EntityFactory.GetRepository <IResponseProduct>().Get(grdProducts.DataKeys[rowIndex].Values[0].ToString());
                        if (responseProduct != null)
                        {
                            targetResponse.ResponseProducts.Remove(responseProduct);
                            responseProduct.Delete();
                            if (PageWorkItem != null)
                            {
                                IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();
                                if (refresher != null)
                                {
                                    refresher.RefreshAll();
                                }
                            }
                        }
                    }
                }
            }
        }
    }
        /// <summary>
        /// Performs the password validation rules. If validation fails an exception is raised from the
        /// ValidateUserPassword method. If validation succeeds, but the password was changed
        /// to an empty string that result is returned, which will be displayed to the UI.
        /// </summary>
        /// <param name="form">The change password form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void btnSave_OnClick(IUserChangePassword form, EventArgs args)
        {
            string newPassword = form.txtNewPassword.Text;

            if (newPassword == form.txtConfirmPassword.Text)
            {
                IUser user = (IUser)form.CurrentEntity;

                if (user.ValidateUserPassword(newPassword))
                {
                    IWebDialogService dialogService = form.Services.Get <IWebDialogService>();
                    user.SavePassword(newPassword);
                    var slxUserService = (ISlxUserService)ApplicationContext.Current.Services.Get <IUserService>(true);
                    var currentUser    = slxUserService.GetUser();
                    if (user.UserName == currentUser.UserName)
                    {
                        var data = (SLXDataService)ApplicationContext.Current.Services.Get <IDataService>(true);
                        var auth = (SLXWebAuthenticationProvider)data.AuthenticationProvider;
                        auth.AuthenticateWithContext(currentUser.UserName, newPassword);
                    }

                    form.lblInvalidPassword.Text = newPassword.Length == 0 ? form.GetResource("PasswordBlank").ToString() : String.Empty;
                    dialogService.ShowMessage(form.GetResource(newPassword.Length == 0 ? "PasswordBlank" : "PasswordChanged").ToString());
                    dialogService.CloseEventHappened(form, null);
                    IPanelRefreshService refresher = form.Services.Get <IPanelRefreshService>();
                    if (refresher != null)
                    {
                        refresher.RefreshAll();
                    }
                }
            }
            else
            {
                throw new ValidationException(form.GetResource("Error_PasswordsDontMatch").ToString());
            }
        }
예제 #27
0
    /// <summary>
    /// Handles the ClickActionBRC event of the btnSave 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 btnSave_ClickActionBRC(object sender, EventArgs e)
    {
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
예제 #28
0
    protected void cmdOK_Click(object sender, EventArgs e)
    {
        StringBuilder xml = new StringBuilder("<xml xmlns:z='#RowsetSchema' xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'>");

        xml.Append("<s:Schema id='RowsetSchema'>");
        xml.Append("<s:ElementType name='row' content='eltOnly' rs:updatable='true'>");
        xml.Append("<s:AttributeType name='SORT' rs:number='1' rs:write='true'>");
        xml.Append("<s:datatype dt:type='int' dt:maxLength='4' rs:precision='0'");
        xml.Append(" rs:fixedlength='true' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='PRODUCTID' rs:number='2' rs:write='true'>");
        xml.Append("<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='12'");
        xml.Append(" rs:precision='0' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='KEYFIELDID' rs:number='3' rs:write='true'>");
        xml.Append("<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='16'");
        xml.Append(" rs:precision='0' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='PRODUCT' rs:number='4' rs:write='true'>");
        xml.Append("<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='64'");
        xml.Append(" rs:precision='0' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='FAMILY' rs:number='5' rs:write='true'>");
        xml.Append("<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='64'");
        xml.Append(" rs:precision='0' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='PRICELEVEL' rs:number='6' rs:write='true'>");
        xml.Append("<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='32'");
        xml.Append(" rs:precision='0' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='PRICE' rs:number='7' rs:write='true'>");
        xml.Append("<s:datatype dt:type='number' rs:dbtype='currency' dt:maxLength='8'");
        xml.Append(" rs:precision='0' rs:fixedlength='true' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='DISCOUNT' rs:number='8' rs:write='true'>");
        xml.Append(" <s:datatype dt:type='float' dt:maxLength='8' rs:precision='0'");
        xml.Append(" rs:fixedlength='true' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='ADJPRICE' rs:number='9' rs:write='true'>");
        xml.Append(" <s:datatype dt:type='number' rs:dbtype='currency' dt:maxLength='8'");
        xml.Append(" rs:precision='0' rs:fixedlength='true' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='PRICELOCAL' rs:number='10' rs:write='true'>");
        xml.Append(" <s:datatype dt:type='number' rs:dbtype='currency' dt:maxLength='8'");
        xml.Append(" rs:precision='0' rs:fixedlength='true' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='QUANTITY' rs:number='11' rs:write='true'>");
        xml.Append(" <s:datatype dt:type='float' dt:maxLength='8' rs:precision='0'");
        xml.Append(" rs:fixedlength='true' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='EXTENDED' rs:number='12' rs:write='true'>");
        xml.Append(" <s:datatype dt:type='number' rs:dbtype='currency' dt:maxLength='8'");
        xml.Append(" rs:precision='0' rs:fixedlength='true' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:AttributeType name='EXTENDEDLOCAL' rs:number='13'");
        xml.Append(" rs:write='true'>");
        xml.Append(" <s:datatype dt:type='number' rs:dbtype='currency' dt:maxLength='8'");
        xml.Append(" rs:precision='0' rs:fixedlength='true' rs:maybenull='false'/>");
        xml.Append("</s:AttributeType>");
        xml.Append("<s:extends type='rs:rowbase'/>");
        xml.Append("</s:ElementType>");
        xml.Append("</s:Schema>");
        xml.Append("<rs:data>");
        string rowstring = "<z:row SORT='{0}' PRODUCTID='{1}' KEYFIELDID='{11}' PRODUCT='{2}' FAMILY='{12}' PRICELEVEL='{3}' PRICE='{4}' DISCOUNT='{5}' ADJPRICE='{6}' PRICELOCAL='{7}' QUANTITY='{8}' EXTENDED='{9}' EXTENDEDLOCAL='{10}' />";

        foreach (IOpportunityProduct op in DefOppProdHelper.GetList())
        {
            xml.AppendFormat(rowstring, op.Sort, op.Product.Id, op.Product.Name, op.Program, op.Price, op.Discount, op.CalculatedPrice, op.CalculatedPrice, op.Quantity, op.ExtendedPrice, op.ExtendedPrice, op.Id, op.Product.Family);
        }
        xml.Append("</rs:data></xml>");
        _UserOptions.SetCommonOption("Products", "OpportunityDefaults", xml.ToString(), false);

        Sage.Platform.WebPortal.WebPortalPage wpPage = Page as Sage.Platform.WebPortal.WebPortalPage;
        IPanelRefreshService refresher = wpPage.PageWorkItem.Services.Get <IPanelRefreshService>();

        if (refresher != null)
        {
            refresher.RefreshAll();
        }
    }
예제 #29
0
    /// <summary>
    /// Handles the RowCommand event of the grdStages control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewCommandEventArgs"/> instance containing the event data.</param>
    protected void grdStages_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("AddTask"))
        {
            int      rowIndex = Convert.ToInt32(e.CommandArgument);
            string   id       = grdStages.DataKeys[rowIndex].Value.ToString();
            string[] result   = id.Split(':');

            if (DialogService != null)
            {
                if (result[1] == "S")
                {
                    //DialogService.SetSpecs(200, 200, 550, 700, "AddEditTask", "Add Task", true);
                    //DialogService.EntityType = typeof(ICampaignTask);
                    //DialogService.DialogParameters.Add("StageId", result[0]);
                    //DialogService.DialogParameters.Add("Mode", "Add");
                    //DialogService.ShowDialog();
                    // InsertChildDialogActionItem
                    DialogService.SetSpecs(400, 700, "AddEditFulFilmentTemplateTask", "Add Task");
                    DialogService.EntityType = typeof(Sage.Entity.Interfaces.IFulFilTemplateTask);
                    //DialogService.SetChildIsertInfo(
                    //  typeof(Sage.Entity.Interfaces.IFulFilTemplateTask),
                    //  typeof(Sage.Entity.Interfaces.IFulFilTemplateStage),
                    //  typeof(Sage.Entity.Interfaces.IFulFilTemplateStage).GetProperty("FulFilmentTemplateStage"),
                    //  typeof(Sage.Entity.Interfaces.IFulFilTemplateStage).GetProperty("FulFilTemplateTasks"));
                    DialogService.DialogParameters.Add("StageId", result[0]);
                    DialogService.ShowDialog();
                }
            }
        }

        if (e.CommandName.Equals("Edit"))
        {
            int      rowIndex = Convert.ToInt32(e.CommandArgument);
            string   id       = grdStages.DataKeys[rowIndex].Value.ToString();
            string[] result   = id.Split(':');

            if (DialogService != null)
            {
                if (result[1] == "S")
                {
                    // QFDataGrid
                    DialogService.SetSpecs(400, 600, "AddEditFulilmentTemplateStage", "Edit Stage");
                    DialogService.EntityType = typeof(Sage.Entity.Interfaces.IFulFilTemplateStage);
                    DialogService.EntityID   = result[0];
                    DialogService.ShowDialog();
                }
                else if (result[1] == "T")
                {
                    // QFDataGrid
                    DialogService.SetSpecs(400, 700, "AddEditFulFilmentTemplateTask", "Edit Task");
                    DialogService.EntityType = typeof(Sage.Entity.Interfaces.IFulFilTemplateTask);
                    DialogService.EntityID   = result[0];
                    DialogService.ShowDialog();
                }
            }
        }
        if (e.CommandName.Equals("Complete"))
        {
            //================================================================
            //  Templates are Not Completed
            //================================================================
            //int rowIndex = Convert.ToInt32(e.CommandArgument);
            //string id = grdStages.DataKeys[rowIndex].Value.ToString();
            //string[] result = id.Split(':');

            //if (DialogService != null)
            //{
            //    if (result[1] == "S")
            //    {
            //        DialogService.SetSpecs(200, 200, 550, 700, "AddEditStage", "Complete Stage", true);
            //        DialogService.EntityType = typeof(ICampaignStage);
            //        DialogService.EntityID = result[0];
            //        DialogService.DialogParameters.Add("Mode", "Complete");
            //        DialogService.ShowDialog();
            //    }
            //    else if (result[1] == "T")
            //    {
            //        DialogService.SetSpecs(200, 200, 550, 700, "AddEditTask", "Complete Task", true);
            //        DialogService.EntityType = typeof(ICampaignTask);
            //        DialogService.EntityID = result[0];
            //        DialogService.DialogParameters.Add("Mode", "Complete");
            //        DialogService.ShowDialog();
            //    }
            //}
        }

        if (e.CommandName.Equals("Delete"))
        {
            int      rowIndex = Convert.ToInt32(e.CommandArgument);
            string   Id       = grdStages.DataKeys[rowIndex].Value.ToString();
            string[] result   = Id.Split(':');
            if (result[1] == "S")  //Stage
            {
                IFulFilTemplateStage stage = EntityFactory.GetById <IFulFilTemplateStage>(result[0]);
                if (stage != null)
                {
                    //stage.Campaign.CampaignStages.Remove(stage);
                    stage.Delete();
                }
            }
            else if (result[1] == "T") //Task
            {
                IFulFilTemplateTask task = EntityFactory.GetById <IFulFilTemplateTask>(result[0]);
                if (task != null)
                {
                    //task.CampaignStage.CampaignTasks.Remove(task);
                    //task.Campaign.CampaignTasks.Remove(task);
                    task.Delete();
                }
            }
        }
        if (PageWorkItem != null)
        {
            IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();
            if (refresher != null)
            {
                refresher.RefreshAll();
            }
        }
    }
예제 #30
0
    /// <summary>
    /// Handles the RowCommand event of the grdStages control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewCommandEventArgs"/> instance containing the event data.</param>
    protected void grdStages_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("AddTask"))
        {
            int      rowIndex = Convert.ToInt32(e.CommandArgument);
            string   id       = grdStages.DataKeys[rowIndex].Value.ToString();
            string[] result   = id.Split(':');

            if (DialogService != null)
            {
                if (result[1] == "S")
                {
                    //DialogService.SetSpecs(200, 200, 550, 700, "AddEditTask", "Add Task", true);
                    //DialogService.EntityType = typeof(ICampaignTask);
                    //DialogService.DialogParameters.Add("StageId", result[0]);
                    //DialogService.DialogParameters.Add("Mode", "Add");
                    //DialogService.ShowDialog();
                    // InsertChildDialogActionItem
                    DialogService.SetSpecs(400, 700, "AddEditTask", "Add Task");
                    DialogService.EntityType = typeof(Sage.Entity.Interfaces.IOppFulFilTask);
                    //DialogService.SetChildIsertInfo(
                    //  typeof(Sage.Entity.Interfaces.IFulFilTemplateTask),
                    //  typeof(Sage.Entity.Interfaces.IFulFilTemplateStage),
                    //  typeof(Sage.Entity.Interfaces.IFulFilTemplateStage).GetProperty("FulFilmentTemplateStage"),
                    //  typeof(Sage.Entity.Interfaces.IFulFilTemplateStage).GetProperty("FulFilTemplateTasks"));
                    DialogService.DialogParameters.Add("StageId", result[0]);
                    DialogService.ShowDialog();
                }
            }
        }

        if (e.CommandName.Equals("Edit"))
        {
            int      rowIndex = Convert.ToInt32(e.CommandArgument);
            string   id       = grdStages.DataKeys[rowIndex].Value.ToString();
            string[] result   = id.Split(':');

            if (DialogService != null)
            {
                if (result[1] == "S")
                {
                    // QFDataGrid
                    DialogService.SetSpecs(400, 600, "AddEditStage", "Edit Stage");
                    DialogService.EntityType = typeof(Sage.Entity.Interfaces.IOppFulFilStage);
                    DialogService.EntityID   = result[0];
                    DialogService.ShowDialog();
                }
                else if (result[1] == "T")
                {
                    // QFDataGrid
                    DialogService.SetSpecs(400, 700, "AddEditTask", "Edit Task");
                    DialogService.EntityType = typeof(Sage.Entity.Interfaces.IOppFulFilTask);
                    DialogService.EntityID   = result[0];
                    DialogService.ShowDialog();
                }
            }
        }
        if (e.CommandName.Equals("Complete"))
        {
            //================================================================
            //  Templates are Not Completed
            //================================================================
            int      rowIndex = Convert.ToInt32(e.CommandArgument);
            string   id       = grdStages.DataKeys[rowIndex].Value.ToString();
            string[] result   = id.Split(':');

            if (DialogService != null)
            {
                if (result[1] == "S")
                {
                    IOppFulFilStage stage = EntityFactory.GetById <IOppFulFilStage>(result[0]);
                    foreach (IOppFulFilTask tmpTSK in stage.OppFulFilTasks)
                    {
                        if (tmpTSK.Completed == "T")
                        //if (tmpTSK.Completed == true)
                        {
                            // Do Nothing as it is allready completed
                        }
                        else
                        {
                            //Sage.SalesLogix.Security.SLXUserService usersvc = (Sage.SalesLogix.Security.SLXUserService)Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>();
                            //Sage.Entity.Interfaces.IUser user = usersvc.GetUser();
                            //tmpTSK.Completed = "T";
                            //tmpTSK.CompletedBy = usersvc.UserId.ToString();
                            //tmpTSK.CompletedDate = System.DateTime.Now.ToUniversalTime();
                            //tmpTSK.Status = "Completed";
                            ////tmpTSK.WeightedPercentage  = 1;
                            //tmpTSK.Save();
                            tmpTSK.CompleteTask();
                        }
                    }

                    // Run Complete Stage Business Rule
                    //DialogService.SetSpecs(200, 200, 550, 700, "AddEditStage", "Complete Stage", true);
                    //DialogService.EntityType = typeof(ICampaignStage);
                    //DialogService.EntityID = result[0];
                    //DialogService.DialogParameters.Add("Mode", "Complete");
                    //DialogService.ShowDialog();
                }
                else if (result[1] == "T")
                {
                    IOppFulFilTask Task = EntityFactory.GetById <IOppFulFilTask>(result[0]);
                    //Sage.SalesLogix.Security.SLXUserService usersvc = (Sage.SalesLogix.Security.SLXUserService)Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>();
                    //Sage.Entity.Interfaces.IUser user = usersvc.GetUser();
                    //Task.Completed = "T";
                    //Task.CompletedBy = usersvc.UserId.ToString();
                    //Task.CompletedDate = System.DateTime.Now.ToUniversalTime();
                    //Task.Status = "Completed";
                    ////Task.PercentageComplete = 1;
                    //Task.Save();
                    Task.CompleteTask();



                    //DialogService.SetSpecs(200, 200, 550, 700, "AddEditTask", "Complete Task", true);
                    //DialogService.EntityType = typeof(ICampaignTask);
                    //DialogService.EntityID = result[0];
                    //DialogService.DialogParameters.Add("Mode", "Complete");
                    //DialogService.ShowDialog();
                }
            }
        }

        if (e.CommandName.Equals("Delete"))
        {
            int      rowIndex = Convert.ToInt32(e.CommandArgument);
            string   Id       = grdStages.DataKeys[rowIndex].Value.ToString();
            string[] result   = Id.Split(':');
            if (result[1] == "S")  //Stage
            {
                IOppFulFilStage stage = EntityFactory.GetById <IOppFulFilStage>(result[0]);
                if (stage != null)
                {
                    //stage.Campaign.CampaignStages.Remove(stage);
                    stage.Delete();
                }
            }
            else if (result[1] == "T") //Task
            {
                IOppFulFilTask task = EntityFactory.GetById <IOppFulFilTask>(result[0]);
                if (task != null)
                {
                    //task.CampaignStage.CampaignTasks.Remove(task);
                    //task.Campaign.CampaignTasks.Remove(task);
                    task.Delete();
                }
            }
        }
        if (PageWorkItem != null)
        {
            IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();
            if (refresher != null)
            {
                refresher.RefreshAll();
            }
        }
        LoadView();
    }