private void LoadLists() { ddlPlatform.DataTextField = "name"; ddlPlatform.DataValueField = "platformid"; ddlPlatform.DataSource = oPlatform.GetForecasts(1); ddlPlatform.DataBind(); ddlPlatform.Items.Insert(0, new ListItem("-- SELECT --", "0")); ddlPlatform.Attributes.Add("onchange", "EnableMaintenance();"); ddlClass.DataTextField = "name"; ddlClass.DataValueField = "id"; ddlClass.DataSource = oClass.GetForecasts(1); ddlClass.DataBind(); ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0")); MaintenanceWindow oMaintenanceWindow = new MaintenanceWindow(intProfile, dsn); ddlMaintenance.DataTextField = "name"; ddlMaintenance.DataValueField = "id"; ddlMaintenance.DataSource = oMaintenanceWindow.Gets(1); ddlMaintenance.DataBind(); ddlMaintenance.Items.Insert(0, new ListItem("-- SELECT --", "0")); ServerName oServerName = new ServerName(intProfile, dsn); ddlApplications.DataTextField = "name"; ddlApplications.DataValueField = "id"; ddlApplications.DataSource = oServerName.GetApplicationsForecast(1); ddlApplications.DataBind(); ddlApplications.Items.Insert(0, new ListItem("-- NONE --", "0")); }
private void LoadPlatforms() { DataSet ds = oPlatform.GetForecasts(1); foreach (DataRow dr in ds.Tables[0].Rows) { TreeNode oNode = new TreeNode(); oNode.Text = dr["name"].ToString(); oNode.ToolTip = dr["name"].ToString(); oNode.ImageUrl = "/images/folder.gif"; oNode.SelectAction = TreeNodeSelectAction.Expand; oTreeview.Nodes.Add(oNode); LoadTypes(Int32.Parse(dr["platformid"].ToString()), oNode); } oTreeview.ExpandDepth = 1; oTreeview.Attributes.Add("oncontextmenu", "return false;"); }
private void LoadPlatforms() { DataSet ds = oPlatform.GetForecasts(1); foreach (DataRow dr in ds.Tables[0].Rows) { TreeNode oNode = new TreeNode(); oNode.Text = dr["name"].ToString() + " [<a href=\"" + Request.Path + "?id=" + intQuestion.ToString() + "&pid=" + dr["platformid"].ToString() + "\">Check All</a>]"; oNode.ToolTip = dr["name"].ToString(); oNode.Value = dr["platformid"].ToString(); oNode.SelectAction = TreeNodeSelectAction.Expand; oTree.Nodes.Add(oNode); LoadClasses(oNode, Int32.Parse(dr["platformid"].ToString())); if (Int32.Parse(dr["platformid"].ToString()) != intPlatform) { oNode.Collapse(); } } }
private void Load() { DataSet ds = oPlatform.GetForecasts(1); foreach (DataRow dr in ds.Tables[0].Rows) { TreeNode oNode = new TreeNode(); oNode.Text = dr["name"].ToString(); oNode.ToolTip = dr["name"].ToString(); oNode.ImageUrl = "/images/folder.gif"; oNode.SelectAction = TreeNodeSelectAction.Expand; oTreeview.Nodes.Add(oNode); Load(Int32.Parse(dr["platformid"].ToString()), oNode); TreeNode oNew = new TreeNode(); oNew.Text = " Add Step"; oNew.ToolTip = "Add Step"; oNew.ImageUrl = "/images/green_right.gif"; oNew.NavigateUrl = "javascript:Add('" + dr["platformid"].ToString() + "','" + oPlatform.GetName(Int32.Parse(dr["platformid"].ToString())) + "');"; oNode.ChildNodes.Add(oNew); } }
private void LoadPaging(int intStart, string _sort) { DataSet ds = oForecast.Gets(); DataView dv = ds.Tables[0].DefaultView; dv.RowFilter = LoadFilter(); int intCount = dv.Count; double dblEnd = Math.Ceiling(Double.Parse(intCount.ToString()) / Double.Parse(intRecords.ToString())); int intEnd = Int32.Parse(dblEnd.ToString()); int ii = 0; txtPage.Text = intStart.ToString(); lblPages.Text = intEnd.ToString(); if (intEnd < 7) { for (ii = 1; ii < intEnd; ii++) { LoadLink(lblTopPaging, ii, ", ", intStart); LoadLink(lblBottomPaging, ii, ", ", intStart); } LoadLink(lblTopPaging, intEnd, "", intStart); LoadLink(lblBottomPaging, intEnd, "", intStart); } else { if (intStart < 5) { for (ii = 1; ii < 6 && ii < intEnd; ii++) { LoadLink(lblTopPaging, ii, ", ", intStart); LoadLink(lblBottomPaging, ii, ", ", intStart); } if (ii < intEnd) { LoadLink(lblTopPaging, ii, " .... ", intStart); LoadLink(lblBottomPaging, ii, " .... ", intStart); } LoadLink(lblTopPaging, intEnd, "", intStart); LoadLink(lblBottomPaging, intEnd, "", intStart); } else if (intStart > (intEnd - 4)) { LoadLink(lblTopPaging, 1, " .... ", intStart); LoadLink(lblBottomPaging, 1, " .... ", intStart); for (ii = (intEnd - 5); ii < intEnd && ii > 0; ii++) { LoadLink(lblTopPaging, ii, ", ", intStart); LoadLink(lblBottomPaging, ii, ", ", intStart); } LoadLink(lblTopPaging, intEnd, "", intStart); LoadLink(lblBottomPaging, intEnd, "", intStart); } else { LoadLink(lblTopPaging, 1, " .... ", intStart); LoadLink(lblBottomPaging, 1, " .... ", intStart); for (ii = (intStart - 2); ii < (intStart + 3) && ii < intEnd && ii > 0; ii++) { if (ii == (intStart + 2)) { LoadLink(lblTopPaging, ii, " .... ", intStart); LoadLink(lblBottomPaging, ii, " .... ", intStart); } else { LoadLink(lblTopPaging, ii, ", ", intStart); LoadLink(lblBottomPaging, ii, ", ", intStart); } } LoadLink(lblTopPaging, intEnd, "", intStart); LoadLink(lblBottomPaging, intEnd, "", intStart); } } LoopRepeater(_sort, ((intStart - 1) * intRecords)); // LOAD PLATFORMS Platforms oPlatform = new Platforms(intProfile, dsn); DataSet dsPlatforms = oPlatform.GetForecasts(1); foreach (DataRow dr in dsPlatforms.Tables[0].Rows) { strTotals += "<td class=\"default\">" + (dr["image"].ToString() != "" ? "<img src=\"" + dr["image"].ToString() + "\" border=\"0\" align=\"absmiddle\" />" : "") + " <b>" + oForecast.GetPlatformCount(Int32.Parse(dr["platformid"].ToString())) + "</b> " + dr["name"].ToString() + "</td><td class=\"default\"> </td>"; } strTotals = "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\"><tr>" + strTotals + "</tr></table>"; }