コード例 #1
0
        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");
        }
コード例 #2
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            string[] elementsOfDate = Input.AppointmentDay.Split('-');

            string[] elementsOfTime = Input.AppointmentTime.Split(':');

            DateTime appointment = AppointmentLogic.CreateAppointmentDate(elementsOfDate, elementsOfTime);

            Work work = await AppointmentLogic.MakeAppointmentAsync(appointment, Input.CarId, SubTask, Input.Description);

            await _emailLogic.SendStatusChangeEmailAsync(work.WorkerUser, work);

            return(RedirectToPage("./BrowseSubTasks"));
        }
コード例 #3
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"));
        }