Ejemplo n.º 1
0
        protected void lbSave_Click(object sender, EventArgs e)
        {
            Guid ID = Guid.Empty;

            try { ID = new Guid(rcbSaved.SelectedValue); }
            catch { };
            MetricTrac.Bll.MetricFilter.Extend fi = new MetricTrac.Bll.MetricFilter.Extend
            {
                GroupCategoryAspectID = SelectedGroupCategoryAspect,
                DataCollectorID       = SelectedDataCollector,
                FilterOrgLocation     = SelectedOrgLocations,
                FilterPI       = SelectedPerformanceIndicators,
                FilterMetric   = SelectedMetrics,
                MetricFilterID = ID,
                Name           = rcbSaved.Text// check it
            };
            SaveFilter.Filter = fi;

            Telerik.Web.UI.RadAjaxManager am = Telerik.Web.UI.RadAjaxManager.GetCurrent(this.Page);
            string s = "OpenDialogWindow();";

            if (IsDialog)
            {
                s = "setTimeout('" + s + "', 333);";
            }
            am.ResponseScripts.Add(s);
        }
Ejemplo n.º 2
0
        public void CancelButton_OnClick(Object sender, EventArgs e)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            if (FormEditorControl == null)
            {
                return;
            }

            if (FormEditorControl.EditorForm == null)
            {
                return;
            }


            Mercury.Server.Application.WorkflowUserInteractionResponseRequireForm formResponse = new Mercury.Server.Application.WorkflowUserInteractionResponseRequireForm();

            formResponse.InteractionType = Mercury.Server.Application.UserInteractionType.RequireForm;

            formResponse.Cancel = true;


            WorkflowPage.UserInteractionResponse = formResponse;


            if (!String.IsNullOrEmpty(ResponseScript))
            {
                Telerik.Web.UI.RadAjaxManager ajaxManager = (Telerik.Web.UI.RadAjaxManager)Page.FindControl("TelerikAjaxManager");

                ajaxManager.ResponseScripts.Add(ResponseScript);
            }
        }
        protected void EntitySendCorrespondenceControl_OnSendCorrespondence(Object sender, Web.Application.Controls.SendCorrespondenceEntityEventArgs eventArgs)
        {
            Server.Application.WorkflowUserInteractionResponseSendCorrespondence sendCorrespondenceResponse = new Server.Application.WorkflowUserInteractionResponseSendCorrespondence();

            sendCorrespondenceResponse.InteractionType = Mercury.Server.Application.UserInteractionType.SendCorrespondence;

            if (!eventArgs.Cancel)
            {
                sendCorrespondenceResponse.EntityCorrespondence = (Mercury.Server.Application.EntityCorrespondence)eventArgs.EntityCorrespondence.ToServerObject();
            }

            else
            {
                sendCorrespondenceResponse.EntityCorrespondence = null;
            }


            sendCorrespondenceResponse.Send = (!eventArgs.Cancel);

            sendCorrespondenceResponse.Cancel = eventArgs.Cancel;


            WorkflowPage.UserInteractionResponse = sendCorrespondenceResponse;


            if (!String.IsNullOrEmpty(ResponseScript))
            {
                Telerik.Web.UI.RadAjaxManager ajaxManager = (Telerik.Web.UI.RadAjaxManager)Page.FindControl("TelerikAjaxManager");

                ajaxManager.ResponseScripts.Add(ResponseScript);
            }

            return;
        }
