public ActionResult UserDetail(UserDetail_Model model) { HocSinh hocSinh = hocSinhRepository.GetHocSinhByTaiKhoanID((int)Session["TaiKhoanID_session"]); TaiKhoan taiKhoan = taiKhoanRepository.GetById((int)Session["TaiKhoanID_session"]); hocSinh.TenHS = model.TenHS; hocSinh.Email = model.Email; hocSinh.GioiTinh = model.GioiTinh; hocSinh.NgaySinh = DateTime.ParseExact(model.NgaySinh, "yyyy-MM-dd", null); hocSinhRepository.Update(hocSinh); model.Role = taiKhoan.Role; model.Username = taiKhoan.UserName; //Quy uoc success la 1 ViewBag.Message = "1"; return(View(model)); }
public ActionResult UserDetail() { UserDetail_Model model = new UserDetail_Model(); var hocSinh = hocSinhRepository.GetHocSinhByTaiKhoanID((int)Session["TaiKhoanID_session"]); var taiKhoan = taiKhoanRepository.GetById((int)Session["TaiKhoanID_session"]); model.HocSinhID = hocSinh.HocSinhID; model.TenHS = hocSinh.TenHS; model.Email = hocSinh.Email; model.Username = taiKhoan.UserName; model.Role = taiKhoan.Role; model.GioiTinh = hocSinh.GioiTinh; DateTime ngaySinh = (DateTime)hocSinh.NgaySinh; model.NgaySinh = ngaySinh.ToString("yyyy-MM-dd"); return(View(model)); }