Exemplo n.º 1
0
        private long insertData(DataTable attendanceLogtable, int rowno, string monthCol)
        {
            MTSHRDataLayer.AttendanceLog attendanceLog = new MTSHRDataLayer.AttendanceLog();
            var result = attendanceLog.InsertAttData(attendanceLogtable.Rows[rowno]["Employee Code"].ToString().Trim(),
                                                     attendanceLogtable.Rows[rowno]["Employee Name"].ToString().Trim(),
                                                     attendanceLogtable.Rows[rowno]["In Device Name"].ToString().Trim(),
                                                     attendanceLogtable.Rows[rowno]["Out Device Name"].ToString().Trim(),
                                                     attendanceLogtable.Rows[rowno]["Status Code"].ToString().Trim(),
                                                     Convert.ToInt64(attendanceLogtable.Rows[rowno]["Duration"]),
                                                     attendanceLogtable.Rows[rowno]["Punch Records"].ToString().Trim(),
                                                     (attendanceLogtable.Rows[rowno]["In DateTime"].ToString().Trim() != "")? ParseRequestDate(attendanceLogtable.Rows[rowno]["In DateTime"].ToString()):(DateTime?)null,
                                                     (attendanceLogtable.Rows[rowno]["out DateTime"].ToString().Trim() != "") ? ParseRequestDate(attendanceLogtable.Rows[rowno]["out DateTime"].ToString()) : (DateTime?)null,

                                                     (monthCol.Trim() != "") ?ParseRequestDate(monthCol) : (DateTime?)null);

            return(result == -1 ? 0 : result);
        }
Exemplo n.º 2
0
        public JsonResult ReadMonthlyAttendanceDetails()
        {
            DateTime date = Convert.ToDateTime(TempData["Date"]);

            TempData.Keep("Date");
            DataTable dt = new DataTable();

            try
            {
                Int64 RoleId = Int64.Parse(Session["RoleId"].ToString());
                Int64 UserId = Int64.Parse(Session["UserID"].ToString());
                MTSHRDataLayer.AttendanceLog attendance_Log = new MTSHRDataLayer.AttendanceLog();
                dt = attendance_Log.ReadMonthlyAttendanceDetails(date, RoleId, UserId);
            }
            catch (Exception ex)
            {
                ex.Data.Clear();
                dt = new DataTable();
            }
            return(Json(JsonConvert.SerializeObject(dt), JsonRequestBehavior.AllowGet));
        }