Example #1
0
        private void Inventario_Clase_A_Controles()
        {
            var Entidad = InventarioDB.getArticulo(this._IdArticulo);

            if (Entidad != null)
            {
                this.numCantidad.Value          = Entidad.CantidadActual;
                this.numCantidadAlerta.Value    = Entidad.CantidadAlerta;
                this.cbEstado.SelectedValue     = Entidad.InventarioEstado.IdEstado;
                this.cbTipoUnidad.SelectedValue = Entidad.InventarioTipoUnidad.IdTipoUnidad;
                this.txtNombre.Text             = Entidad.Nombre;
                this.numPrecio.Value            = Entidad.Precio;
                this.txtPresentacion.Text       = Entidad.Presentacion;
            }
        }
Example #2
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     if (this.dgConsulta.SelectedRows.Count == 1)
     {
         if (ClinicaPro.BL.Mensaje.isSeguroDeEliminar())
         {
             int  Id     = (int)this.dgConsulta.SelectedRows[0].Cells["IdArticulo"].Value;
             bool result = InventarioDB.Eliminar(Id);
             if (result)
             {
                 ClinicaPro.BL.Mensaje.MensajeGuardadoEnDB("Inventario");
             }
         }
     }
     else
     {
         MessageBox.Show(this, Mensajes.Seleccione_Una_Fila, Mensajes.Upss_Falto_Algo, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #3
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     if (!Validar())
     {
         int result;
         if (this._IdArticulo < 1)
         {
             result = InventarioDB.Agregar(Inventario_Controles_A_Clase());
         }
         else
         {
             result = InventarioDB.Modificar(Inventario_Controles_A_Clase());
         }
         if (result > 0)
         {
             ClinicaPro.BL.Mensaje.MensajeGuardadoEnDB("Articulo Inventario");
             Limpiar();
         }
     }
 }
Example #4
0
        public static bool Guardar(RegistroSpare spare)
        {
            bool retorno = false;

            try
            {
                var db = new InventarioDB();

                //  if (db.usuario.Find(usuario) != null)
                //        db.Entry(usuario).State = EntityState.Modified;
                //   else
                db.spare.Add(spare);

                db.SaveChanges();
                retorno = true;
            }
            catch (Exception)
            {
                throw;
            }

            return(retorno);
        }
Example #5
0
 private void cargarGrid()
 {
     InventarioDB.Listar(this.dgConsulta);
     colorFilasCantidadAlerta();
 }