Exemplo n.º 1
0
        public ActionResult AddAttenance(AttenanceModel am)
        {
            if (ModelState.IsValid)
            {
                ATTENDANCE_IMPORT ai = new ATTENDANCE_IMPORT();
                ai.AttendanceLogId = 0;
                ai.AttendanceDate  = Convert.ToDateTime(am.sAttendanceDate);
                ai.EmployeeId      = am.EmployeeId;
                ai.InTime          = DateTime.ParseExact(am.sInTime, "hh:mm tt", CultureInfo.InvariantCulture).TimeOfDay;
                ai.OutTime         = DateTime.ParseExact(am.sOutTime, "hh:mm tt", CultureInfo.InvariantCulture).TimeOfDay;
                ai.PunchRecords    = am.PunchRecords;
                CommonRepository _repo = new CommonRepository();
                _repo.AddAttenance(ai);
            }
            else
            {
                return(View(am));
            }

            return(RedirectToAction("index"));
        }