Exemplo n.º 1
0
        protected void btnSabtEditProfile_Click(object sender, EventArgs e)
        {
            if (Session["UserIDForEditStudent"] != null)
            {
                string  id   = Session["UserIDForEditStudent"].ToString();
                Student stuu = rep.FindByStudentCode(id);
                Student stu  = new Student();

                stu.StuID          = stuu.StuID;
                stu.SGarde         = stuu.SGarde;
                stu.CGrade         = stuu.CGrade;
                stu.UserName       = stuu.UserName;
                stu.Password       = stuu.Password;
                stu.FatherID       = stuu.FatherID;
                stu.MotherID       = stuu.MotherID;
                stu.RemainedSalary = stuu.RemainedSalary;

                stu.StudentCode  = id;
                stu.ParentUser   = stuu.ParentUser;
                stu.ParentPass   = stuu.ParentPass;
                stu.FirstName    = tbxFirstName.Value;
                stu.LastName     = tbxLastName.Value;
                stu.BirthDate    = string.Format("{0}{1}{2}", tbxBirthYear.Value, stuu.BirthDate.Substring(4, 2), stuu.BirthDate.Substring(6, 2));
                stu.NationalCode = stuu.NationalCode;
                stu.PhoneNumber  = tbxFixTel.Value;
                stu.MobileNumber = tbxMobile.Value;
                stu.ZipCode      = tbxZipCode.Value;
                stu.Email        = tbxEmail.Value;

                rep.SaveStudent(stu);
                Response.Redirect("http://localhost:4911/Dashboard/Admin/Students.aspx");
            }
        }
Exemplo n.º 2
0
        protected void btnSabtEditProfile_Click(object sender, EventArgs e)
        {
            Student          stu = new Student();
            SchoolDBEntities db  = new SchoolDBEntities();

            Student stuu = db.Students.Where(p => p.UserName == "javad").Single();

            stu.StuID          = lblStuID.InnerText.ToInt();
            stu.FirstName      = stuu.FirstName;
            stu.LastName       = stuu.LastName;
            stu.SGarde         = stuu.SGarde;
            stu.CGrade         = stuu.CGrade;
            stu.UserName       = stuu.UserName;
            stu.Password       = stuu.Password;
            stu.FatherID       = stuu.FatherID;
            stu.MotherID       = stuu.MotherID;
            stu.RemainedSalary = stuu.RemainedSalary;
            stu.StudentCode    = lblStudentCode.InnerText;
            stu.BirthDate      = string.Format("{0}{1}{2}", tbxBirthYear.Value, stuu.BirthDate.Substring(4, 2), stuu.BirthDate.Substring(6, 2));
            stu.NationalCode   = stuu.NationalCode;
            stu.PhoneNumber    = tbxFixTel.Value;
            stu.MobileNumber   = tbxMobile.Value;
            stu.ZipCode        = tbxZipCode.Value;
            stu.Email          = tbxEmail.Value;
            stu.Address        = tbxAddress.InnerText;
            stu.ParentUser     = stuu.ParentUser;
            stu.ParentPass     = stuu.ParentPass;
            vStudentRepository sr = new vStudentRepository();

            sr.SaveStudent(stu);
            Response.Redirect("http://localhost:4911/Dashboard/Dashboard.aspx");
        }