protected void UpdateStatus() { Agentstbl at = new Agentstbl(); at.AgentID = Convert.ToInt32(hdnAgentID.Value); at.AgencyCode = "MFB" + at.AgentID; at.UserName = lblAEmail.Text; at.Password = System.Web.Security.Membership.GeneratePassword(6, 2); at.Status = 1; at.IsActive = 1; List <Agentstbl> lst = new List <Agentstbl>(); lst = objRegBL.UpdateAgentIsActive(at).ToList(); ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Agent Approved Updated Successfully');", true); Response.Redirect("Registration.aspx"); btnReject.Visible = false; }
protected void lbtnSMarkAsActive_Click(object sender, EventArgs e) { LinkButton lbtn = (LinkButton)sender; GridViewRow gvr = (GridViewRow)lbtn.NamingContainer; var val = gvr.DataItemIndex; var id = gvr.Cells[7].Text; Agentstbl st = new Agentstbl(); st.AgentID = Convert.ToInt32(gvr.Cells[0].Text); if (id == "Active") { st.IsActive = 0; } else if (id == "InActive") { st.IsActive = 1; } objagBL.UpdateAgentIsActive(st); GetAgency(); }