public bool UpdateBet(UpdateBetModelView Updatemodel) { var Itemrepo = new ItemService(); string id = Itemrepo.GetById(Updatemodel.id.Substring(Updatemodel.id.IndexOf('-') + 1)).ItemRef; using (var Betrepo = new BetService()) { var model = Betrepo.GetById(Updatemodel.id); try { model.IsAccept = Updatemodel.ans; if (Updatemodel.ans == 2) { var item = Itemrepo.GetById(id); item.status = "Sold"; Itemrepo.Update(item); } Betrepo.Update(model); return(true); } catch { return(false); } } }
public ActionResult Decline(string id) { var item = new UpdateBetModelView { id = id, ans = 1 }; if (_BetBusiness.UpdateBet(item)) { return(RedirectToAction("MyNotUpdateBet")); } else { return(View()); } }
public bool UpdateBet(UpdateBetModelView Updatemodel) { return(_BetBusiness.UpdateBet(Updatemodel)); }