Exemplo n.º 1
0
        public IHttpActionResult GetAttendanceReport(DateModal modal)
        {
            DateTime startDate = Convert.ToDateTime(modal.monthStartDate);
            DataSet  ds        = AttendanceRepository.GetAttendanceReport(startDate);

            ds.Tables[0].TableName = "Attendance";
            DataTable dt = new DataTable();

            dt.Clear();
            dt.Columns.Add("ReportHeaders");
            foreach (DataColumn col in ds.Tables[0].Columns)
            {
                DataRow newRow = dt.NewRow();
                newRow["ReportHeaders"] = col.ColumnName;
                dt.Rows.Add(newRow);
            }
            ds.Tables.Add(dt);
            ds.Tables[1].TableName = "ReportHeaders";
            return(Ok(ds));
        }