예제 #1
0
        public ActionResult SubmitLand(LandModel model, HttpPostedFileBase[] files)
        {
            if (files.Length == 1 && files[0] == null && !model.HasImage)
            {
                ModelState.AddModelError(string.Empty, "A photo file must be chosen.");
            }

            if (ModelState.IsValid)
            {

                PhotoProcessing(files, model);

                LandOperation operation = new LandOperation();
                var result = operation.Execute(model, User.Identity.GetUserId());

                if (result.IsSuccess)
                {
                    PropertyViewOperation op = new PropertyViewOperation();
                    var resultModel = op.GetProperties(null, User.Identity.GetUserId());
                    
                    return RedirectToAction("Index", resultModel);
                }
            }
            return View("Submit", model);
        }
예제 #2
0
 public FlightFacade(IFlightRepository flightRepository,
                     TakeoffOperation takeoffOperation,
                     GetExportToCsvOperation getExportToCsvOperation,
                     LandOperation landOperation)
 {
     this.flightRepository        = flightRepository;
     this.takeoffOperation        = takeoffOperation;
     this.getExportToCsvOperation = getExportToCsvOperation;
     this.landOperation           = landOperation;
 }