public ActionResult Create(FormCollection collection)
        {
            var model = new Material();
            this.TryUpdateModel<Material>(model);

            this.BasisDataService.SaveMaterial(model);

            return this.RefreshParent();
        }
        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 Material();
            ViewData.Add("ClassificationID", new SelectList(classlList, "ID", "Name", model.ClassificationID));
            var stu = new { Name = "一次性材料", IsAvailability =false };
            var list = Enumerable.Repeat(stu, 1).ToList();
            list.Add(new { Name = "可复用材料", IsAvailability = true });
            ViewData.Add("IsAvailability", new SelectList(list,"IsAvailability","Name"));
            return View("Edit", model);
        }
 public void SaveMaterial(Material material)
 {
     using (var dbContext = new BasisDataDbContext())
     {
         if (material.ID > 0)
         {
             dbContext.Update<Material>(material);
         }
         else
         {
             dbContext.Insert<Material>(material);
         }
     }
 }