public void Update(cod_materiales oMaterial)
        {
            using (cooperativaEntities bd = new cooperativaEntities())
            {
                var editar = (from p in bd.cod_materiales
                              where p.id_material == oMaterial.id_material
                              select p).Single();

                editar.material = oMaterial.material;
                bd.SaveChanges();
            }
        }
        public void CargarCombo(ComboBox combo, string InsertaFila)
        {
            IList ListaMateriales = GetAll();

            cod_materiales oMaterial = new cod_materiales();
            oMaterial.id_material = 0;
            oMaterial.material = InsertaFila;

            ListaMateriales.Insert(0, oMaterial);
            combo.DisplayMember = "material";
            combo.ValueMember = "id_material";
            combo.DataSource = ListaMateriales;
        }
        public cod_materiales Get(int id)
        {
            cod_materiales oMaterial = new cod_materiales();

            using (cooperativaEntities bd = new cooperativaEntities())
            {
                var regis = (from p in bd.cod_materiales
                             where p.id_material == id
                             select p).Single();
                oMaterial.id_material = regis.id_material;
                oMaterial.material = regis.material;
                return oMaterial;
            }
        }
 public void Save(cod_materiales oMaterial)
 {
     cooperativaEntities bd = new cooperativaEntities();
     bd.cod_materiales.AddObject(oMaterial);
     bd.SaveChanges();
 }
 /// <summary>
 /// Create a new cod_materiales object.
 /// </summary>
 /// <param name="id_material">Initial value of the id_material property.</param>
 public static cod_materiales Createcod_materiales(global::System.Int32 id_material)
 {
     cod_materiales cod_materiales = new cod_materiales();
     cod_materiales.id_material = id_material;
     return cod_materiales;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the cod_materiales EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTocod_materiales(cod_materiales cod_materiales)
 {
     base.AddObject("cod_materiales", cod_materiales);
 }