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(); } oEnhancement = new Enhancements(intProfile, dsn); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intID = Int32.Parse(Request.QueryString["id"]); if (!IsPostBack) { lblName.Text = oEnhancement.GetApprovalGroup(intID, "name"); rptItems.DataSource = oEnhancement.GetApprovalGroupUsers(intID); rptItems.DataBind(); lblNone.Visible = (rptItems.Items.Count == 0); foreach (RepeaterItem ri in rptItems.Items) { ((LinkButton)ri.FindControl("btnDelete")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');"); } } btnClose.Attributes.Add("onclick", "return HidePanel();"); btnAdd.Attributes.Add("onclick", "return EnsureHidden('" + hdnUser.ClientID + "','" + txtUser.ClientID + "','Please enter the LAN ID of the user')" + ";"); Variables oVariable = new Variables(intEnvironment); txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divAJAX.ClientID + "','" + lstAJAX.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstAJAX.Attributes.Add("ondblclick", "AJAXClickRow();"); } }
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"); } oEnhancement = new Enhancements(intProfile, dsn); if (!IsPostBack) { LoadLists(); } if (Request.QueryString["id"] == null) { if (Request.QueryString["add"] == null) { LoopRepeater(); } else { panAdd.Visible = true; btnDelete.Enabled = false; } } else { panAdd.Visible = true; intID = Int32.Parse(Request.QueryString["id"]); if (intID > 0 && !IsPostBack) { DataSet ds = oEnhancement.GetApprovalGroup(intID); hdnId.Value = intID.ToString(); txtName.Text = ds.Tables[0].Rows[0]["name"].ToString(); radAny.Checked = (ds.Tables[0].Rows[0]["any"].ToString() == "1"); radAll.Checked = !radAny.Checked; 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. btnUsers.Attributes.Add("onclick", "return OpenWindow('ENHANCEMENT_APPROVERS','" + hdnId.ClientID + "','',false,'500',500);"); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');"); }