예제 #1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                DTO.Bodega bodega = new DTO.Bodega();

                bodega.Bodega_ID    = Convert.ToInt32(txtBodegaID.Text);
                bodega.Nombre       = txtNombre.Text;
                bodega.Ubicacion_ID = Convert.ToInt32(cboUbicacion.SelectedValue);

                bodega.Create();
            }
            catch (Exception ex)
            {
            }
        }
예제 #2
0
        public bool ReadAll()
        {
            try
            {
                this.Coleccion = new List <Bodega>();
                foreach (var tmp in Common.ModeloEntidad.Bodega.ToList())
                {
                    Bodega bodega = new Bodega();
                    bodega.Bodega_ID    = tmp.Bodega_ID;
                    bodega.Nombre       = tmp.Nombre;
                    bodega.Ubicacion_ID = tmp.Ubicacion_ID;

                    this.Coleccion.Add(bodega);
                }
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["admin"] == null)
            {
                FormsAuthentication.SignOut();
                Response.Redirect("~/web/Login/Default.aspx");
            }
            if (!IsPostBack)
            {
                DTO.Articulo articulos = new DTO.Articulo();
                DTO.Bodega   bodegas   = new DTO.Bodega();

                if (articulos.ReadAll())
                {
                    foreach (var tmp in articulos.Coleccion)
                    {
                        ddArticulo.Items.Add(new ListItem()
                        {
                            Text = tmp.Articulo_ID, Value = tmp.Articulo_ID
                        });
                    }
                }
                if (bodegas.ReadAll())
                {
                    foreach (var tmp in bodegas.Coleccion)
                    {
                        ddBodegaEntrada.Items.Add(new ListItem()
                        {
                            Text = tmp.Nombre, Value = tmp.Bodega_ID.ToString()
                        });
                        ddBodegaSalida.Items.Add(new ListItem()
                        {
                            Text = tmp.Nombre, Value = tmp.Bodega_ID.ToString()
                        });
                    }
                }
            }
        }