Exemple #1
0
        private void Search_Click(object sender, RoutedEventArgs e)
        {
            PLayer newLayer = new PLayer();
            Sale   toUpdate = newLayer.fetchSale(this.uid.Text);

            if (toUpdate != null)
            {
                uStatus.Content           = "";
                this.uid.Text             = toUpdate.id;
                this.uprice.Text          = toUpdate.price.ToString();
                this.ucatagory.Text       = toUpdate.catagory;
                this.usize.Text           = toUpdate.size.ToString();
                this.ucolor.Text          = toUpdate.color;
                this.ubrand.Text          = toUpdate.brand;
                this.udpDate.SelectedDate = toUpdate.purchaseDate;
            }
            else
            {
                uStatus.Content           = "INCORRECT ID";
                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         = "";
                this.uname.Text           = "";
                this.uphone.Text          = "";
                this.uaddress.Text        = "";
                this.ucharges.Text        = "";
            }
        }