protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "") { intProfile = Int32.Parse(Request.Cookies["adminid"].Value); } else { Reload(); } oOperatingSystem = new OperatingSystems(intProfile, dsn); btnClose.Attributes.Add("onclick", "return HidePanel();"); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intID = Int32.Parse(Request.QueryString["id"]); } if (!IsPostBack) { Load(null); if (intID > 0) { lblName.Text = oOperatingSystem.GetGroup(intID, "name"); } } }
protected void Page_Load(object sender, EventArgs e) { Response.Cookies["loginreferrer"].Value = Request.Path; Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30); if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "") { intProfile = Int32.Parse(Request.Cookies["adminid"].Value); } else { Response.Redirect("/admin/login.aspx"); } oOperatingSystem = new OperatingSystems(intProfile, dsn); if (!IsPostBack) { LoadLists(); } if (Request.QueryString["id"] == null) { if (Request.QueryString["add"] == null) { LoopRepeater(); } else { panAdd.Visible = true; btnOrder.Enabled = false; btnOS.Enabled = false; btnDelete.Enabled = false; } } else { panAdd.Visible = true; intID = Int32.Parse(Request.QueryString["id"]); if (intID > 0 && !IsPostBack) { DataSet ds = oOperatingSystem.GetGroup(intID); hdnId.Value = intID.ToString(); txtName.Text = ds.Tables[0].Rows[0]["name"].ToString(); chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1"); btnAdd.Text = "Update"; } } // Modify "/admin/frame/frame_support_order.aspx" with the "&type=xxx" value. btnOS.Attributes.Add("onclick", "return OpenWindow('OPERATING_SYSTEM_GROUPS','" + hdnId.ClientID + "','',false,'500',500);"); btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=OPERATING_SYSTEM_GROUPS" + "',false,400,400);"); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');"); }