public ActionResult Add(int?id) { ClassRoomService service = new ClassRoomService(); ClassRoom classRoom = service.FindByKeys(id); return(View(classRoom)); }
public ActionResult Add(int?Id , string ClassName , string ListDepartmentID , string Description , bool Status ) { ClassRoomService classRoomService = new ClassRoomService(); ClassRoom classRoom = classRoomService.FindByKeys(Id); classRoom.ClassName = ClassName; classRoom.Description = Description; if (!string.IsNullOrEmpty(ListDepartmentID)) { classRoom.DepartmentID = Convert.ToInt32(ListDepartmentID); } classRoom.Status = Status; classRoom.IsDelete = false; if (Id.HasValue) { classRoomService.Updates(classRoom); setAlert("Sửa sinh vien thành công", "success"); } else { classRoomService.Inserts(classRoom); setAlert("Thêm sinh vien thành công", "success"); } return(View(classRoom)); }
public PartialViewResult LoadForm(int?id) { ClassRoomService classRoomService = new ClassRoomService(); ClassRoom classRoom = classRoomService.FindByKeys(id); return(PartialView("_Form", classRoom)); }