private void SetData() { bool flag = false; try { if (supervisor.GetAll().Where(x => x.GTC == "Yes").ToList().Count() >= 3 && cbGTC.Checked == true) { pnlResponseFail.Visible = true; } else { supervisor.User.FullName = txtFname.Text; supervisor.User.Email = txtEmail.Text; supervisor.User.Gender = rblGender.SelectedIndex == 0 ? "Male" : "Female"; supervisor.User.Contact = txtContact.Text; supervisor.User.CNIC = txtCnic.Text; supervisor.GTC = cbGTC.Checked == true ? "Yes" : "No"; supervisor.Title = txtJobTitle.Text; supervisor.EditProfile(); Session.Add("success", true); flag = true; } } catch { Session.Add("fail", true); } if (flag) { Response.Redirect("/Admin/Faculty"); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["studentsignin"] != null) { listSupervisor = supervisor.GetAll(); student = Session["studentsignin"] as _Student; if (!IsPostBack) { GetData(); } } else { Response.Redirect("/Home"); } }
private void GetData() { gvStudent.DataSource = supervisor.GetAll(); gvStudent.DataBind(); }
private void GetData() { gvGTC.DataSource = supervisor.GetAll().Where(x => x.GTC == "Yes").ToList(); gvGTC.DataBind(); }