Example #1
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)
        {
            Title = "Шаблоны процессов - LeadForce";

            radAjaxManager = RadAjaxManager.GetCurrent(Page);

            radAjaxManager.AjaxSettings.AddAjaxSetting(InPlansAndActive, gridWorkflowTemplates, null, UpdatePanelRenderMode.Inline);
            radAjaxManager.AjaxSettings.AddAjaxSetting(InPlans, gridWorkflowTemplates, null, UpdatePanelRenderMode.Inline);
            radAjaxManager.AjaxSettings.AddAjaxSetting(Active, gridWorkflowTemplates, null, UpdatePanelRenderMode.Inline);
            radAjaxManager.AjaxSettings.AddAjaxSetting(Archive, gridWorkflowTemplates, null, UpdatePanelRenderMode.Inline);
            radAjaxManager.AjaxSettings.AddAjaxSetting(All, gridWorkflowTemplates, null, UpdatePanelRenderMode.Inline);

            rbAddWorkflowTemplate.NavigateUrl = UrlsData.AP_WorkflowTemplateAdd();
            rbAddWithMaster.NavigateUrl       = UrlsData.AP_WorkflowTemplateWizard();
            gridWorkflowTemplates.SiteID      = SiteId;
            gridWorkflowTemplates.Where.Add(new GridWhere {
                CustomQuery = string.Format("((tbl_WorkflowTemplate.Status=0 OR tbl_WorkflowTemplate.Status=1) AND DataBaseStatusID = {0})", (int)DataBaseStatus.Active)
            });

            var optionTagPanel = ((LeadForceBasePage)Page).CurrentModuleEditionOptions.SingleOrDefault(a => a.SystemName == "TagAndFiltersPanel");

            if (optionTagPanel == null && !((LeadForceBasePage)Page).IsDefaultEdition)
            {
                gridWorkflowTemplates.ShowSelectCheckboxes = false;
                RadPanelBar1.Items[0].Visible = false;
                RadPanelBar1.Items[1].Visible = false;
            }

            var allowWorkflowDesignerOption = ((LeadForceBasePage)Page).CurrentModuleEditionOptions.SingleOrDefault(a => a.SystemName == "AllowWorkflowDesigner");

            if (allowWorkflowDesignerOption == null && !((LeadForceBasePage)Page).IsDefaultEdition)
            {
                rbAddWorkflowTemplate.Visible = false;
                allowWorkflowDesigner         = false;
            }

            //gridWorkflowTemplates.Actions.Add(new GridAction { Text = "Карточка шаблона процесса", NavigateUrl = string.Format("~/{0}/WorkflowTemplates/Edit/{{0}}", CurrentTab), ImageUrl = "~/App_Themes/Default/images/icoView.png" });
        }
Example #2
0
        /// <summary>
        /// Handles the OnItemDataBound event of the gridWorkflowTemplates control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        protected void gridWorkflowTemplates_OnItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                var item = (GridDataItem)e.Item;
                var data = (DataRowView)e.Item.DataItem;

                ((Literal)item.FindControl("lrlWorkflowTemplateStatus")).Text = EnumHelper.GetEnumDescription((WorkflowTemplateStatus)int.Parse(data["tbl_WorkflowTemplate_Status"].ToString()));
                ((HyperLink)item.FindControl("hlName")).Text = data["tbl_WorkflowTemplate_Name"].ToString();
                if (allowWorkflowDesigner)
                {
                    ((HyperLink)item.FindControl("hlName")).NavigateUrl = UrlsData.AP_WorkflowTemplateEdit(Guid.Parse(data["tbl_WorkflowTemplate_ID"].ToString()));
                }
                else
                {
                    ((HyperLink)item.FindControl("hlName")).NavigateUrl = UrlsData.AP_WorkflowTemplateWizard(Guid.Parse(data["tbl_WorkflowTemplate_ID"].ToString()));
                }
                ((HyperLink)item.FindControl("hlEdit")).NavigateUrl = ((HyperLink)item.FindControl("hlName")).NavigateUrl;

                ((LinkButton)item.FindControl("lbCopy")).CommandArgument   = data["tbl_WorkflowTemplate_ID"].ToString();
                ((LinkButton)item.FindControl("lbCopy")).OnClientClick     = string.Format("return confirm(\"Создать копию шаблона процесса '{0}' и перейти к редактированию?\");", data["tbl_WorkflowTemplate_Name"]);
                ((LinkButton)item.FindControl("lbDelete")).CommandArgument = data["tbl_WorkflowTemplate_ID"].ToString();
            }
        }