コード例 #1
0
ファイル: DAL.cs プロジェクト: ulramite/BIT-Services
        /// <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);
        }
コード例 #2
0
ファイル: DAL.cs プロジェクト: ulramite/BIT-Services
        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);
        }