public async Task <object> UpdateAttendance(Guid businessID, Guid attendanceID, [FromBody] UpdateAttendanceModel updateAttendanceModel)
        {
            var checkBusinessId = await commonLogic.CheckBusinessID(businessID);

            if (checkBusinessId)
            {
                var checkAttendanceId = await commonLogic.CheckAttendaceID(businessID, attendanceID);

                if (checkAttendanceId)
                {
                    var checkEmployeeId = await commonLogic.CheckEmployeeID(businessID, updateAttendanceModel.EmployeeID);

                    if (checkEmployeeId)
                    {
                        var result = await attendanceLogic.UpdateAttendance(businessID, attendanceID, updateAttendanceModel);

                        if (result)
                        {
                            return(attendanceValidation.AttendanceUpdatedSuccess());
                        }

                        return(attendanceValidation.AttendanceUpdationFailed());
                    }

                    return(commonValidation.EmployeeIdNotExists(updateAttendanceModel.EmployeeID));
                }

                return(commonValidation.AttendanceIdNotExists(attendanceID));
            }
            return(commonValidation.BusinessIdNotExists(businessID));
        }
 public Task <bool> UpdateAttendance(Guid businessID, Guid attendanceID, UpdateAttendanceModel updateAttendanceModel)
 {
     return(attendanceDAL.UpdateAttendance(businessID, attendanceID, updateAttendanceModel));
 }
        public async Task <bool> UpdateAttendance(Guid businessID, Guid attendanceID, UpdateAttendanceModel updateAttendanceModel)
        {
            try
            {
                var businessId   = new Npgsql.NpgsqlParameter("@thebusinessid", businessID);
                var attendanceId = new Npgsql.NpgsqlParameter("@theattendance_id", attendanceID);
                var employeeId   = new Npgsql.NpgsqlParameter("@theempid", updateAttendanceModel.EmployeeID);
                var attendance   = new Npgsql.NpgsqlParameter("@presentorabsent", updateAttendanceModel.Attendance);

                await Task.Run(() => projectContextDB.Database.ExecuteSqlRaw("call updateattendancebyid(@thebusinessid,@theattendance_id,@theempid,@presentorabsent)", businessId, attendanceId, employeeId, attendance));

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }