public IHttpActionResult ClientesNoMayores(ClientesNoMayores usr) { try { var resp = new _01_Dal.Dal.Metodos().BuscarUsuarioNoMayores(usr); return(Ok(resp)); } catch (Exception ex) { return(InternalServerError(ex)); } }
public IEnumerable <ClientesNoMayores> BuscarUsuarioNoMayores(ClientesNoMayores ObjUser) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConCC"].ToString()); try { using (IDbConnection db = conn) { var p = new DynamicParameters(); p.Add("@fchInicioVenta", ObjUser.fchInicioVenta, dbType: DbType.Date, direction: ParameterDirection.Input); p.Add("@fchFinVenta", ObjUser.fchFinVenta, dbType: DbType.Date, direction: ParameterDirection.Input); return(db.Query <ClientesNoMayores>("spConsultaClientesNoMayores", p, commandType: CommandType.StoredProcedure).AsList()); } } catch (Exception ex) { throw ex; } }