Example #1
0
        protected void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e)
        {
            int    index = ClusterHealthGrid.FocusedRowIndex;
            string Type  = ClusterHealthGrid.GetRowValues(index, "ServerName").ToString();

            Session["Type"] = Type;
            //11/25/2014 NS modified

            /*
             * if (txtfromdate.Text != "" && txttodate.Text != "")
             * {
             *  fromdate = txtfromdate.Text + " " + "00:00:00.000";
             *  todate = txttodate.Text + " " + "23:59:59.000";
             *
             *  if (Convert.ToDateTime(txtfromdate.Text) > Convert.ToDateTime(txttodate.Text))
             *  {
             *      MsgPopupControl.ShowOnPageLoad = true;
             *      ErrmsgLabel.Text = "From Date value should be less than To Date.";
             *  }
             *
             *  else if (Session["Type"].ToString() != "" && Session["Type"] != null)
             *  {
             *      SetGraphforCluster(Session["Type"].ToString(), fromdate, todate);
             *  }
             *
             *
             * }
             */
            if (Session["Type"].ToString() != "" && Session["Type"] != null)
            {
                SetGraphforCluster(Session["Type"].ToString(), fromdate, todate);
            }
            //else
            //{

            //    fromdate = txtfromdate.Text + " " + "00:00:00.000";
            //    todate = txttodate.Text + " " + "23:59:59.000";
            //    if (Session["Type"].ToString() != "" && Session["Type"] != null)
            //    {
            //        SetGraphforCluster(Session["Type"].ToString(), fromdate, todate);
            //    }
            //}
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.WebChartControl1.Width = new Unit(Convert.ToInt32(chartWidth.Value));
            //Mukund 22Dec14, commented below line, which was giving the WebChartControl1 a small width on Page load
            //this.WebChartControl1.Width = new Unit(Convert.ToInt32(chartWidth.Value));
            //11/25/2014 NS modified

            /*
             * if (txtfromdate.Text == "" && txttodate.Text == "")
             * {
             *  txtfromdate.Text = System.DateTime.Now.AddDays(-1).ToShortDateString();
             *  txttodate.Text = System.DateTime.Now.ToShortDateString();
             * }
             * //10/9/2013 NS added
             * fromdate = txtfromdate.Text + " " + "00:00:00.000";
             * todate = txttodate.Text + " " + "23:59:59.000";
             */
            if (dtPick.FromDate == "" && dtPick.ToDate == "")
            {
                fromdate = System.DateTime.Now.AddDays(-6).ToShortDateString() + " " + "00:00:00.000";
                todate   = System.DateTime.Now.ToShortDateString() + " " + "23:59:59.000";
            }
            else
            {
                fromdate = dtPick.FromDate;
                todate   = dtPick.ToDate;
            }
            if (!IsPostBack && !IsCallback)
            {
                Fillgrid();
                HtmlGenericControl body = (HtmlGenericControl)Master.FindControl("Body1");
                body.Attributes.Add("onResize", "Resized()");
                body.Attributes.Add("onload", "DoCallback()");
                if (Session["UserPreferences"] != null)
                {
                    DataTable UserPreferences = (DataTable)Session["UserPreferences"];
                    foreach (DataRow dr in UserPreferences.Rows)
                    {
                        if (dr[1].ToString() == "ClusterHealth|ClusterHealthGrid")
                        {
                            ClusterHealthGrid.SettingsPager.PageSize = Convert.ToInt32(dr[2]);
                        }
                    }
                }
            }
            else
            {
                Fillgridfromsession();
            }
            //9/15/2014 NS added for VSPLUS-921

            //10/9/2013 NS added
            int index = ClusterHealthGrid.FocusedRowIndex;

            if (index != -1)
            {
                string Type = ClusterHealthGrid.GetRowValues(index, "ServerName").ToString();
                if (Session["Type"] != "" && Session["Type"] != null)
                {
                    if (Session["Type"].ToString() != Type)
                    {
                        Session["Type"] = Type;
                    }
                }
                else
                {
                    Session["Type"] = Type;
                }
            }
            if (fromdate != "" && todate != "" && Session["Type"] != "" && Session["Type"] != null)
            {
                //WebChartControl1.Visible = true;
                SetGraphforCluster(Session["Type"].ToString(), fromdate, todate);
            }
            //11/25/2014 NS commented out

            /*
             * if (Convert.ToDateTime(txtfromdate.Text) > Convert.ToDateTime(txttodate.Text))
             * {
             *  MsgPopupControl.ShowOnPageLoad = true;
             *  ErrmsgLabel.Text = "From Date value should be less than To Date.";
             * }
             */
        }