Exemplo n.º 1
0
        /// <summary>
        /// Returns an ObservableCollection of suburbs from database.
        /// </summary>
        /// <returns></returns>
        public static SuburbList GetSuburbs()
        {
            string storedProcedureText = "usp_getSuburbs";

            MySqlDataReader result = ExecuteReader(storedProcedureText);

            SuburbList suburbList = new SuburbList();

            while (result.Read())
            {
                suburbList.Add(new Suburb(result.GetString("suburbName")));
            }

            result.Close();

            return(suburbList);
        }
Exemplo n.º 2
0
        public static SuburbList UnselectedSuburbsList(Contractor contractor)
        {
            string storedProcedureName = "usp_getContractorUnselectedSuburbs";

            MySqlParameter[] parameterList = new MySqlParameter[]
            {
                new MySqlParameter("contractorIDIn", contractor.ContractorID)
            };

            MySqlDataReader result = ExecuteReader(storedProcedureName, parameterList);

            SuburbList suburbList = new SuburbList();

            while (result.Read())
            {
                suburbList.Add(new Suburb(result.GetString("SuburbName")));
            }

            result.Close();

            return(suburbList);
        }