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))); } }
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); }
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))); } }
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); }