public ActionResult AddLogPage(AircraftLogModel viewModel, HttpPostedFileBase fileBase)
        {
            string relFolderUrl = Url.Content("~/Content/AircraftLogs/" + viewModel.RegistrationNumber);
            string absFolderUrl = Server.MapPath(relFolderUrl);
            string origFileUrl  = Server.MapPath(Path.Combine(relFolderUrl, viewModel.EditPageNumber.ToString() + "orig.jpg"));
            string pageFileName = viewModel.EditPageNumber.ToString() + ".jpg";
            string pageUrl      = Server.MapPath(Path.Combine(relFolderUrl, pageFileName));

            if (System.IO.File.Exists(pageUrl))
            {
                ModelState.AddModelError(String.Empty, "The page number " + viewModel.EditPageNumber.ToString() + " already exists. Please delete it first or use different number.");
                return(ViewLog(viewModel.AircraftId, viewModel.RegistrationNumber));
            }

            if (!System.IO.Directory.Exists(absFolderUrl))
            {
                System.IO.Directory.CreateDirectory(absFolderUrl);
            }

            fileBase.SaveAs(origFileUrl);
            ImageHelper.ScaleToWidth(origFileUrl, pageUrl, 800);

            if (System.IO.File.Exists(pageUrl))
            {
                Aircraft aircraft = _dataService.GetAircraftById(viewModel.AircraftId);
                aircraft.LogUpdloadedOn        = DateTime.Now;
                aircraft.LogUploadedByMemberId = ProfileCommon.GetUserProfile().MemberId;
                _dataService.UpdateAircraft(aircraft);

                System.IO.File.Delete(origFileUrl);
            }

            ModelState.Clear();
            return(ViewLog(viewModel.AircraftId, viewModel.RegistrationNumber));
        }