コード例 #1
0
 public bool modificar(tbProductos producto)
 {
     try
     {
         using (var context = new dbSuperJMEntities1())
         {
             context.Entry <tbProductos>(producto).State = System.Data.Entity.EntityState.Modified;
             context.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
コード例 #2
0
 public bool guardar(tbProductos producto)
 {
     try
     {
         using (dbSuperJMEntities1 context = new dbSuperJMEntities1())
         {
             context.tbProductos.Add(producto);
             context.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
コード例 #3
0
        public List <tbProductos> obtenerlista(int producto)
        {
            try
            {
                using (dbSuperJMEntities1 contex = new dbSuperJMEntities1())
                {
                    int est = 1;

                    return((from c in contex.tbProductos
                            where c.Estado == est
                            select c).ToList());
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }