private void Purchase_Click(object sender, RoutedEventArgs e) { if (this.uprice.Text == "" || this.uid.Text == "") { uStatus.Content = "Please Verify the Product ID!"; } else { Item newItem = new Item(); newItem.id = this.uid.Text; newItem.price = Int32.Parse(this.uprice.Text); newItem.Catagory = this.ucatagory.Text; newItem.size = Int32.Parse(this.usize.Text); newItem.color = this.ucolor.Text; newItem.brand = this.ubrand.Text; newItem.date = DateTime.Today; PLayer newLayer = new PLayer(); int count = newLayer.NewSale(newItem); if (count > 0) { uStatus.Content = "Item Sold..."; this.uid.Text = ""; this.uprice.Text = ""; this.ucatagory.Text = ""; this.usize.Text = ""; this.ucolor.Text = ""; this.ubrand.Text = ""; this.udpDate.SelectedDate = DateTime.Today; this.reciept.Text = ""; } else { uStatus.Content = "An Error Occurred..."; this.uid.Text = ""; this.uprice.Text = ""; this.ucatagory.Text = ""; this.usize.Text = ""; this.ucolor.Text = ""; this.ubrand.Text = ""; this.udpDate.SelectedDate = DateTime.Today; } } }