public void Add(TradeReferenceModel tradereference)
        {
            var data = GetAll();

            if (tradereference.Id == 0)
            {
                if (data.Count > 0)
                    tradereference.Id = data.Max(a => a.Id) + 1;
                else
                    tradereference.Id = 100000;
            }

            data.Add(tradereference);
            HttpContext.Current.Session[SessionTradeList] = data;
        }
Beispiel #2
0
 public ActionResult EditTradeReference(TradeReferenceModel model)
 {
     if (ModelState.IsValid)
     {
         traderSessionRepository.Update(model);
         return RedirectToAction("AddTradeReference");
     }
     return PartialView("_EditTradeReference", model);
 }
 public void Update(TradeReferenceModel tradereference)
 {
     Delete(tradereference.Id);
     Add(tradereference);
 }