예제 #1
0
        public ActionResult Create(FormCollection collection)
        {
            /*    try
             *  {
             *      // TODO: Add insert logic here
             *
             *      return RedirectToAction("Index");
             *  }
             *  catch
             *  {
             *      return View();
             *  }*/


            MantenimientoArticulo ma = new MantenimientoArticulo();
            Articulo articulo        = new Articulo
            {
                codigo      = int.Parse(collection["codigo"]),
                description = collection["description"],
                precio      = collection["precio"]
            };

            ma.Alta(articulo);

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult Create(FormCollection collection)
        {
            MantenimientoArticulo ma = new MantenimientoArticulo();
            Articulo art             = new Articulo
            {
                Codigo      = int.Parse(collection["codigo"]),
                Descripcion = collection["descripcion"],
                Precio      = float.Parse(collection["precio"].ToString())
            };

            ma.Alta(art);
            return(RedirectToAction("Index"));
        }
예제 #3
0
 public ActionResult Create(FormCollection collection)
 {
     try
     {
         // TODO: Add insert logic here
         MantenimientoArticulo ma = new MantenimientoArticulo();
         Articulo art = new Articulo
         {
             Codigo = int.Parse(collection["codigo"]),
             Descripcion = collection["descripcion"],
             Precio = float.Parse(collection["precio"])
         };
         
         ma.Alta(art);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }