Пример #1
0
        public static decimal CalcularGananciaPorCliente(Object id)
        {
            RepoCliente     repoCliente = new RepoCliente();
            RepoImportacion r           = new RepoImportacion();
            decimal         ganancia    = repoCliente.ObtenerPorcentajeGanancia();
            decimal         descuento   = repoCliente.ObtenerPorcentajeDescuento();
            int             antiguedad  = repoCliente.ObtenerAntiguedadMinima();

            decimal total = 0;

            foreach (Importacion i in r.ImportacionesEnStockCliente(id))
            {
                total += i.GananciaPrevista(ganancia, descuento, antiguedad);
            }
            return(total);
        }
Пример #2
0
        public static decimal CalcularGananciaPorImportacion(Importacion i)
        {
            RepoCliente     repoCliente = new RepoCliente();
            RepoImportacion r           = new RepoImportacion();
            decimal         ganancia    = repoCliente.ObtenerPorcentajeGanancia();
            decimal         descuento   = repoCliente.ObtenerPorcentajeDescuento();
            int             antiguedad  = repoCliente.ObtenerAntiguedadMinima();

            decimal total = 0;

            if (i != null)
            {
                total = i.GananciaPrevista(ganancia, descuento, antiguedad);
            }

            return(total);
        }