Ejemplo n.º 1
0
 public BookingService(BookingContext context, IWorkingDayService workingDayService, IEmailService emailService, IConfiguration configuration)
 {
     _context           = context;
     _workingDayService = workingDayService;
     _emailService      = emailService;
     _configuration     = configuration;
 }
Ejemplo n.º 2
0
 public WorkingTime CreateObject(WorkingTime workingTime, IWorkingDayService _workingDayService)
 {
     //  workingTime.Errors = new Dictionary<String, String>();
     if (_validator.ValidCreateObject(workingTime, this))
     {
         workingTime.WorkInterval  = (decimal)workingTime.CheckOut.Subtract(workingTime.CheckIn).TotalMinutes;
         workingTime.BreakInterval = (decimal)workingTime.BreakIn.Subtract(workingTime.BreakOut).TotalMinutes;
         _repository.CreateObject(workingTime);
         // Also create WorkingDays
         for (int i = 0; i < 7; i++)
         {
             WorkingDay workingDay = new WorkingDay
             {
                 WorkingTimeId     = workingTime.Id,
                 Code              = workingTime.Code + i.ToString(), // ((DayOfWeek)i).ToString()
                 Name              = ((DayOfWeek)i).ToString(),
                 MinCheckIn        = workingTime.MinCheckIn,
                 CheckIn           = workingTime.CheckIn,
                 MaxCheckIn        = workingTime.MaxCheckIn,
                 MinCheckOut       = workingTime.MinCheckOut,
                 CheckOut          = workingTime.CheckOut,
                 MaxCheckOut       = workingTime.MaxCheckOut,
                 BreakOut          = workingTime.BreakOut,
                 BreakIn           = workingTime.BreakIn,
                 WorkInterval      = workingTime.WorkInterval,
                 BreakInterval     = workingTime.BreakInterval,
                 CheckInTolerance  = workingTime.CheckInTolerance,
                 CheckOutTolerance = workingTime.CheckOutTolerance,
             };
             workingDay.IsEnabled = (i != 0 && i != 6);
             _workingDayService.CreateObject(workingDay, this);
         }
     }
     return(workingTime);
 }
Ejemplo n.º 3
0
 public BookingService(BookingContext context, IWorkingDayService workingDayService, IEmailService emailService, IAvailabilityService availabilityService, IConfiguration configuration, ILogger <BookingService> logger)
 {
     _context             = context;
     _workingDayService   = workingDayService;
     _emailService        = emailService;
     _availabilityService = availabilityService;
     _configuration       = configuration;
     _logger = logger;
 }
Ejemplo n.º 4
0
 public EmployeeController(IEmpDBContext empDBContext, IEmployeeService empService, ICityService cityService, IStateService stateService, IJobService jobService, IDepartmentService departmentService, IWorkingDayService workingdaysService, IShiftService shiftsService)
 {
     db = empDBContext;
     _empService = empService;
     _stateService = stateService;
     _cityService = cityService;
     _jobService = jobService;
     _departmentService = departmentService;
     _workingdayService = workingdaysService;
     _shiftService = shiftsService;
 }
Ejemplo n.º 5
0
 public WorkingTime UpdateObject(WorkingTime workingTime, IWorkingDayService _workingDayService)
 {
     if (_validator.ValidUpdateObject(workingTime, this))
     {
         workingTime.WorkInterval  = (decimal)workingTime.CheckOut.Subtract(workingTime.CheckIn).TotalMinutes;
         workingTime.BreakInterval = (decimal)workingTime.BreakIn.Subtract(workingTime.BreakOut).TotalMinutes;
         _repository.UpdateObject(workingTime);
         // Also updates WorkingDays
         for (int i = 0; i < 7; i++)
         {
             string     code       = workingTime.Code + i.ToString(); // ((DayOfWeek)i).ToString()
             WorkingDay workingDay = _workingDayService.GetObjectByCode(code);
             if (workingDay == null)
             {
                 workingDay = new WorkingDay();
             }
             if (workingDay != null)
             {
                 workingDay.WorkingTimeId = workingTime.Id;
                 workingDay.Code          = code;
                 workingDay.Name          = ((DayOfWeek)i).ToString();
                 //workingDay.IsEnabled = (i != 0 && i != 6);
                 workingDay.MinCheckIn        = workingTime.MinCheckIn;
                 workingDay.CheckIn           = workingTime.CheckIn;
                 workingDay.MaxCheckIn        = workingTime.MaxCheckIn;
                 workingDay.MinCheckOut       = workingTime.MinCheckOut;
                 workingDay.CheckOut          = workingTime.CheckOut;
                 workingDay.MaxCheckOut       = workingTime.MaxCheckOut;
                 workingDay.BreakOut          = workingTime.BreakOut;
                 workingDay.BreakIn           = workingTime.BreakIn;
                 workingDay.WorkInterval      = workingTime.WorkInterval;
                 workingDay.BreakInterval     = workingTime.BreakInterval;
                 workingDay.CheckInTolerance  = workingTime.CheckInTolerance;
                 workingDay.CheckOutTolerance = workingTime.CheckOutTolerance;
                 _workingDayService.CreateOrUpdateObject(workingDay, this);
             }
             ;
         }
     }
     return(workingTime);
 }
Ejemplo n.º 6
0
 public WorkingTimeController()
 {
     _workingTimeService         = new WorkingTimeService(new WorkingTimeRepository(), new WorkingTimeValidator());
     _workingDayService          = new WorkingDayService(new WorkingDayRepository(), new WorkingDayValidator());
     _employeeWorkingTimeService = new EmployeeWorkingTimeService(new EmployeeWorkingTimeRepository(), new EmployeeWorkingTimeValidator());
 }
