public CustomBO AddStudent(StudentOB student) { CustomBO objcustome = new CustomBO(); Student objstu = new Student() { Reg_no = student.RegisterNumber, FirstName = student.FirstName, LastName = student.LastName, Depart = student.Department, Semester = student.Semester }; SPE.Students.Add(objstu); int returnval = SPE.SaveChanges(); if (returnval > 0) { objcustome.CustomerMessage = "Data sucessfully added"; objcustome.CustomeNumber = returnval; } else { objcustome.CustomerMessage = "Data failed to add"; objcustome.CustomeNumber = returnval; } return(objcustome); }
public ActionResult Index(StudentOB student) { if (ModelState.IsValid) { StudentBL objstudent = new StudentBL(); CustomBO CBO = objstudent.AddStudent(student); return(RedirectToAction("Index")); } return(View(student)); }
public CustomBO AddStudent(StudentOB st) { return(new StudentDAL().AddStudent(st)); }