public dynamic getAttendancesOfClient(int clientId)
        {
            var context = new ubietydbEntities();
            context.Configuration.ProxyCreationEnabled = false;

            return (from recordset in context.attRepTemps select recordset);
        }
        public dynamic getAttendances(int id)
        {
            var context = new ubietydbEntities();
            context.Configuration.ProxyCreationEnabled = false;

            var abc = (from recordset in context.attRepTemps
                       where recordset.empid == id
                       select recordset);

            return  abc ;
        }
        public int MarkAttendance(int empid, int shift)
        {
            var context = new ubietydbEntities();

            Attendance attendance = new Attendance();

            attendance.EmpId = empid;
            attendance.MarkFlagId = shift;
            attendance.MarkTime =  TimeZoneInfo.ConvertTime(new DateTime(DateTime.Now.Ticks), TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"));
            context.Attendances.Add(attendance);

            return context.SaveChanges();
        }
        public dynamic GetEmpDetailsOfEmpId(int id)
        {
            var context = new ubietydbEntities();
            context.Configuration.ProxyCreationEnabled = false;

            var dataset2 = (from recordset in context.Employees
                            where recordset.EmpId == id
                            select new EmployeeDTO
                            {
                                EmpId = recordset.EmpId,
                                EmpNum = recordset.EmpNum,
                                EmpName = recordset.EmpName,
                                Email = recordset.Email,
                                MobileNum = recordset.PrimaryMobile,
                                ProfilePicURL = recordset.ProfilePic
                            });
            return new { employee = dataset2 };
        }
        public dynamic getAttendance(int id)
        {
            var context = new ubietydbEntities();
            context.Configuration.ProxyCreationEnabled = false;

              var abc = (from recordset in context.attendancereports
                                where recordset.empid == id
                                select new AttendanceLineDetail
                                {
                                    inMarkTime = recordset.inmarktime,
                                    inLatitude = recordset.inlatitude,
                                    inLongitude = recordset.inlongitude,
                                    inMarkCount = 1,
                                    empId = recordset.empid,
                                    outMarkTime = recordset.outmarktime,
                                    outLatitude = recordset.outlatitude,
                                    outLongitude = recordset.outlongitude,
                                    outMarkCount = 2
                                });

            return new { attendance = abc };
        }
        public int MarkAttendanceWithLatLon(int empid, int shift, Double latitude, Double longitude, Int16 markcount)
        {
            var context = new ubietydbEntities();

            Attendance attendance = new Attendance();

            attendance.EmpId = empid;
            attendance.MarkFlagId = shift;
            attendance.MarkTime = TimeZoneInfo.ConvertTime(new DateTime(DateTime.Now.Ticks), TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"));
            attendance.latitude = latitude;
            attendance.longitude = longitude;
            attendance.markcount = markcount;
            context.Attendances.Add(attendance);

            return context.SaveChanges();
        }
        public ICollection<Employee> GetOrgEmp(int ClientId)
        {
            var context = new ubietydbEntities();
            context.Configuration.ProxyCreationEnabled = false;

            var empclients = context.Employees.Where(b => b.CompanyId == ClientId).ToList();
            return empclients;
        }