Ejemplo n.º 4
0
        public void PrintButton_OnClick(Object sender, EventArgs e)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            if (FormEditorControl == null)
            {
                return;
            }

            if (FormEditorControl.EditorForm == null)
            {
                return;
            }



            String printScript = "window.open ('/Application/Forms/FormViewer/FormViewer.aspx?EntityFormSessionKey=" + FormEditorControl.EditorFormCacheKey + "&ForPrint=True', '_blank', 'toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=1, resizable=1');";



            if (!String.IsNullOrEmpty(ResponseScript))
            {
                Telerik.Web.UI.RadAjaxManager ajaxManager = (Telerik.Web.UI.RadAjaxManager)Page.FindControl("TelerikAjaxManager");

                ajaxManager.ResponseScripts.Add(printScript);
            }
        }
        protected void EntityContactControl_OnContact(Object sender, Web.Application.Controls.ContactEntityEventArgs eventArgs)
        {
            Server.Application.WorkflowUserInteractionResponseContactEntity contactResponse = new Server.Application.WorkflowUserInteractionResponseContactEntity();

            contactResponse.InteractionType = Mercury.Server.Application.UserInteractionType.ContactEntity;


            if (!eventArgs.Cancel)
            {
                contactResponse.EntityContact = (Mercury.Server.Application.EntityContact)eventArgs.EntityContact.ToServerObject();

                // contactResponse.EntityType = eventArgs.Entity.EntityType;

                // contactResponse.EntityId = eventArgs.EntityContact.EntityId;

                //contactResponse.Entity = (Mercury.Server.Application.Entity)eventArgs.Entity.ToServerObject ();

                //contactResponse.RelatedEntity = (eventArgs.RelatedEntity != null) ? (Mercury.Server.Application.Entity)eventArgs.RelatedEntity.ToServerObject () : null;

                //contactResponse.EntityContactInformationId = eventArgs.EntityContact.EntityContactInformationId;

                //contactResponse.ContactType = eventArgs.EntityContact.ContactType;

                //contactResponse.ContactDate = eventArgs.EntityContact.ContactDate;

                //contactResponse.Direction = eventArgs.EntityContact.Direction;

                //contactResponse.Regarding = eventArgs.EntityContact.Regarding;

                //contactResponse.Remarks = eventArgs.EntityContact.Remarks;

                //contactResponse.Successful = eventArgs.EntityContact.Successful && (!eventArgs.Cancel);

                //contactResponse.ContactOutcome = eventArgs.EntityContact.ContactOutcome;
            }

            contactResponse.Cancel = eventArgs.Cancel;



            WorkflowPage.UserInteractionResponse = contactResponse;


            if (!String.IsNullOrEmpty(ResponseScript))
            {
                Telerik.Web.UI.RadAjaxManager ajaxManager = (Telerik.Web.UI.RadAjaxManager)Page.FindControl("TelerikAjaxManager");

                if (ajaxManager != null)
                {
                    ajaxManager.ResponseScripts.Add(ResponseScript);
                }
            }

            return;
        }
Ejemplo n.º 6
0
        protected void rpWhere_PreRender(object sender, EventArgs e)
        {
            Telerik.Web.UI.RadAjaxManager m = Telerik.Web.UI.RadAjaxManager.GetCurrent(Page);
            foreach (RepeaterItem it in rpWhere.Items)
            {
                Panel        pValue     = (Panel)it.FindControl("pValue");
                Panel        pCondition = (Panel)it.FindControl("pCondition");
                ColumnSelect csWhere    = (ColumnSelect)it.FindControl("csWhere");

                m.AjaxSettings.AddAjaxSetting(csWhere.ColumnSelectComboBox, pCondition, lpWhere);
                m.AjaxSettings.AddAjaxSetting(csWhere.ColumnSelectComboBox, pValue, lpWhere);
            }
        }
Ejemplo n.º 7
0
        protected void mfScoreCardMetric_PreRender(object sender, EventArgs e)
        {
            Panel pMetric   = (Panel)mfScoreCardMetric.FindControl("pMetric");
            Panel pLocation = (Panel)mfScoreCardMetric.FindControl("pLocation");

            MetricTrac.Control.MetricFilter cMericFilter = (MetricTrac.Control.MetricFilter)mfScoreCardMetric.FindControl("cMericFilter");
            DropDownList ddlPeriod = (DropDownList)mfScoreCardMetric.FindFieldControl("Period");

            Telerik.Web.UI.RadAjaxManager m = Telerik.Web.UI.RadAjaxManager.GetCurrent(Page);
            m.AjaxSettings.AddAjaxSetting(cMericFilter.AllyButton, pMetric, ralpMetric);
            m.AjaxSettings.AddAjaxSetting(cMericFilter.AllyButton, pLocation, ralpMetric);
            m.AjaxSettings.AddAjaxSetting(ddlMetric, ddlPeriod, ralpMetric);
        }
