示例#1
0
        /// <summary>
        /// Cargar un Almacen
        /// </summary>
        /// <returns>Un Almacen</returns>
        public static Models.Almacen CargaAlmacen(string idAlmacen)
        {
            object[] paramArray = new object[2];
            try
            {
                paramArray[0] = idAlmacen == "" ? null : idAlmacen;
                paramArray[1] = null;

                var db = DatabaseFactory.CreateDatabase("SQLStringConn");

                using (IDataReader dataReader = db.ExecuteReader("usp_CargarAlmacenes", paramArray))
                {
                    while (dataReader.Read())
                    {
                        var objAlmacen = new Models.Almacen()
                        {
                            id = Convert.ToInt32(dataReader["idAlmacen"]),
                            nombreAlmacen = Convert.ToString(dataReader["nombreAlmacen"]),
                            idEstatus = Convert.ToInt32(dataReader["idEstatus"])
                        };
                        return objAlmacen;
                    }
                }
            }
            catch (Exception exp)
            {
                throw new ApplicationException(exp.Message, exp);
            }
            return null;
        }
 public SearchRecipeView()
 {
     this.InitializeComponent();
     GastroCloud.Models.Almacen almacen = new Models.Almacen();
     gridAlmacen.ItemsSource = almacen.getDescuento();
     txtBuscador.Focus(FocusState.Programmatic);
 }
 public MovementView()
 {
     this.InitializeComponent();
     GastroCloud.Models.Almacen almacen = new Models.Almacen();
     gridAlmacenS.ItemsSource = almacen.getDescuento();
     gridAlmacenE.ItemsSource = almacen.getDescuento();
     GastroCloud.Models.Insumo insumo = new Models.Insumo();
     gridInsumos.ItemsSource = insumo.getDescuento();
 }
示例#4
0
        public frmAlmacenCRED(int?id = null)
        {
            InitializeComponent();
            this.Id = id;

            POSEntities pOSEntities = new POSEntities();

            if (Id != null)
            {
                Models.Almacen categoria = pOSEntities.Almacens.Find(Id);
                txtCodigo.Text    = id.ToString();
                txtCategoria.Text = categoria.Almacen1;
                button1.Text      = "Editar";
            }
        }
示例#5
0
        private void button1_Click(object sender, EventArgs e)
        {
            POSEntities pOSEntities = new POSEntities();

            if (Id != null)
            {
                Models.Almacen categoria = pOSEntities.Almacens.Find(Id);
                categoria.Almacen1 = txtCategoria.Text.ToUpper().Trim();
            }
            else
            {
                Models.Almacen categoria = new Models.Almacen();
                categoria.Almacen1 = txtCategoria.Text.ToUpper().Trim();
                pOSEntities.Almacens.Add(categoria);
            }


            pOSEntities.SaveChanges();
            MessageBox.Show("almacen Creada");
            this.Close();
        }
 public IndexAlmacen()
 {
     this.InitializeComponent();
     GastroCloud.Models.Almacen almacen = new Models.Almacen();
     gridAlmacen.ItemsSource = almacen.getDescuento();
 }
 public ActionResult Nuevo()
 {
     var objAlmacen = new Models.Almacen() { idEstatus = 1 };
     ViewBag.Titulo = "Nuevo";
     return PartialView("_Nuevo", objAlmacen);
 }