// // GET: /Cms/Article/Create public ActionResult Create() { var classlList = this.BasisDataService.GetClassificationList(new ClassificationRequest()); //this.ViewBag.Tags = this.CmsService.GetTagList(new TagRequest() { Top = 20, Orderby = Orderby.Hits }); var model = new Supplier(); ViewData.Add("material", new SelectList(classlList, "ID", "Name", "")); return View("Edit", model); }
public void SaveSupplier(Supplier supplier) { using (var dbContext = new BasisDataDbContext()) { if (supplier.ID > 0) { dbContext.Update<Supplier>(supplier); } else { dbContext.Insert<Supplier>(supplier); } } }
public ActionResult Create(FormCollection collection) { var model = new Supplier(); this.TryUpdateModel<Supplier>(model); this.BasisDataService.SaveSupplier(model); return this.RefreshParent(); }