コード例 #1
0
        public ActionResult Index()
        {
            //Listamos todas los laboratorios en una tabla
            DataTable listLaboratorio = DLaboratorio.listarLaboratorios();

            return(View(listLaboratorio));
        }
コード例 #2
0
        public void editarLaboratorio(string id, string nombre)
        {
            DLaboratorio Obj = new DLaboratorio();

            Obj.Id     = id;
            Obj.Nombre = nombre;
            Obj.editar(Obj);
        }
コード例 #3
0
 public ActionResult Edit(Laboratorio lab)
 {
     try
     {
         var conf1 = DLaboratorio.acutalizarLaboratorio(lab);
         ViewBag.confirmacionAL = conf1;
         return(View());
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine(e);
         return(View());
     }
 }
コード例 #4
0
 public ActionResult Create(Laboratorio lab)
 {
     try
     {
         // TODO: Add insert logic here
         var conf = DLaboratorio.insertarLaboratorio(lab);
         ViewBag.confirmacionL = conf;
         return(View());
     }
     catch
     {
         return(View());
     }
 }
コード例 #5
0
        // GET: Laboratorio/Delete/5
        public ActionResult Edit(int id)
        {
            DataTable dtLab = DLaboratorio.obtenerLaboratorio(id);

            if (dtLab.Rows.Count == 1)
            {
                Laboratorio objLab = new Laboratorio();

                objLab.IdLaboratorio    = Convert.ToInt32(dtLab.Rows[0][0].ToString());
                objLab.ClaveLaboratorio = Convert.ToString(dtLab.Rows[0][1].ToString());
                objLab.Nombre           = Convert.ToString(dtLab.Rows[0][2].ToString());

                return(View(objLab));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
コード例 #6
0
 public ActionResult Delete(int id)
 {
     System.Diagnostics.Debug.WriteLine(DLaboratorio.bajaLaboratorio(id));
     return(RedirectToAction("Index"));
 }