Ejemplo n.º 7
0
 public SalaryProcessController()
 {
     _userAccountService          = new UserAccountService(new UserAccountRepository(), new UserAccountValidator());
     _companyInfoService          = new CompanyInfoService(new CompanyInfoRepository(), new CompanyInfoValidator());
     _branchOfficeService         = new BranchOfficeService(new BranchOfficeRepository(), new BranchOfficeValidator());
     _departmentService           = new DepartmentService(new DepartmentRepository(), new DepartmentValidator());
     _divisionService             = new DivisionService(new DivisionRepository(), new DivisionValidator());
     _titleInfoService            = new TitleInfoService(new TitleInfoRepository(), new TitleInfoValidator());
     _employeeService             = new EmployeeService(new EmployeeRepository(), new EmployeeValidator());
     _employeeEducationService    = new EmployeeEducationService(new EmployeeEducationRepository(), new EmployeeEducationValidator());
     _salaryItemService           = new SalaryItemService(new SalaryItemRepository(), new SalaryItemValidator());
     _formulaService              = new FormulaService(new FormulaRepository(), new FormulaValidator());
     _workingTimeService          = new WorkingTimeService(new WorkingTimeRepository(), new WorkingTimeValidator());
     _workingDayService           = new WorkingDayService(new WorkingDayRepository(), new WorkingDayValidator());
     _employeeWorkingTimeService  = new EmployeeWorkingTimeService(new EmployeeWorkingTimeRepository(), new EmployeeWorkingTimeValidator());
     _salaryStandardService       = new SalaryStandardService(new SalaryStandardRepository(), new SalaryStandardValidator());
     _salaryStandardDetailService = new SalaryStandardDetailService(new SalaryStandardDetailRepository(), new SalaryStandardDetailValidator());
     _salaryEmployeeService       = new SalaryEmployeeService(new SalaryEmployeeRepository(), new SalaryEmployeeValidator());
     _salaryEmployeeDetailService = new SalaryEmployeeDetailService(new SalaryEmployeeDetailRepository(), new SalaryEmployeeDetailValidator());
     _employeeAttendanceService   = new EmployeeAttendanceService(new EmployeeAttendanceRepository(), new EmployeeAttendanceValidator());
     //_employeeAttendanceDetailService = new EmployeeAttendanceDetailService(new EmployeeAttendanceDetailRepository(), new EmployeeAttendanceDetailValidator());
     _salarySlipService         = new SalarySlipService(new SalarySlipRepository(), new SalarySlipValidator());
     _salarySlipDetailService   = new SalarySlipDetailService(new SalarySlipDetailRepository(), new SalarySlipDetailValidator());
     _employeeLeaveService      = new EmployeeLeaveService(new EmployeeLeaveRepository(), new EmployeeLeaveValidator());
     _generalLeaveService       = new GeneralLeaveService(new GeneralLeaveRepository(), new GeneralLeaveValidator());
     _spklService               = new SPKLService(new SPKLRepository(), new SPKLValidator());
     _ptkpService               = new PTKPService(new PTKPRepository(), new PTKPValidator());
     _pph21sptService           = new PPH21SPTService(new PPH21SPTRepository(), new PPH21SPTValidator());
     _otherExpenseService       = new OtherExpenseService(new OtherExpenseRepository(), new OtherExpenseValidator());
     _otherExpenseDetailService = new OtherExpenseDetailService(new OtherExpenseDetailRepository(), new OtherExpenseDetailValidator());
     _otherIncomeService        = new OtherIncomeService(new OtherIncomeRepository(), new OtherIncomeValidator());
     _otherIncomeDetailService  = new OtherIncomeDetailService(new OtherIncomeDetailRepository(), new OtherIncomeDetailValidator());
     _thrService              = new THRService(new THRRepository(), new THRValidator());
     _thrDetailService        = new THRDetailService(new THRDetailRepository(), new THRDetailValidator());
     _slipGajiMiniService     = new SlipGajiMiniService(new SlipGajiMiniRepository(), new SlipGajiMiniValidator());
     _slipGajiDetailService   = new SlipGajiDetailService(new SlipGajiDetailRepository(), new SlipGajiDetailValidator());
     _slipGajiDetail1Service  = new SlipGajiDetail1Service(new SlipGajiDetail1Repository(), new SlipGajiDetail1Validator());
     _slipGajiDetail2AService = new SlipGajiDetail2AService(new SlipGajiDetail2ARepository(), new SlipGajiDetail2AValidator());
     _salaryProcessService    = new SalaryProcessService(new SalaryProcessValidator()
     {
         _employeeAttendanceService  = _employeeAttendanceService,
         _employeeLeaveService       = _employeeLeaveService,
         _employeeService            = _employeeService,
         _employeeWorkingTimeService = _employeeWorkingTimeService,
         _formulaService             = _formulaService,
         _generalLeaveService        = _generalLeaveService,
         _spklService               = _spklService,
         _ptkpService               = _ptkpService,
         _pph21sptService           = _pph21sptService,
         _otherExpenseService       = _otherExpenseService,
         _otherExpenseDetailService = _otherExpenseDetailService,
         _otherIncomeService        = _otherIncomeService,
         _otherIncomeDetailService  = _otherIncomeDetailService,
         _thrService                  = _thrService,
         _thrDetailService            = _thrDetailService,
         _workingDayService           = _workingDayService,
         _workingTimeService          = _workingTimeService,
         _salaryEmployeeDetailService = _salaryEmployeeDetailService,
         _salaryEmployeeService       = _salaryEmployeeService,
         _salaryItemService           = _salaryItemService,
         _salarySlipDetailService     = _salarySlipDetailService,
         _salarySlipService           = _salarySlipService,
         _slipGajiDetail1Service      = _slipGajiDetail1Service,
         _slipGajiDetail2AService     = _slipGajiDetail2AService,
         _slipGajiDetailService       = _slipGajiDetailService,
         _slipGajiMiniService         = _slipGajiMiniService,
     });
 }
Ejemplo n.º 8
0
 public AvailabilityService(BookingContext context, IWorkingDayService workingDayService)
 {
     _context           = context;
     _workingDayService = workingDayService;
 }
Ejemplo n.º 9
0
 public WorkingDayController(IWorkingDayService workingDayService) : base(workingDayService)
 {
     this._workingDayService = workingDayService;
 }
Ejemplo n.º 10
0
 public WorkingDaysController(IWorkingDayService workingDayService)
 {
     _workingDayService = workingDayService;
 }