Beispiel #1
0
        public IActionResult ExchangeRequest(RequestModel request)
        {
            if (ModelState.IsValid)
            {
                DateTime Datestart = request.DateStart;
                TimeSpan TimeStart = request.TimeStart;

                TimeSpan TimeEnd = request.TimeEnd;

                DateTime DateTimeStart = Datestart + TimeStart;
                DateTime DateTimeEnd   = Datestart + TimeEnd;

                RequestProcessor.CreateExchangeRequest(
                    HttpContext.GetCurrentEmployeeModel().Id,
                    DateTimeStart,
                    DateTimeEnd,
                    request.Status.ToString(),
                    RequestType.Exchange.ToString(),
                    request.Reason

                    );
                MailSender.CreateAndSendRequest();
                return(RedirectToAction("ViewRequests", "Request"));
            }

            return(View());
        }
Beispiel #2
0
        public IActionResult VacationRequest(RequestModel request)
        {
            if (ModelState.IsValid)
            {
                RequestProcessor.CreateVacationRequest(
                    HttpContext.GetCurrentEmployeeModel().Id,
                    request.DateStart,
                    request.DateEnd,
                    request.Status.ToString(),
                    RequestType.Vacation.ToString()

                    );
                MailSender.CreateAndSendRequest();
                return(RedirectToAction("ViewRequests", "Request"));
            }

            return(View());
        }