示例#1
0
        public string SetSubQ(GridViewDataItemTemplateContainer Container)
        {
            DevExpress.Web.ASPxGauges.ASPxGaugeControl gaugecntrl = (DevExpress.Web.ASPxGauges.ASPxGaugeControl)Container.FindControl("gControl_Page3");

            Label SubQ           = (Label)Container.FindControl("lblSubQ");
            Label SubQTH         = (Label)Container.FindControl("lblSubQTH");
            Label display        = (Label)Container.FindControl("msgLabel");
            Label lblSubQDetails = (Label)Container.FindControl("lblSubQDetails");

            double SubQval = Convert.ToDouble(SubQ.Text == "" ? "0" : SubQ.Text);

            double SubQTHval = (Convert.ToDouble(SubQTH.Text == "" ? "0" : SubQTH.Text));

            display.Text = SubQval + "/" + SubQTHval;
            //http://help.devexpress.com/#AspNet/CustomDocument5242
            lblSubQDetails.Text = "<br><br><b>" +
                                  "Submission Queue: " + SubQval.ToString() + " <br>" +
                                  (SubQTHval == 0 ? "No Threshold" : "Threshold:       " + SubQTHval.ToString() + " ") + "</b>";
            if (SubQTHval != 0)
            {
                display.ForeColor = (SubQval >= 0 && SubQval < (SubQTHval * 0.4) ? Color.Green : (SubQval >= (SubQTHval * 0.4) && SubQval < SubQTHval ? Color.Orange : Color.Red));
            }



            return("");
        }
示例#2
0
        public string SetMemory(GridViewDataItemTemplateContainer Container)
        {
            DevExpress.Web.ASPxGauges.ASPxGaugeControl gaugecntrl = (DevExpress.Web.ASPxGauges.ASPxGaugeControl)Container.FindControl("gControl_Page3");

            Label Mem           = (Label)Container.FindControl("lblMem");
            Label MemTH         = (Label)Container.FindControl("lblMemTH");
            Label display       = (Label)Container.FindControl("msgLabel");
            Label stype         = (Label)Container.FindControl("Type");
            Label sec           = (Label)Container.FindControl("Sec");
            Label Meminfo       = (Label)Container.FindControl("poplbl");
            Label lblMemDetails = (Label)Container.FindControl("lblMemDetails");

            if (stype.Text == "SharePoint" || sec.Text == "SharePoint")
            {
                double Memval = Convert.ToDouble(Mem.Text == "" ? "0" : Mem.Text);

                double MemTHval      = (Convert.ToDouble(MemTH.Text == "" ? "0" : MemTH.Text));
                string Memthreshhold = MemTHval.ToString();
                //12/12/2012 NS added - the page throws an error if the Mem.Text value is an empty string/NULL
                string Memtxt = (Mem.Text == "" ? "0" : Mem.Text);
                //CreateLinearGauge(gaugecntrl, Mem.Text, Memthreshhold);
                //Below line commented by Mukund- VSPLUS-374. 12Feb14
                //CreateLinearGauge(gaugecntrl, Memtxt, Memthreshhold);

                display.Text = Memval + "/" + MemTHval;
                //http://help.devexpress.com/#AspNet/CustomDocument5242
                //7/22/2014 NS commented out
                //lblMemDetails.Text = "<br><br><b>" +
                //                    "Memory Utilization: " + Memval.ToString() + " %<br>" +
                //                    (MemTHval == 0 ? "No Threshold" : "Threshold:       " + MemTHval.ToString() + " %") + "</b>";
                if (MemTHval != 0)
                {
                    display.ForeColor = (Memval >= 0 && Memval < (MemTHval * 0.4) ? Color.Green : (Memval >= (MemTHval * 0.4) && Memval < MemTHval ? Color.Orange : Color.Red));
                }
            }
            else
            {
                HtmlAnchor ahover = (HtmlAnchor)Container.FindControl("ahover");
                //ahover.Attributes.Add("visibility", "hidden");
                ahover.Attributes.Add("class", "noclass");
                //HtmlGenericControl parentdiv = (HtmlGenericControl)Container.FindControl("parentdiv");
                //parentdiv.Attributes.Add("visibility", "hidden");

                //gaugecntrl.Visible = false;
            }

            return("");
        }
示例#3
0
        public string SetResponse(GridViewDataItemTemplateContainer Container)
        {
            DevExpress.Web.ASPxGauges.ASPxGaugeControl gaugecntrl = (DevExpress.Web.ASPxGauges.ASPxGaugeControl)Container.FindControl("gControl_Page3");

            Label Response           = (Label)Container.FindControl("lblResponse");
            Label ResponseTH         = (Label)Container.FindControl("lblResponseTH");
            Label display            = (Label)Container.FindControl("msgLabel");
            Label stype              = (Label)Container.FindControl("Type");
            Label sec                = (Label)Container.FindControl("Sec");
            Label Responseinfo       = (Label)Container.FindControl("poplbl");
            Label lblResponseDetails = (Label)Container.FindControl("lblResponseDetails");

            if (stype.Text == "SharePoint" || sec.Text == "SharePoint")
            {
                double Responseval = Convert.ToDouble(Response.Text == "" ? "0" : Response.Text);

                double ResponseTHval = (Convert.ToDouble(ResponseTH.Text == "" ? "0" : ResponseTH.Text));
                //12/12/2012 NS added - the page throws an error if the CPU.Text value is an empty string/NULL
                string cputxt = (Response.Text == "" ? "0" : Response.Text);


                display.Text = Responseval + "/" + ResponseTHval;
                //http://help.devexpress.com/#AspNet/CustomDocument5242
                //7/22/2014 NS commented out
                //lblResponseDetails.Text = "<br><br><b>" +
                //                    "Response Time: " + Responseval.ToString() + " %<br>" +
                //                    (ResponseTHval == 0 ? "No Threshold" : "Threshold:       " + ResponseTHval.ToString() + " %") + "</b>";
                if (ResponseTHval != 0)
                {
                    display.ForeColor = (Responseval >= 0 && Responseval < (ResponseTHval * 0.4) ? Color.Green : (Responseval >= (ResponseTHval * 0.4) && Responseval < ResponseTHval ? Color.Orange : Color.Red));
                }
            }
            else
            {
                HtmlAnchor ahover = (HtmlAnchor)Container.FindControl("ahover");

                ahover.Attributes.Add("class", "noclass");


                gaugecntrl.Visible = false;
            }

            return("");
        }