protected void btnUpdate_Click(object sender, EventArgs e) { string loginID = "1"; try { if (Session["Login"] == null) { Session["PreviousPage"] = HttpContext.Current.Request.Url.AbsoluteUri; Response.Redirect("../LoginPage.aspx"); } loginID = ((Login)Session["Login"]).LoginID.ToString(); } catch (Exception ex) { } ButtonRole buttonRole = new ButtonRole(); buttonRole = ButtonRoleManager.GetButtonRoleByID(Int32.Parse(Request.QueryString["buttonRoleID"])); ButtonRole tempButtonRole = new ButtonRole(); tempButtonRole.ButtonRoleID = buttonRole.ButtonRoleID; tempButtonRole.RoleID = Int32.Parse(ddlRole.SelectedValue); tempButtonRole.ButtonID = Int32.Parse(ddlButton.SelectedValue); tempButtonRole.AddedDate = DateTime.Now; tempButtonRole.AddedBy = loginID; tempButtonRole.ModifyDate = DateTime.Now; tempButtonRole.ModifyBy = loginID; tempButtonRole.RowStatusID = Int32.Parse(ddlRowStatus.SelectedValue); bool result = ButtonRoleManager.UpdateButtonRole(tempButtonRole); Response.Redirect("AdminButtonRoleDisplay.aspx"); }
private void showButtonRoleData() { ButtonRole buttonRole = new ButtonRole(); buttonRole = ButtonRoleManager.GetButtonRoleByID(Int32.Parse(Request.QueryString["buttonRoleID"])); ddlRole.SelectedValue = buttonRole.RoleID.ToString(); ddlButton.SelectedValue = buttonRole.ButtonID.ToString(); txtAddedBy.Text = buttonRole.AddedBy; txtModifyDate.Text = buttonRole.ModifyDate.ToString("dd MMM yyyy hh:mm tt"); txtModifyBy.Text = buttonRole.ModifyBy; ddlRowStatus.SelectedValue = buttonRole.RowStatusID.ToString(); }