コード例 #1
0
        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");
            }
        }
コード例 #2
0
 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");
     }
 }
コード例 #3
0
 private void GetData()
 {
     gvStudent.DataSource = supervisor.GetAll();
     gvStudent.DataBind();
 }
コード例 #4
0
 private void GetData()
 {
     gvGTC.DataSource = supervisor.GetAll().Where(x => x.GTC == "Yes").ToList();
     gvGTC.DataBind();
 }