示例#1
0
        private void AddPhoneButton_Click(object sender, EventArgs e)
        {
            // create a cellphone object

            CellPhoneInventory myphone = new CellPhoneInventory();

            // get the phone data

            getdata(myphone);

            //Add the cell phone object to the list

            phoneList.Add(myphone);

            // add the entry to the list box

            PhoneListBox.Items.Add(myphone.Brand + " " + myphone.Model);

            // clear the contents of the textbox

            BrandTextBox.Clear();
            ModelTextBox.Clear();
            PriceTextBox.Clear();

            BrandTextBox.Focus();
        }
 private void Clear()
 {
     SaveButton.Enabled   = true;
     UpdateButton.Enabled = false;
     BrandTextBox.Clear();
     BrandTextBox.Focus();
 }
示例#3
0
        private void SubmitButton_Click(object sender, RoutedEventArgs e)
        {
            DB db = DB.Instance;

            if (Product.ValidPrice(PriceTextBox.GetLineText(0)))
            {
                Product product = new Product(
                    NameTextBox.GetLineText(0),
                    PriceTextBox.GetLineText(0),
                    CategoryTextBox.GetLineText(0),
                    BrandTextBox.GetLineText(0)
                    );
                product.AddToDB();
                Close();
            }
        }