Пример #1
0
        private void AddItem_Click(object sender, RoutedEventArgs e)
        {
            Item newItem = new Item();

            newItem.id       = this.id.Text;
            newItem.price    = Int32.Parse(this.price.Text);
            newItem.Catagory = this.catagory.Text;
            newItem.size     = Int32.Parse(this.size.Text);
            newItem.color    = this.color.Text;
            newItem.brand    = this.brand.Text;
            newItem.date     = DateTime.Today;
            PLayer AddItem = new PLayer();
            int    count   = AddItem.insertItem(newItem);

            if (count > 0)
            {
                Status.Content           = "Item Inserted";
                this.id.Text             = "";
                this.price.Text          = "";
                this.catagory.Text       = "";
                this.size.Text           = "";
                this.color.Text          = "";
                this.brand.Text          = "";
                this.dpDate.SelectedDate = DateTime.Today;
            }
            else
            {
                Status.Content           = "No Item inserted...";
                this.id.Text             = "";
                this.price.Text          = "";
                this.catagory.Text       = "";
                this.size.Text           = "";
                this.color.Text          = "";
                this.brand.Text          = "";
                this.dpDate.SelectedDate = DateTime.Today;
            }
        }