Exemple #1
0
        private CellPhone GetPhone(CellPhone myPhone)
        {
            decimal phonePrice = 0m;

            decimal.TryParse(PhonePriceTextBox.Text, out phonePrice);
            myPhone.SetBrand(PhoneBrandTextBox.Text);
            myPhone.SetModel(PhoneModelTextBox.Text);
            myPhone.SetPrice(phonePrice);

            myPhone.GetBrand();
            myPhone.GetModel();
            myPhone.GetPrice();

            return(myPhone);
        }
Exemple #2
0
        private CellPhone GetPhone(CellPhone myPhone)         //Get phone method which is pretented to get all the infomation of the phone
        {
            decimal phonePrice = 0m;

            if (decimal.TryParse(PhonePriceTextBox.Text, out phonePrice))
            {
                myPhone.SetBrand(PhoneBrandTextBox.Text);
                myPhone.SetModel(PhoneModelTextBox.Text);
                myPhone.SetPrice(phonePrice);
            }
            else
            {
                MessageBox.Show("The phone price in invaild - Please try agian");
                PhonePriceTextBox.SelectAll();
            }

            myPhone.GetBrand();
            myPhone.GetModel();
            myPhone.GetPrice();

            return(myPhone);
        }