Пример #1
0
        public ActionResult Create(attendance attendance)
        {
            try
            {
                //if (contribution.CheckNumber == null) { contribution.CheckNumber = ""; }

                if (ModelState.IsValid)
                {
                    db.attendances.Add(attendance);
                    db.SaveChanges();
                    AttendanceRepository.AddRecord(attendance);
                    TempData["Message2"] = "attendance record added successfully.";
                    GetData();
                    return(RedirectToAction("Create"));
                }
            }
            catch (Exception ex)
            {
                TempData["Message2"] = "Error adding Attendance";
            }
            GetData();

            return(PartialView(attendance));
        }