public ActionResult PlaceBid(PropertyViewModel model) { try { if (ModelState.IsValid) { BidVieModel bid = new BidVieModel(); bid.BuyerId = Utils.GetBuyer(); bid.PropertyId = model.PropertyId; bid.Status = BidStatus.Pending; bid.HousePrice = model.HousePrice; bid.LandPrice = model.LandPrice; if (bid.Place()) { return(RedirectToAction("Index", "Buyer")); } else { ModelState.AddModelError("", "Property addition failed."); } } } catch (Exception ex) { } return(RedirectToAction("Index", "Buyer")); }
public ActionResult ConfirmBid(int BidId) { try { if (ModelState.IsValid) { BidVieModel model = new BidVieModel(BidId); if (model.ConfirmBid()) { PropertyViewModel pvm = new PropertyViewModel(model.PropertyId); pvm.ChangeStatus(PropertyStatus.Sold); return(RedirectToAction("Index", "Seller")); } else { ModelState.AddModelError("", "Status change failed."); } } } catch (Exception ex) { } return(RedirectToAction("Index", "Seller")); }