Exemple #1
0
 public string Update(Tablas_BD tablas)
 {
     try
     {
         using (var context = new BarandillasEntities())
         {
             context.Entry(tablas).State = System.Data.Entity.EntityState.Modified;
             context.SaveChanges();
             return tablas.Nombre;
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #2
0
 public string Insert(Tablas_BD tablas)
 {
     try
     {
         using (var context = new BarandillasEntities())
         {
             context.Tablas_BD.Add(tablas);
             context.SaveChanges();
             return tablas.Nombre;
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
        public static string saveData(string NombreTabla, string Descripcion, string TipoTabla)
        {
            try
            {
                Tablas_BD t = new Tablas_BD();
                t.Nombre = NombreTabla;
                t.Descripcion = Descripcion;
                t.TipoTabla = TipoTabla;
                t.Estatus = true;
                string data = LogicaLayer.Insert(t);
                return data;

            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }