コード例 #1
0
ファイル: Program.cs プロジェクト: MadNomad/solutions
 static void Main(string[] args)
 {
     new UIHelper().header();
                 new UIHelper().exerciseHeader(1, "Создать класс с именем Address");
                 Address adr = new Address();
                 adr.index = 49000;
                 adr.country = "Ukraine";
                 adr.city = "Dniepropetrovsk";
                 adr.street = "Troicka St.";
                 adr.house = "3A";
                 adr.apartment = "13";
                 Console.WriteLine("{0}, {1}, {2}, {3}, {4}, {5}", adr.index.ToString(), adr.country, adr.city, adr.street, adr.house, adr.apartment);
                 Console.ReadKey();
 }
コード例 #2
0
ファイル: Address.cs プロジェクト: MattClement1/Address
        private void btnShowAddress_Click(object sender, EventArgs e)
        {
            Address address = new Address();
            address.aptNumber = this.txtAptNumber.Text;
            address.streetAddress = this.txtStreetAddress.Text;
            address.city = this.txtCity.Text;
            string selectedProvince = this.cboProvinces.Text;
            address.province = (PROVINCES)Enum.Parse(typeof(PROVINCES), selectedProvince, true);
            string selectedType = this.cboStreetType.Text;
            address.streetType = (STREET_TYPE)Enum.Parse(typeof(STREET_TYPE), selectedType, true);

            address.postalCode = this.txtPostalCode.Text;

            if (address.aptNumber == "")
            {
                ShowAddress(address.streetAddress, address.streetType, address.city, address.province, address.postalCode);
            }
            else
            {
                ShowAddress(address.aptNumber, address.streetAddress, address.streetType, address.city, address.province, address.postalCode);
            }
        }