Esempio n. 1
0
 public IHttpActionResult GetAttendanceReport(string empId, DateTime fromDate, DateTime toDate)
 {
     try
     {
         using (MaxMasterDbEntities db = new MaxMasterDbEntities())
         {
             int totalCount       = 0;
             var attendanceReport = db.EmployeeAttendanceReport(empId, fromDate, toDate).OrderBy(x => x.EmployeeName).ToList();
             if (attendanceReport.Count > 0)
             {
                 totalCount = attendanceReport.Count();
             }
             return(Content(HttpStatusCode.OK, new { attendanceReport, totalCount }));
         }
     }
     catch (Exception ex)
     {
         new Error().logAPIError(System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), ex.StackTrace);
         return(Content(HttpStatusCode.InternalServerError, "An error occured, please try again later"));
     }
 }