public ActionResult Index(InputDentistRequestViewModel request)
        {
            if (request.File.ContentLength > 0)
            {
                var file = request.File;
                var fileExtension = Path.GetExtension(file.FileName);

                var dentistRequest = new DentistRequest()
                {
                    Content = request.Content,
                    UserId = this.User.Identity.GetUserId(),
                    Extension = fileExtension
                };

                this.dentistRequests.AddRequest(dentistRequest);

                var folder = dentistRequest.Id % 10;
                var realFileName = dentistRequest.FileName.ToString();

                var path = Path.Combine(this.Server.MapPath(RequestsPath + folder), realFileName + fileExtension);
                file.SaveAs(path);
            }
            else
            {
                this.TempData["ErrorMessage"] = "File can't be empty!";
            }

            //TODO: Write the right redirect view.
            return this.RedirectToAction("Index", "Home", new { area = string.Empty });
        }
        public ActionResult Index(InputDentistRequestViewModel request)
        {
            if (request.File.ContentLength > 0)
            {
                var file          = request.File;
                var fileExtension = Path.GetExtension(file.FileName);

                var dentistRequest = new DentistRequest()
                {
                    Content   = request.Content,
                    UserId    = this.User.Identity.GetUserId(),
                    Extension = fileExtension
                };

                this.dentistRequests.AddRequest(dentistRequest);

                var folder       = dentistRequest.Id % 10;
                var realFileName = dentistRequest.FileName.ToString();

                var path = Path.Combine(this.Server.MapPath(RequestsPath + folder), realFileName + fileExtension);
                file.SaveAs(path);
            }
            else
            {
                this.TempData["ErrorMessage"] = "File can't be empty!";
            }

            //TODO: Write the right redirect view.
            return(this.RedirectToAction("Index", "Home", new { area = string.Empty }));
        }