コード例 #1
0
        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;
                }
            }
        }
コード例 #2
0
 public void UpdateEntradaalmacenobs(Entradaalmacenobs entity)
 {
     EntradaalmacenobsDao.Update(entity);
 }
コード例 #3
0
 public int SaveEntradaalmacenobs(Entradaalmacenobs entity)
 {
     return(EntradaalmacenobsDao.Save(entity));
 }