private void btnAgregar_Click(object sender, EventArgs e) { if ((decimal)iCantidad.EditValue == 0m) { XtraMessageBox.Show("Ingrese Cantidad", "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); iCantidad.Select(); return; } VwEntradaalmacendet vwEntradaalmacendet = (VwEntradaalmacendet)gvDetalle.GetFocusedRow(); if (vwEntradaalmacendet != null) { var cantidadtotalobs = VwEntradaalmacendetobsList.Sum(x => x.Cantidad); if (cantidadtotalobs != null) { if (cantidadtotalobs + (decimal)iCantidad.EditValue > vwEntradaalmacendet.Diferencia) { XtraMessageBox.Show("Cantidad de Diferencia Agotado", "Verifique", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); iCantidad.EditValue = 0m; iCantidad.Select(); return; } } Guardar(); Entradaalmacenobs entradaalmacenobs = new Entradaalmacenobs(); entradaalmacenobs.Cantidad = (decimal)iCantidad.EditValue; entradaalmacenobs.Idestadoarticulo = (int)iIdestadoarticulo.EditValue; entradaalmacenobs.Identradaalmacendet = vwEntradaalmacendet.Identradaalmacendet; var estadosel = EstadoarticuloingresoList.FirstOrDefault( x => x.Idestadoarticulo == (int)iIdestadoarticulo.EditValue); if (estadosel != null) { entradaalmacenobs.Procedereclamo = estadosel.Procedereclamo; Service.SaveEntradaalmacenobs(entradaalmacenobs); CargarDetalleObservado(vwEntradaalmacendet.Identradaalmacendet); iIdestadoarticulo.EditValue = null; iCantidad.EditValue = 0m; } } }
public void UpdateEntradaalmacenobs(Entradaalmacenobs entity) { EntradaalmacenobsDao.Update(entity); }
public int SaveEntradaalmacenobs(Entradaalmacenobs entity) { return(EntradaalmacenobsDao.Save(entity)); }