コード例 #1
0
        public ActionResult <ProductorViewModel> detalle(int id)
        {
            Productor productor = _productorService.Detalle(id);

            if (productor == null)
            {
                return(null);
            }
            ProductorViewModel p = new ProductorViewModel(productor);

            return(p);
        }
コード例 #2
0
        public ProductorViewModel GetProductor(Guid productorid)
        {
            using (var context = new CooperativaProduccionEntities())
            {
                var productor = context.Vw_Productor
                                .Where(x => x.ID == productorid)
                                .Select(x => new
                {
                    ID = x.ID.Value,
                    x.NOMBRE,
                    x.CUIT,
                    x.nrofet,
                    x.Provincia,
                    x.IVA
                })
                                .Single();

                ProductorIVATASATypes situacionIVATASA;

                switch (productor.IVA)
                {
                case "MT":
                    situacionIVATASA = ProductorIVATASATypes.Monotributista;
                    break;

                default:
                    situacionIVATASA = ProductorIVATASATypes.ResponsableInscripto;
                    break;
                }

                var situacionIVATASADescripcion = ProductorIVATASA.GetDescription(situacionIVATASA);

                var productorvm = new ProductorViewModel()
                {
                    Id                          = productor.ID,
                    Nombre                      = productor.NOMBRE,
                    CUIT                        = productor.CUIT,
                    FET                         = productor.nrofet,
                    Provincia                   = productor.Provincia,
                    SituacionIVATASA            = situacionIVATASA,
                    SituacionIVATASADescripcion = situacionIVATASADescripcion
                };

                return(productorvm);
            }
        }
コード例 #3
0
        private void ActualizarControlesOrdenDePago(OrdenDePagoDetalleViewModel ordenvm, ProductorViewModel productorvm)
        {
            var fecha         = ordenvm.Fecha;
            var numerodeorden = ordenvm.NumeroDeOrden;
            var detalle       = ordenvm.Observaciones;
            var productor     = ordenvm.Productor;
            var cuit          = ordenvm.CUIT;
            var fet           = ordenvm.FET;
            var situacioniva  = productorvm.SituacionIVATASADescripcion;
            var provincia     = productorvm.Provincia;

            var importeporpagar = ordenvm.ImportePorPagar.ToString();

            var retencioniibb         = ordenvm.RetencionesAplicadas.Where(x => x.Nombre == RetencionTypes.RetencionIIBB).Single().Importe.ToString();
            var retencionEEAOC        = ordenvm.RetencionesAplicadas.Where(x => x.Nombre == RetencionTypes.RetencionEEAOC).Single().Importe.ToString();
            var retencionSaludPublica = ordenvm.RetencionesAplicadas.Where(x => x.Nombre == RetencionTypes.RetencionSaludPublica).Single().Importe.ToString();
            var retencionGADM         = ordenvm.RetencionesAplicadas.Where(x => x.Nombre == RetencionTypes.RetencionGADM).Single().Importe.ToString();
            var retencionGCIAS        = ordenvm.RetencionesAplicadas.Where(x => x.Nombre == RetencionTypes.RetencionGCIAS).Single().Importe.ToString();
            var retencionRiego        = ordenvm.RetencionesAplicadas.Where(x => x.Nombre == RetencionTypes.RetencionRiego).Single().Importe.ToString();

            var netoporpagar = ordenvm.NetoPorPagar.ToString();

            dpFechaOrden.Value   = fecha;
            txtNumOrdenPago.Text = numerodeorden.ToString();
            txtPuntoVenta.Text   = DevConstantes.PuntoVenta;
            txtDetalle.Text      = detalle;

            txtProductor.Text    = productor;
            txtCuit.Text         = cuit;
            txtFet.Text          = fet;
            txtSituacionIva.Text = situacioniva;
            txtProvincia.Text    = provincia;

            txtImporteBruto.Text = importeporpagar;

            //txtCesion.Text = "0.00";
            //txtComision.Text = "0.00";

            txtIIBB.Text         = retencioniibb;
            txtEEAOC.Text        = retencionEEAOC;
            txtSaludPublica.Text = retencionSaludPublica;
            txtGADM.Text         = retencionGADM;
            txtGanancias.Text    = retencionGCIAS;
            txtRiego.Text        = retencionRiego;

            //txtOtrosConceptos.Text = "0.00";
            //txtCuotaSocial.Text = "0.00";
            //txtAnticipos.Text = "0.00";

            txtNeto.Text = netoporpagar;
        }