Exemple #1
0
        public void UpdateRequestOPDetail(WerkUI.Models.SolicitudOrdenPagoDetalle subject)
        {
            try
            {
                var db = new WerkERPContext();
                var solicitudOPDetalles = db.SolicitudOrdenPagoDetalles.Where(s => s.id_solicitud_orden_pago_detalle == subject.id_solicitud_orden_pago_detalle).SingleOrDefault();
                solicitudOPDetalles.importe              = subject.importe;
                solicitudOPDetalles.importe_aprobado     = subject.importe;
                solicitudOPDetalles.nro_concepto         = subject.nro_concepto;
                solicitudOPDetalles.observacion          = subject.observacion;
                solicitudOPDetalles.nro_despacho_interno = subject.nro_despacho_interno;

                db.SaveChanges();
                ErrorLabel.Text = String.Empty;
            }
            catch (DbEntityValidationException ex)
            {
                ErrorLabel.Visible = true;
                ErrorLabel.Text    = ex.Message;
            }
            catch (Exception exp)
            {
                ErrorLabel.Text    = exp.Message;
                ErrorLabel.Visible = true;
            }
        }
Exemple #2
0
        public void InsertRequestOPDetail()
        {
            var db = new WerkERPContext();
            var solicitudOPDetalles = new WerkUI.Models.SolicitudOrdenPagoDetalle();

            TryUpdateModel(solicitudOPDetalles);
            if (ModelState.IsValid)
            {
                try
                {
                    solicitudOPDetalles.cod_moneda = 1;
                    solicitudOPDetalles.id_solicitud_orden_pago = requestID;
                    solicitudOPDetalles.importe_aprobado        = solicitudOPDetalles.importe;

                    if (!VerifyDespachoInterno(solicitudOPDetalles.nro_despacho_interno.ToString()))
                    {
                        ErrorLabel.Visible = true;
                        ErrorLabel.Text    = "El número de Despacho Interno no es válido.";
                    }
                    else if (!VerifyConcpetoLiquidacion(solicitudOPDetalles.nro_concepto))
                    {
                        ErrorLabel.Visible = true;
                        ErrorLabel.Text    = "El numero de Concepto de Liquidación no es válido.";
                    }
                    else
                    {
                        db.SolicitudOrdenPagoDetalles.Add(solicitudOPDetalles);
                        db.SaveChanges();
                        ErrorLabel.Text = String.Empty;
                    }
                }
                catch (DbEntityValidationException ex)
                {
                    ErrorLabel.Visible = true;
                    ErrorLabel.Text    = ex.Message;
                }
                catch (Exception exp)
                {
                    ErrorLabel.Text    = exp.Message;
                    ErrorLabel.Visible = true;
                }
            }
        }
Exemple #3
0
 public void DeleteRequestOPDetail(WerkUI.Models.SolicitudOrdenPagoDetalle subject)
 {
     try
     {
         var db = new WerkERPContext();
         var solicitudOPDetalles = db.SolicitudOrdenPagoDetalles.Where(s => s.id_solicitud_orden_pago_detalle == subject.id_solicitud_orden_pago_detalle).SingleOrDefault();
         db.SolicitudOrdenPagoDetalles.Remove(solicitudOPDetalles);
         db.SaveChanges();
         ErrorLabel.Text = String.Empty;
     }
     catch (DbEntityValidationException ex)
     {
         ErrorLabel.Visible = true;
         ErrorLabel.Text    = ex.Message;
     }
     catch (Exception exp)
     {
         ErrorLabel.Text    = exp.Message;
         ErrorLabel.Visible = true;
     }
 }