Ejemplo n.º 1
0
 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"));
 }
Ejemplo n.º 2
0
 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"));
 }