Ejemplo n.º 1
0
 public ActionResult Edit(int key)
 {
     int materialKey = (int)key;
         var materialDB = new MaterialDB();
         var cvDB = new CvDB();
         MaterialModel material = materialDB.GetMaterialByKey(materialKey);
         material.MaterialTypeSelectList = new SelectList(cvDB.GetMaterialTypes(), "_MaterialType_key", "MaterialType");
         return View(material);
 }
Ejemplo n.º 2
0
 public ActionResult Create()
 {
     try
     {
         var cvDB = new CvDB();
         ViewBag._MaterialType_key = new SelectList(cvDB.GetMaterialTypes(), "_MaterialType_key", "MaterialType");
         return View();
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
         return View() ;
     }
 }
Ejemplo n.º 3
0
 public ActionResult Create(MaterialModel material)
 {
     try
     {
         var materialDB = new MaterialDB();
         var cvDB=new CvDB();
         material.MaterialTypeSelectList = new SelectList(cvDB.GetMaterialTypes(),"_MaterialType_key", "MaterialType");
         materialDB.Create(material);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }