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(""); }
public string SetIcon(GridViewDataItemTemplateContainer Container) { bool imgset = false; System.Web.UI.WebControls.Image img = (System.Web.UI.WebControls.Image)Container.FindControl("IconImage"); Label lbl = (Label)Container.FindControl("lblIcon"); string lblOS = lbl.Text; CultureInfo culture = new CultureInfo(""); //8/16/2013 NS modified //if (lblOS.Contains("Android") == true) if (culture.CompareInfo.IndexOf(lblOS, "Android", CompareOptions.IgnoreCase) >= 0) { img.ImageUrl = "~/images/icons/android-icon.png"; imgset = true; } //if (lblOS.Contains("Apple") == true) //5/6/2014 NS modified for VSPLUS-588 if (culture.CompareInfo.IndexOf(lblOS, "Apple", CompareOptions.IgnoreCase) >= 0 || culture.CompareInfo.IndexOf(lblOS, "iOS", CompareOptions.IgnoreCase) >= 0) { img.ImageUrl = "~/images/icons/os_icon_mac.png"; imgset = true; } //8/15/2013 NS added //if (lblOS.Contains("RIM") == true) if (culture.CompareInfo.IndexOf(lblOS, "RIM", CompareOptions.IgnoreCase) >= 0) { img.ImageUrl = "~/images/icons/rim.png"; imgset = true; } //if (lblOS.Contains("Win") == true) if (culture.CompareInfo.IndexOf(lblOS, "Win", CompareOptions.IgnoreCase) >= 0) { img.ImageUrl = "~/images/icons/winphone.png"; imgset = true; } if (!imgset) { img.ImageUrl = "~/images/icons/phone.png"; imgset = true; } return(""); }
public string SetIcon(GridViewDataItemTemplateContainer Container) { System.Web.UI.WebControls.Image img = (System.Web.UI.WebControls.Image)Container.FindControl("IconImage"); Label lbl = (Label)Container.FindControl("lblIcon"); string lblOS = lbl.Text; if (lbl.Text == "True") { img.ImageUrl = "~/images/icons/Monitoring.png"; } else { img.Visible = false; } return(""); }
public string GetDiskInfo(GridViewDataItemTemplateContainer Container) { Label diskname = (Label)Container.FindControl("hfNameLabel"); Label comments = (Label)Container.FindControl("lblReasons"); Label detailsspan = (Label)Container.FindControl("detailsspan"); //System.Web.UI.WebControls.Image Imgforinfo = (System.Web.UI.WebControls.Image)Container.FindControl("Imgforinfo"); // System.Drawing.Image Imgforinfo = (System.Drawing.Image)Container.FindControl("Imgforinfo"); //Image Imgforinfo = (Image)Container.FindControl(""); System.Web.UI.HtmlControls.HtmlImage Imgforinfo = (System.Web.UI.HtmlControls.HtmlImage)Container.FindControl("Imgforinfo"); if (comments == null || comments.Text == "") { detailsspan.Visible = false; Imgforinfo.Visible = false; } return(""); }
/// <summary> /// This method executes when the user clicks the edit button for a program /// and it opens the program edit div so that the user can edit the selected program /// </summary> /// <param name="sender">The lbEditProgram LinkButton</param> /// <param name="e">The Click event</param> protected void lbEditProgram_Click(object sender, EventArgs e) { //Get the calling button LinkButton editButton = (LinkButton)sender; //Get the specific repeater item GridViewDataItemTemplateContainer item = (GridViewDataItemTemplateContainer)editButton.Parent; //Get the hidden field with the PK for deletion HiddenField hfProgramPK = (HiddenField)item.FindControl("hfProgramPK"); //Get the PK from the hidden field int?programPK = (String.IsNullOrWhiteSpace(hfProgramPK.Value) ? (int?)null : Convert.ToInt32(hfProgramPK.Value)); if (programPK.HasValue) { using (PyramidContext context = new PyramidContext()) { //Get the program to edit Program editProgram = context.Program.Find(programPK.Value); //Fill the inputs lblAddEditProgram.Text = "Edit Program"; txtProgramName.Value = editProgram.ProgramName; txtProgramLocation.Value = editProgram.Location; deProgramStartDate.Value = editProgram.ProgramStartDate; deProgramEndDate.Value = editProgram.ProgramEndDate; ddProgramCohort.SelectedItem = ddProgramCohort.Items.FindByValue(editProgram.CohortFK); ddProgramHub.SelectedItem = ddProgramHub.Items.FindByValue(editProgram.HubFK); ddProgramState.SelectedItem = ddProgramState.Items.FindByValue(editProgram.StateFK); hfAddEditProgramPK.Value = programPK.Value.ToString(); //Select the program types var editProgramTypes = context.ProgramType.Include(pt => pt.CodeProgramType).Where(pt => pt.ProgramFK == programPK).ToList(); foreach (ProgramType pt in editProgramTypes) { lstBxProgramType.Items.FindByValue(pt.CodeProgramType.CodeProgramTypePK).Selected = true; } } //Show the program div divAddEditProgram.Visible = true; //Set focus to the program name field txtProgramName.Focus(); } else { msgSys.ShowMessageToUser("danger", "Error", "An error occurred while attempting to load the selected program!", 20000); } }
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(""); }
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(""); }
/// <summary> /// This method executes when the user clicks the edit button for a cohort /// and it opens the cohort edit div so that the user can edit the selected cohort /// </summary> /// <param name="sender">The lbEditCohort LinkButton</param> /// <param name="e">The Click event</param> protected void lbEditCohort_Click(object sender, EventArgs e) { //Get the calling button LinkButton editButton = (LinkButton)sender; //Get the specific repeater item GridViewDataItemTemplateContainer item = (GridViewDataItemTemplateContainer)editButton.Parent; //Get the hidden field with the PK for deletion HiddenField hfCohortPK = (HiddenField)item.FindControl("hfCohortPK"); //Get the PK from the hidden field int?cohortPK = (String.IsNullOrWhiteSpace(hfCohortPK.Value) ? (int?)null : Convert.ToInt32(hfCohortPK.Value)); if (cohortPK.HasValue) { using (PyramidContext context = new PyramidContext()) { //Get the cohort to edit Cohort editCohort = context.Cohort.Find(cohortPK.Value); //Fill the inputs lblAddEditCohort.Text = "Edit Cohort"; txtCohortName.Value = editCohort.CohortName; deCohortStartDate.Value = editCohort.StartDate.ToString("MM/dd/yyyy"); deCohortEndDate.Value = (editCohort.EndDate.HasValue ? editCohort.EndDate.Value.ToString("MM/dd/yyyy") : ""); ddCohortState.SelectedItem = ddCohortState.Items.FindByValue(editCohort.StateFK); hfAddEditCohortPK.Value = cohortPK.Value.ToString(); } //Show the cohort div divAddEditCohort.Visible = true; //Set focus to the cohort name field txtCohortName.Focus(); } else { msgSys.ShowMessageToUser("danger", "Error", "An error occurred while attempting to load the selected cohort!", 20000); } }
/// <summary> /// This method executes when the user clicks the edit button for the hubs /// and it opens the hub edit div so that the user can edit the selected hub /// </summary> /// <param name="sender">The lbEditHub LinkButton</param> /// <param name="e">The Click event</param> protected void lbEditHub_Click(object sender, EventArgs e) { //Get the calling button LinkButton editButton = (LinkButton)sender; //Get the container item GridViewDataItemTemplateContainer item = (GridViewDataItemTemplateContainer)editButton.Parent; //Get the hidden field with the PK for deletion HiddenField hfHubPK = (HiddenField)item.FindControl("hfHubPK"); //Get the PK from the hidden field int?hubPK = (String.IsNullOrWhiteSpace(hfHubPK.Value) ? (int?)null : Convert.ToInt32(hfHubPK.Value)); if (hubPK.HasValue) { using (PyramidContext context = new PyramidContext()) { //Get the hub to edit Hub editHub = context.Hub.Find(hubPK.Value); //Fill the inputs lblAddEditHub.Text = "Edit Hub"; txtHubName.Value = editHub.Name; ddHubState.SelectedItem = ddHubState.Items.FindByValue(editHub.StateFK); hfAddEditHubPK.Value = hubPK.Value.ToString(); } //Show the hub div divAddEditHub.Visible = true; //Set focus to the hub name field txtHubName.Focus(); } else { msgSys.ShowMessageToUser("danger", "Error", "An error occurred while attempting to load the selected hub!", 20000); } }
public string Resetrp(GridViewDataItemTemplateContainer container) { Label ID = (Label)container.FindControl("lblid"); string pwd = CreateRandomPassword(6); Users Userobj = new Users(); Userobj.Password = pwd; if (ID.Text != null && ID.Text != "") { Userobj.ID = int.Parse(ID.Text); } bool s = VSWebBL.SecurityBL.UsersBL.Ins.UpdateAccntPassword(Userobj); if (s == true) { return("Password Updated"); } else { return(""); } }