public ActionResult UpdateLot(LotUpdateModel updatingLot) { if (ModelState.IsValid == false) { return(View(updatingLot)); } if (updatingLot.UpdatingDateOfAuction < updatingLot.DateOfAuction) { ModelState.AddModelError("", "Updating date Of auction should be no earlier than already declared"); return(View(updatingLot)); } var lotForUpdate = new BLLLot() { Id = updatingLot.Id, DateOfAuction = updatingLot.UpdatingDateOfAuction, Description = updatingLot.Description, MinimalStepRate = updatingLot.MinimalStepRate }; _crudLotService.UpdateLot(lotForUpdate); return(RedirectToAction("Lot", "LotManager", new { id = updatingLot.Id })); }
public ActionResult UpdateLot(int id) { var bllLot = _crudLotService.GetLotById(id); var lot = new LotUpdateModel(bllLot); return(View(lot)); }