Ejemplo n.º 8
0
        protected void Page_Prerender(object sender, EventArgs e)
        {
            Guid   ScoreCardID       = new Guid(ddlScoreCard.SelectedValue);
            string ScoreCardMetricID = rcbMetricOrg.SelectedValue;

            if (!IsPostBack && mfScoreCardDashboard.DataItem != null)
            {
                MetricTrac.Bll.ScoreCardDashboard d = (MetricTrac.Bll.ScoreCardDashboard)mfScoreCardDashboard.DataItem;
                var scm = MetricTrac.Bll.ScoreCardMetric.Get(d.ScoreCardMetricID);
                ScoreCardMetricID = d.ScoreCardMetricID.ToString();
                ScoreCardID       = scm.ScoreCardID;
            }

            var mo = MetricTrac.Bll.ScoreCardMetric.ListUnusedDashboard(ScoreCardID, ScoreCardDashboardID == Guid.Empty ? null : (Guid?)ScoreCardDashboardID);

            rcbMetricOrg.DataSource = mo;
            rcbMetricOrg.DataBind();
            if (mo.Count < 1)
            {
                rcbMetricOrg.EmptyMessage = "This Score Card has not more Metric, Please select another Score Card";
            }

            for (int i = 0; i < mo.Count(); i++)
            {
                Telerik.Web.UI.RadComboBoxItem        it = rcbMetricOrg.Items[i];
                MetricTrac.Bll.ScoreCardMetric.Extend d  = mo[i];
                string t = d.MetricName + " / " + d.OrgLocationName;
                it.Text = t;
            }

            foreach (Telerik.Web.UI.RadComboBoxItem i in rcbMetricOrg.Items)
            {
                i.Selected = i.Value == ScoreCardMetricID;
            }

            foreach (ListItem i in ddlScoreCard.Items)
            {
                i.Selected = i.Value == ScoreCardID.ToString();
            }

            Telerik.Web.UI.RadAjaxManager ram = Telerik.Web.UI.RadAjaxManager.GetCurrent(this);
            ram.UpdatePanelsRenderMode = UpdatePanelRenderMode.Inline;
            ram.AjaxSettings.AddAjaxSetting(mfScoreCardDashboard.FindControl("ddlScoreCard"), mfScoreCardDashboard.FindControl("rapDashboard"), (Telerik.Web.UI.RadAjaxLoadingPanel)mfScoreCardDashboard.FindControl("ralpDashboard"));
        }
Ejemplo n.º 9
0
        protected void ButtonOkCancel_OnClick(Object sender, EventArgs eventArgs)
        {
            promptRequest = (Mercury.Server.Application.WorkflowUserInteractionRequestPromptUser)WorkflowPage.UserInteractionRequest;

            promptResponse = new Mercury.Server.Application.WorkflowUserInteractionResponsePromptUser();

            promptResponse.InteractionType = Mercury.Server.Application.UserInteractionType.Prompt;


            switch (((Button)sender).Text.Trim().ToLower())
            {
            case "ok": promptResponse.ButtonClicked = Mercury.Server.Application.UserPromptButtonClicked.Ok; break;

            case "cancel": promptResponse.ButtonClicked = Mercury.Server.Application.UserPromptButtonClicked.Cancel; break;

            case "yes": promptResponse.ButtonClicked = Mercury.Server.Application.UserPromptButtonClicked.Yes; break;

            case "no": promptResponse.ButtonClicked = Mercury.Server.Application.UserPromptButtonClicked.No; break;

            default: promptResponse.ButtonClicked = Mercury.Server.Application.UserPromptButtonClicked.None; break;
            }

            if (PromptSelectionItemsSelection.SelectedItem != null)
            {
                promptResponse.SelectedValue = PromptSelectionItemsSelection.SelectedItem.Value;

                promptResponse.SelectedText = PromptSelectionItemsSelection.SelectedItem.Text;
            }

            WorkflowPage.UserInteractionResponse = promptResponse;


            if (!String.IsNullOrEmpty(ResponseScript))
            {
                Telerik.Web.UI.RadAjaxManager ajaxManager = (Telerik.Web.UI.RadAjaxManager)Page.FindControl("TelerikAjaxManager");

                ajaxManager.ResponseScripts.Add(ResponseScript);
            }

            return;
        }
