コード例 #1
0
        public IHttpActionResult GetListadoVentasACuenta(string usuario, int idCliente, string desCliente)
        {
            try
            {
                if (desCliente == null)
                {
                    desCliente = "";
                }
                VentaBL        oVentaBL = new VentaBL(idCliente);
                ListadoVentaBE obe      = oVentaBL.ListadoVentasACuenta(usuario, idCliente, desCliente);

                if (obe != null && (obe.listado != null && obe.listado.Count > 0))
                {
                    return(Ok(Models.Util.GetBodyResponse(200, obe)));
                }
                else
                {
                    return(Ok(Models.Util.GetBodyResponse(300, "No se encontraron registros.")));
                }
            }
            catch (Exception ex)
            {
                /*LogSA.GrabarLogError("SOL TR", user, "GetListarOrdOtrs", ex);*/
                return(Ok(Models.Util.GetBodyResponse(400, ex.Message)));
            }
        }
コード例 #2
0
ファイル: VentaBL.cs プロジェクト: centrixperu/ventasAPI
        public ListadoVentaBE ListadoVentasACuenta(string usuario, int idCliente, string codCliente)
        {
            List <ListaComboBE> lobeTienda = new List <ListaComboBE>();

            using (SqlConnection conR = new SqlConnection(strCnxRule))
            {
                conR.Open();
                lobeTienda = oMaestrosDA.ComboTienda(conR, usuario, idCliente, -1);
            }

            ListadoVentaBE obe = new ListadoVentaBE();

            using (SqlConnection con = new SqlConnection(strCnx))
            {
                con.Open();
                obe = oVentaDA.ListadoVentasACuenta(con, usuario, idCliente, codCliente, lobeTienda);
            }

            return(obe);
        }
コード例 #3
0
        public IHttpActionResult GetListadoVentas(string usuario, int idCliente, bool isDia, bool isMes, bool isAnio, bool isRango,
                                                  string fechaInicio, string fechaFin)
        {
            try
            {
                VentaBL        oVentaBL = new VentaBL(idCliente);
                ListadoVentaBE obe      = oVentaBL.ListadoVentas(usuario, idCliente, isDia, isMes, isAnio, isRango, fechaInicio, fechaFin);

                if (obe != null && (obe.listado != null && obe.listado.Count > 0))
                {
                    return(Ok(Models.Util.GetBodyResponse(200, obe)));
                }
                else
                {
                    return(Ok(Models.Util.GetBodyResponse(300, "No se encontraron registros.")));
                }
            }
            catch (Exception ex)
            {
                /*LogSA.GrabarLogError("SOL TR", user, "GetListarOrdOtrs", ex);*/
                return(Ok(Models.Util.GetBodyResponse(400, ex.Message)));
            }
        }
コード例 #4
0
ファイル: VentaBL.cs プロジェクト: centrixperu/ventasAPI
        public ListadoVentaBE ListadoVentas(string usuario, int idCliente, bool isDia, bool isMes, bool isAnio, bool isRango,
                                            string fechaInicio, string fechaFin)
        {
            List <ListaComboBE> lobeTienda = new List <ListaComboBE>();

            using (SqlConnection conR = new SqlConnection(strCnxRule))
            {
                conR.Open();
                lobeTienda = oMaestrosDA.ComboTienda(conR, usuario, idCliente, -1);
            }

            ListadoVentaBE obe = new ListadoVentaBE();

            using (SqlConnection con = new SqlConnection(strCnx))
            {
                con.Open();
                if (isDia)
                {
                    obe = oVentaDA.ListadoVentasDia(con, usuario, idCliente, fechaInicio, lobeTienda);
                }
                else if (isMes)
                {
                    obe = oVentaDA.ListadoVentasMes(con, usuario, idCliente, fechaInicio, lobeTienda);
                }
                else if (isAnio)
                {
                    obe = oVentaDA.ListadoVentasAnio(con, usuario, idCliente, fechaInicio, lobeTienda);
                }
                else if (isRango)
                {
                    obe = oVentaDA.ListadoVentasRango(con, usuario, idCliente, fechaInicio, fechaFin, lobeTienda);
                }
            }

            return(obe);
        }