Esempio n. 1
0
 public ActionResult AddStudentMark(StudentMark studentMark, int id)
 {
     try
     {
         StudentRepository studentRepository = new StudentRepository();
         studentMark.RollNumber = id;
         studentRepository.AddStudentMark(studentMark);
         //ViewData["Message1"] = "Student Marks Inserted Sucessfully";
         //return View();
         return(RedirectToAction("Search", "Student"));
     }
     catch (Exception ex)
     {
         ViewData["Message2"] = "Error in Inserting";
         return(View());
     }
 }
        //Created by Prasanaon 18.07.2013
        /// <summary>
        /// Creates the student mark.
        /// </summary>
        /// <returns>StudentMark</returns>
        public static StudentMark CreateStudentMark()
        {
            StudentRepository studentRepository = new StudentRepository();
            var studentMark = new StudentMark
            {
                RollNumber = 4,
                Language   = 90,
                English    = 90,
                Maths      = 100,
                Science    = 100,
                Social     = 100,
                Result     = 'P',
                Remarks    = "Good",
                Total      = 480,
                Percentage = 96,
                Created_By = 1
            };

            studentMark.StudentMarkId = studentRepository.AddStudentMark(studentMark);
            return(studentMark);
        }