Ejemplo n.º 10
0
        protected void lbSave_Click(object sender, EventArgs e)
        {
            MetricTrac.Bll.MetricFilter.Extend fi = new MetricTrac.Bll.MetricFilter.Extend
            {
                OrgLocationID              = SelectOrgLocationsID.Length > 0 ? SelectOrgLocationsID[0] : null,
                GroupCategoryAspectID      = GCAID,
                PerformanceIndicatorFormID = PIFormID,
                PerformanceIndicatorID     = PIID,
                MetricID        = MetricID,
                DataCollectorID = DataCollectorID,
                OrgLocationsID  = SelectOrgLocationsID
            };
            SaveFilter.Filter = fi;

            Telerik.Web.UI.RadAjaxManager am = Telerik.Web.UI.RadAjaxManager.GetCurrent(this.Page);
            string s = "OpenDialogWindow();";

            if (IsDialog)
            {
                s = "setTimeout('" + s + "', 333);";
            }
            am.ResponseScripts.Add(s);
        }
Ejemplo n.º 11
0
        protected void Page_Prerender(object sender, EventArgs e)
        {
            if (!AjaxInitialized && !MyDashboardMode)
            {
                Telerik.Web.UI.RadAjaxManager ram = Telerik.Web.UI.RadAjaxManager.GetCurrent(this.Page);
                ram.UpdatePanelsRenderMode = UpdatePanelRenderMode.Inline;
                foreach (RepeaterItem ri in rScoreCard.Items)
                {
                    Panel pMetric = (Panel)ri.FindControl("pMetric");
                    Telerik.Web.UI.RadAjaxLoadingPanel ralpMetric = ri.FindControl("ralpMetric") as Telerik.Web.UI.RadAjaxLoadingPanel;
                    ram.AjaxSettings.AddAjaxSetting(ri.FindControl("lbRefresh"), pMetric, ralpMetric);
                    MetricTrac.MTControls.MTGridView cgvMetric = ri.FindControl("cgvMetric") as MetricTrac.MTControls.MTGridView;
                    foreach (GridViewRow r in cgvMetric.Rows)
                    {
                        ram.AjaxSettings.AddAjaxSetting(r.FindControl("ibRefresh"), pMetric, ralpMetric);
                    }
                }
            }

            if (MyDashboardMode && rScoreCard.Items.Count > 0)
            {
                MetricTrac.MTControls.MTGridView cgvMetric = (MetricTrac.MTControls.MTGridView)rScoreCard.Items[0].FindControl("cgvMetric");
                if (ScoreCardMetricID != null)
                {
                    cgvMetric.SelectedIndex = -1;
                    for (int i = 0; i < cgvMetric.Rows.Count; i++)
                    {
                        object o = cgvMetric.DataKeys[i].Value;
                        if (o is Guid && (Guid)o == (Guid)ScoreCardMetricID)
                        {
                            cgvMetric.SelectedIndex = i;
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 12
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            Telerik.Web.UI.RadAjaxManager m = Telerik.Web.UI.RadAjaxManager.GetCurrent(Page);
            foreach (RepeaterItem it in rpWhere.Items)
            {
                ColumnSelect    csWhere   = (ColumnSelect)it.FindControl("csWhere");
                ConditionSelect Condition = (ConditionSelect)it.FindControl("Condition");
                PlaceHolder     phValue   = (PlaceHolder)it.FindControl("phValue");
                System.Web.UI.WebControls.TextBox tbValue  = (System.Web.UI.WebControls.TextBox)it.FindControl("tbValue");
                Telerik.Web.UI.RadComboBox        rcbValue = (Telerik.Web.UI.RadComboBox)it.FindControl("rcbValue");
                Telerik.Web.UI.RadNumericTextBox  rnValue  = (Telerik.Web.UI.RadNumericTextBox)it.FindControl("rnValue");

                rcbValue.Visible = false;
                rnValue.Visible  = false;

                string Table;
                string Column;
                string TextColumn;
                string SelectControl;
                if (!csWhere.SelectedField(DataViewTypeID, out Table, out Column, out TextColumn, out SelectControl))
                {
                    continue;
                }
                tbValue.Visible = false;

                Type t = typeof(MetricTrac.Bll.LinqMicajahEntitybase).Assembly.GetType("MetricTrac.Bll." + Table);
                if (t == null)
                {
                    continue;
                }

                System.Reflection.PropertyInfo pi = t.GetProperty(Column);
                if (pi == null)
                {
                    continue;
                }

                if (SelectControl != null)
                {
                    Condition.Mode = ConditionSelect.ConditionViewMode.Equal;
                    foreach (Panel p in phValue.Controls)
                    {
                        if (p.ID != System.IO.Path.GetFileNameWithoutExtension(SelectControl))
                        {
                            continue;
                        }
                        p.Style["display"] = "block";
                    }

                    continue;
                }

                if (pi.PropertyType == typeof(string))
                {
                    Condition.Mode  = ConditionSelect.ConditionViewMode.Like;
                    tbValue.Visible = true;
                    continue;
                }
                if (pi.PropertyType == typeof(Guid) || pi.PropertyType == typeof(Guid?))
                {
                    Condition.Mode          = ConditionSelect.ConditionViewMode.Equal;
                    rcbValue.Visible        = true;
                    rcbValue.DataValueField = Column;
                    rcbValue.DataTextField  = TextColumn;
                    rcbValue.DataSource     = MetricTrac.Bll.LinqMicajahDataContext.SelectGuid(Table, Column, TextColumn);
                    rcbValue.DataBind();
                    continue;
                }

                foreach (Type nt in NumericType)
                {
                    if (pi.PropertyType == nt)
                    {
                        Condition.Mode  = ConditionSelect.ConditionViewMode.Compare;
                        rnValue.Visible = true;
                        continue;
                    }
                }

                Condition.Mode  = ConditionSelect.ConditionViewMode.All;
                tbValue.Visible = true;
            }
        }
Ejemplo n.º 13
0
        protected void rScoreCard_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            MetricTrac.Bll.ScoreCard.Extend sc = e.Item.DataItem as MetricTrac.Bll.ScoreCard.Extend;
            if (sc == null)
            {
                return;
            }
            MetricTrac.MTControls.MTGridView cgvMetric = e.Item.FindControl("cgvMetric") as MetricTrac.MTControls.MTGridView;
            string NewUrl;

            if (MyDashboardMode)
            {
                NewUrl = "ScoreCardDashboardEdit.aspx";
            }
            else
            {
                NewUrl = "ScoreCardMetricEdit.aspx?ScoreCardID=" + sc.ScoreCardID;
            }
            cgvMetric.EmptyDataText = "No Metrics Found. Click to <a href='" + NewUrl + "'>Add New</a>";
            cgvMetric.DataSource    = sc.MetricValue;
            cgvMetric.DataBind();



            GetColumn(cgvMetric, "Period").Visible = MyDashboardMode;

            if (MyDashboardMode)
            {
                if (ScoreCardMetricID == null && cgvMetric.Rows.Count > 0)
                {
                    ScoreCardMetricID       = (Guid)cgvMetric.DataKeys[0].Value;
                    cgvMetric.SelectedIndex = 0;
                    if (SelectedIndexChanged != null)
                    {
                        SelectedIndexChanged(this, null);
                    }
                }

                cgvMetric.Columns[0].Visible = false;
                cgvMetric.Columns[cgvMetric.Columns.Count - 1].Visible = false;

                for (int i = 0; i < cgvMetric.Rows.Count; i++)
                {
                    GridViewRow r = cgvMetric.Rows[i];
                    MetricTrac.Bll.ScoreCardDashboard.Extend d = ((List <MetricTrac.Bll.ScoreCardDashboard.Extend>)sc.MetricValue)[i];
                    r.Attributes.Add("onclick", "RowClick('" + d.ScoreCardMetricID + "," + d.ScoreCardDashboardID + "')");
                    r.Attributes.Add("onmouseover", "rollIn(this)");
                    r.Attributes.Add("onmouseout", "rollOut(this)");
                }
            }
            else
            {
                SetPeriodName(cgvMetric, ddlDatePeriod, "CurrentValueStr", 1);
                SetPeriodName(cgvMetric, ddlCompDatePeriod, "PreviousValueStr", 2);

                PlaceHolder phPublicScoreCards = (PlaceHolder)e.Item.FindControl("phPublicScoreCards");
                PlaceHolder phHideLinks        = (PlaceHolder)e.Item.FindControl("phHideLinks");
                phHideLinks.Visible = (sc.UserId != LoggedinUserId);
                if (!IsPublicShown)
                {
                    phPublicScoreCards.Visible = IsPublicShown = !IsPublicShown &&
                                                                 ((LastUser == LoggedinUserId && LastUser != sc.UserId)
                                                                  ||
                                                                  (LastUser == Guid.Empty && sc.UserId != LoggedinUserId));
                }
                PlaceHolder phViewAll = (PlaceHolder)e.Item.FindControl("phViewAll");
                phViewAll.Visible = (phPublicScoreCards.Visible && HiddenScoreCardCount > 0);

                AjaxInitialized = true;
                Telerik.Web.UI.RadAjaxManager ram = Telerik.Web.UI.RadAjaxManager.GetCurrent(this.Page);
                ram.UpdatePanelsRenderMode = UpdatePanelRenderMode.Inline;
                //Panel pMetric = (Panel)e.Item.FindControl("pMetric");
                //Telerik.Web.UI.RadAjaxLoadingPanel ralpMetric = e.Item.FindControl("ralpMetric") as Telerik.Web.UI.RadAjaxLoadingPanel;
                //ram.AjaxSettings.AddAjaxSetting(e.Item.FindControl("lbRefresh"), pMetric, ralpMetric);
                //foreach (GridViewRow r in cgvMetric.Rows)
                //    ram.AjaxSettings.AddAjaxSetting(r.FindControl("ibRefresh"), pMetric, ralpMetric);
            }
            LastUser = sc.UserId;
        }
Ejemplo n.º 14
0
        public void SubmitButton_OnClick(Object sender, EventArgs e)
        {
            if (MercuryApplication == null)
            {
                return;
            }

            if (FormEditorControl == null)
            {
                return;
            }

            if (FormEditorControl.EditorForm == null)
            {
                return;
            }


            Client.Core.Forms.Form editorForm = FormEditorControl.EditorForm;

            List <Server.Application.FormCompileMessage> validationResponse = editorForm.Submit();

            FormEditorControl.EditorForm = editorForm;

            if (validationResponse.Count != 0)
            {
                System.Data.DataTable compileOutputTable = new System.Data.DataTable();

                compileOutputTable.Columns.Add("MessageType");
                compileOutputTable.Columns.Add("Description");
                compileOutputTable.Columns.Add("ControlId");
                compileOutputTable.Columns.Add("ControlType");
                compileOutputTable.Columns.Add("ControlName");

                foreach (Server.Application.FormCompileMessage currentMessage in validationResponse)
                {
                    compileOutputTable.Rows.Add(currentMessage.MessageType.ToString(), currentMessage.Description, currentMessage.ControlId, currentMessage.ControlType.ToString(), currentMessage.ControlName);
                }

                FormSubmitGrid.DataSource = compileOutputTable;

                FormSubmitGrid.Rebind();

                FormSubmitGridDiv.Visible = true;


                if (TelerikAjaxManager != null)
                {
                    TelerikAjaxManager.ResponseScripts.Add("setTimeout (\"document.getElementById ('" + FormSubmitGrid.ClientID + "').focus ();\", 250);");

                    //TelerikAjaxManager.ResponseScripts.Add ("setTimeout (\"alert (document.getElementById('" + FormSubmitGridDiv.ClientID + "'));\", 1000");

                    //TelerikAjaxManager.ResponseScripts.Add ("setTimeout (\"document.getElementById('" + FormSubmitGridDiv.ClientID + "').focus();\", 1000");
                }
            }

            else
            {
                Server.Application.WorkflowUserInteractionResponseRequireForm formResponse = new Mercury.Server.Application.WorkflowUserInteractionResponseRequireForm();

                formResponse.InteractionType = Mercury.Server.Application.UserInteractionType.RequireForm;

                formResponse.Form = (Server.Application.Form)FormEditorControl.EditorForm.ToServerObject();


                WorkflowPage.UserInteractionResponse = formResponse;


                if (!String.IsNullOrEmpty(ResponseScript))
                {
                    Telerik.Web.UI.RadAjaxManager ajaxManager = (Telerik.Web.UI.RadAjaxManager)Page.FindControl("TelerikAjaxManager");

                    ajaxManager.ResponseScripts.Add(ResponseScript);
                }
            }

            return;
        }
        protected void EntityAddressTerminateWindow_ButtonOk_OnClick(Object sender, EventArgs e)
        {
            Boolean success = true;


            if (!EntityAddressTerminateTerminationDate.SelectedDate.HasValue)
            {
                EntityAddressTerminateTerminationDate.SelectedDate = null;

                EntityAddressTerminateResponse.Text = "Unable to determine the requested Termination Date.";

                return;
            }


            Int64 terminatedEntityAddressId = Convert.ToInt64(EntityAddressTerminateId.Text);

            Client.Core.Entity.EntityAddress currentEntityAddress = MercuryApplication.EntityAddressGet(terminatedEntityAddressId, false);

            if (Convert.ToDateTime(EntityAddressTerminateTerminationDate.SelectedDate) < currentEntityAddress.EffectiveDate)
            {
                EntityAddressTerminateTerminationDate.SelectedDate = null;

                EntityAddressTerminateResponse.Text = "The requested Termination Date is not valid.";

                return;
            }


            success = MercuryApplication.EntityAddressTerminate(currentEntityAddress, EntityAddressTerminateTerminationDate.SelectedDate.Value);


            if (success)
            {
                EntityAddressHistoryGrid_ManualDataRebind();

                EntityAddressTerminateTerminationDate.SelectedDate = null;


                Telerik.Web.UI.RadAjaxManager telerikAjaxManager = (Telerik.Web.UI.RadAjaxManager)Page.FindControl("TelerikAjaxManager");

                if (telerikAjaxManager != null)
                {
                    telerikAjaxManager.ResponseScripts.Add("EntityAddressTerminateWindow_Close ();");
                }
            }

            else
            {
                if (MercuryApplication.LastException != null)
                {
                    EntityAddressTerminateResponse.Text = MercuryApplication.LastException.Message;
                }

                else
                {
                    EntityAddressTerminateResponse.Text = "Unknown exception occurreed. Unable to Terminate.";
                }
            }

            return;
        }
Ejemplo n.º 16
0
 public static void Alert(string message)
 {
     Telerik.Web.UI.RadAjaxManager ram = new Telerik.Web.UI.RadAjaxManager();
     string script_text = "radakert('" + message + "', 250, 150);";
     ram.ResponseScripts.Add(@script_text);
 }