protected void gv_VolExp_RowDeleting(object sender, GridViewDeleteEventArgs e) { int VolExpID = (int)gv_VolExp.DataKeys[e.RowIndex].Values[0]; VolExpBLL.DeleteByWorkId(VolExpID); Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri); }
protected void gv_VolExp_RowUpdating(object sender, GridViewUpdateEventArgs e) { int VolExpID = (int)gv_VolExp.DataKeys[e.RowIndex].Values[0]; //In the Edit-Template ///\\\///\\\ TextBox OrganizationName = ((TextBox)gv_VolExp.Rows[e.RowIndex].FindControl("txt_organization")); TextBox Role = ((TextBox)gv_VolExp.Rows[e.RowIndex].FindControl("txt_Role")); TextBox Description = ((TextBox)gv_VolExp.Rows[e.RowIndex].FindControl("txt_description")); VolExpBLL.Update(VolExpID, OrganizationName.Text, Description.Text, Role.Text); Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri); }
protected void btn_addVol_Click(object sender, EventArgs e) { MembershipUser CurrentUser = Membership.GetUser(); Guid userId = (Guid)CurrentUser.ProviderUserKey; int added = VolExpBLL.AddAll(userId, txt_WorkName.Text, txt_description.Text, txt_Role.Text); if (added > 0) { lbl_success.Text = "Your data has been added successfully ✔"; } else { lbl_success.Text = "Error! Please check your data and try again"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MembershipUser CurrentUser = Membership.GetUser(); if (CurrentUser == null) { Response.Redirect("~/Pages/Users/Login.aspx"); } else { Guid userId = (Guid)CurrentUser.ProviderUserKey; DataTable dt = VolExpBLL.GetByUserID(userId); gv_VolExp.DataSource = dt; gv_VolExp.DataKeyNames = new string[] { "VolExperienceId" }; gv_VolExp.DataBind(); ViewState["VolExpDT"] = dt; } } }