/// <summary>
 /// Crear un nuevo objeto Bodega.
 /// </summary>
 /// <param name="idEmpresa">Valor inicial de la propiedad IdEmpresa.</param>
 /// <param name="idBodega">Valor inicial de la propiedad IdBodega.</param>
 public static Bodega CreateBodega(global::System.Int32 idEmpresa, global::System.Int32 idBodega)
 {
     Bodega bodega = new Bodega();
     bodega.IdEmpresa = idEmpresa;
     bodega.IdBodega = idBodega;
     return bodega;
 }
 /// <summary>
 /// Método desusado para agregar un nuevo objeto al EntitySet Bodega. Considere la posibilidad de usar el método .Add de la propiedad ObjectSet&lt;T&gt; asociada.
 /// </summary>
 public void AddToBodega(Bodega bodega)
 {
     base.AddObject("Bodega", bodega);
 }
Ejemplo n.º 3
0
        public Boolean guardar(clsBodega ctm, ref string Mensaje)
        {
            try
            {
                using (INVENTARIOEntities te = new INVENTARIOEntities())
                {
                    Bodega tm = new Bodega();

                       tm. IdEmpresa = Convert.ToInt32(ctm.empresa);
                        tm.IdBodega = ctm.codigo;
                        tm.Decripcion = ctm.descripcion;
                        tm.Capacidadm2 = ctm.capacidadm2;
                        tm.IdResponsable = Convert.ToInt32(ctm.responsable);
                        tm.IdPercha = Convert.ToInt32(ctm.percha);
                        tm.Direccion = ctm.direccion;
                        tm.Telefono = ctm.telefono;

                        tm.IdEstado = Convert.ToInt32(ctm.estado);

                    te.AddToBodega(tm);
                    te.SaveChanges();
                 }
                return true;
            }
            catch (Exception e)
            {

                Mensaje = "ERROR" + e.InnerException + e.Message;
                //System.Windows.Forms.MessageBox.Show("error al guardar" + e);
                return false;
            }
        }