Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public ActionResult Index(StudentOB student)
 {
     if (ModelState.IsValid)
     {
         StudentBL objstudent = new StudentBL();
         CustomBO  CBO        = objstudent.AddStudent(student);
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
Esempio n. 3
0
 public CustomBO AddStudent(StudentOB st)
 {
     return(new StudentDAL().AddStudent(st));
 }