public ActionResult Create(ExchangeOption exchangeoption) { if (ModelState.IsValid) { db.ExchangeOptions.Add(exchangeoption); try { db.SaveChanges(); } catch (Exception e) { Session["FlashMessage"] = "Failed to create exchange destination." + e.Message; return View(exchangeoption); } return RedirectToAction("Index"); } return View(exchangeoption); }
public ActionResult Create() { ExchangeOption m = new ExchangeOption(); m.status = true; return View(m); }
public ActionResult Edit(ExchangeOption exchangeoption) { if (ModelState.IsValid) { db.Entry(exchangeoption).State = EntityState.Modified; try { db.SaveChanges(); } catch (Exception e) { Session["FlashMessage"] = "Failed to edit exchange destination." + e.Message; return View(exchangeoption); } return RedirectToAction("Index"); } return View(exchangeoption); }