Beispiel #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            WorkerUser workerUser = await UserLogic.GetWorkerUserAsync(User);

            Works = await WorkSheetLogic.GetRemainingWorksByWorkerIdAsync(workerUser.Id);

            NextWork = WorkSheetLogic.GetNextWork(Works);

            Message.SenderId = workerUser.Id;
            Message.WorkId   = NextWork.Id;
            Message.Time     = DateTime.Now;

            await WorkLogic.SaveMessageAsync(Message);

            string emailMessage = $"Tisztelt {NextWork.Service.Car.ClientUser.Name}!<br /><br />" +
                                  $"Tájékoztatjuk, hogy {NextWork.SubTask.Name} ({NextWork.Service.Car.Brand} {NextWork.Service.Car.Model}) " +
                                  $"feladathoz, új üzenet érkezett rendszerünkben {Message.Time} időpontban!<br /><br />" +
                                  $"Üzenet szövege a következő<br />\"{Message.Text}\"<br /><br />" +
                                  $"Válaszolni a rendszerünkben tud, a feladathoz tartozó üzeneteknél!" +
                                  $"Kérjük, hogy erre az e-mailre ne válaszoljon!<br /><br /><br />" +
                                  $"Üdvözlettel:<br />{NextWork.SubTask.CompanyUser.Name}";

            await _emailLogic.SendNotificationAsync(NextWork, emailMessage);

            return(Page());
        }
Beispiel #2
0
 public ReallyPaidModel(CarServiceDbContext context, IEmailSender emailSender)
 {
     _workSheetLogic = new WorkSheetLogic(context);
     _emailLogic     = new EmailLogic(context, emailSender);
     _userLogic      = new UserLogic(context);
     _companyLogic   = new CompanyLogic(context);
 }
Beispiel #3
0
        public async Task OnGetAsync()
        {
            WorkerUser workerUser = await UserLogic.GetWorkerUserAsync(User);

            Works = await WorkSheetLogic.GetRemainingWorksByWorkerIdAsync(workerUser.Id);

            NextWork = WorkSheetLogic.GetNextWork(Works);
        }
Beispiel #4
0
 public WorkSheetModel(CarServiceDbContext context, IEmailSender emailSender)
 {
     _appUserLogic     = new UserLogic(context);
     _appointmentLogic = new AppointmentLogic(context);
     _calendarLogic    = new WorkSheetLogic(context);
     _workLogic        = new WorkLogic(context);
     _emailLogic       = new EmailLogic(context, emailSender);
 }
Beispiel #5
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            Work = await WorkSheetLogic.GetWorkByIdAsync(Work.Id);

            Work.StateId = 2;

            await WorkSheetLogic.ModifyWorkAsync(Work);

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Work = await WorkSheetLogic.GetWorkByIdAsync(id);

            if (Work == null)
            {
                return(NotFound());
            }

            return(Page());
        }
        public async Task<IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return Page();
            }

            WorkerUser workerUser = await UserLogic.GetWorkerUserAsync(User);

            Work = await WorkSheetLogic.GetWorkByIdAsync(Work.Id);
            Work.Price = Price;
            Work.StateId = 1;

            await WorkSheetLogic.ModifyWorkAsync(Work);

            await _emailLogic.SendStatusChangeEmailAsync(workerUser, Work);

            return RedirectToPage("./WorkSheets");
        }
Beispiel #8
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            WorkerUser workerUser = await UserLogic.GetWorkerUserAsync(User);

            Service = await CompanyLogic.GetServiceByIdAsync(Service.Id);

            foreach (var work in Service.Works)
            {
                work.StateId = 6;
                await WorkSheetLogic.ModifyWorkAsync(work);
            }

            await _emailLogic.SendStatusChangeEmailAsync(Service);

            return(RedirectToPage("./Index"));
        }
 public ModifyPriceModel(CarServiceDbContext context, IEmailSender emailSender)
 {
     _workSheetLogic = new WorkSheetLogic(context);
     _userLogic = new UserLogic(context);
     _emailLogic = new EmailLogic(context, emailSender);
 }
Beispiel #10
0
 public ReallyStartModel(CarService.Dal.CarServiceDbContext context, IEmailSender emailSender)
 {
     _workSheetLogic = new WorkSheetLogic(context);
     _emailLogic     = new EmailLogic(context, emailSender);
     _userLogic      = new UserLogic(context);
 }
Beispiel #11
0
 public ModifyPriceModel(CarService.Dal.CarServiceDbContext context)
 {
     _workSheetLogic = new WorkSheetLogic(context);
 }
        public async Task OnGetAsync(int?id)
        {
            WorkerUser workerUser = await UserLogic.GetWorkerUserAsync(User);

            Work = await WorkSheetLogic.GetWorkByIdAsync(id);
        }