public CreateContactFormCommandHandler(IStudioDbContext context, IMediator mediator, ILoggerFactory loggerFactory, ISender emailSender) { this.loggerFactory = loggerFactory; this.emailSender = emailSender; this.context = context; this.mediator = mediator; }
// Appointment Creation Helper Methods // Checking if InsideWorkingHours + Not Weekend public static bool IsInWorkingHours(IStudioDbContext context, Employee employee, DateTime start, DateTime end) { var startDay = ((int)start.DayOfWeek == 0) ? 7 : (int)start.DayOfWeek; var endDay = ((int)end.DayOfWeek == 0) ? 7 : (int)end.DayOfWeek; var locationEndDay = (int)employee.Location.EndDay; if (startDay > locationEndDay || endDay > locationEndDay) { return(false); } TimeRange workingHours = new TimeRange(TimeTrim.Hour(start, int.Parse(employee.Location.StartHour)), TimeTrim.Hour(start, int.Parse(employee.Location.EndHour))); return(workingHours.HasInside(new TimeRange(start, end))); }
public static string ValidateNoAppoinmentClash(IStudioDbContext context, IAppointmentCommand appointment) { var appointments = context.Appointments.Where(x => x.EmployeeId == appointment.EmployeeId && x.IsDeleted != true); foreach (var item in appointments) { if (item.ReservationTime.ToShortTimeString() == appointment.ReservationTime.Value.ToShortTimeString() && item.ReservationDate.ToShortDateString() == appointment.ReservationDate.ToShortDateString()) { string errorMessage = string.Format( GConst.ClashAppointmentMessage, item.Employee.FirstName, item.ReservationDate.ToShortDateString(), item.ReservationTime.ToShortTimeString()); return(errorMessage); } } return(string.Empty); }
public GetEmployeesByLocationListQueryHandler(IStudioDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public GetAllEmployeeServicesListQueryHandler(IStudioDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public GetAvailableAppontmentsQueryHandler(IStudioDbContext context) { this.context = context; }
public CreateEmployeeServiceCommandHandler(IStudioDbContext context, IMediator mediator) { this.context = context; this.mediator = mediator; }
public GetCountryByIdQueryHandler(IStudioDbContext context) { this.context = context; }
public GetLocationByIdQueryHandler(IStudioDbContext context) { this.context = context; }
public CreateCountryCommandHandler(IStudioDbContext context, IMediator mediator) { this.context = context; this.mediator = mediator; }
public GetAddressesNamesForEditListQueryHandler(IStudioDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public GetAllLocationIndustriesListQueryHandler(IStudioDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public GetAddressByIdQueryHandler(IStudioDbContext context) { this.context = context; }
public GetAppointmentByIdQueryHandler(IStudioDbContext context) { this.context = context; }
public GetAppointmentsByUserIdListQueryHandler(IStudioDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public UpdateIndustryCommandHandler(IStudioDbContext context) { this.context = context; }
public GetLocationsNamesListQueryHandler(IStudioDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public GetEmployeeByIdQueryHandler(IStudioDbContext context) { this.context = context; }
public DeleteCountryCommandHandler(IStudioDbContext context) { this.context = context; }
public DeleteLocationIndustryCommandHandler(IStudioDbContext context) { this.context = context; }
public UpdateClientCommandHandler(IStudioDbContext context) { this.context = context; }
public UpdateEmployeeCommandHandler(IStudioDbContext context) { this.context = context; }
public DeleteServiceCommandHandler(IStudioDbContext context) { this.context = context; }
public DeleteAddressCommandHandler(IStudioDbContext context) { this.context = context; }
public CreateLocationIndustryCommandHandler(IStudioDbContext context, IMediator mediator) { this.context = context; this.mediator = mediator; }
public UpdateLocationCommandHandler(IStudioDbContext context) { this.context = context; }
public UpdateAppointmentCommandHandler(IStudioDbContext context) { this.context = context; }
public GetAllClientsListQueryHandler(IStudioDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public GetClientByIdQueryHandler(IStudioDbContext context) { this.context = context; }