Esempio n. 1
0
        private void Search2_Click(object sender, RoutedEventArgs e)
        {
            PLayer  newLayer = new PLayer();
            Service toUpdate = newLayer.fetchService(this.vid.Text);

            if (toUpdate != null)
            {
                vStatus.Content                = "";
                this.vid.Text                  = toUpdate.id;
                this.vprice.Text               = toUpdate.price.ToString();
                this.vcatagory.Text            = toUpdate.catagory;
                this.vsize.Text                = toUpdate.size.ToString();
                this.vcolor.Text               = toUpdate.color;
                this.vbrand.Text               = toUpdate.brand;
                this.vdpDate.SelectedDate      = toUpdate.purchaseDate;
                this.vReturnDate.SelectedDate  = toUpdate.returnDate;
                this.vServiceDate.SelectedDate = toUpdate.serviceDate;
                this.vname.Text                = toUpdate.customerName;
                this.vphone.Text               = toUpdate.phone;
                this.vcharges.Text             = toUpdate.serviceCharges.ToString();
                this.vaddress.Text             = toUpdate.address;
            }
            else
            {
                vStatus.Content           = "INCORRECT ID";
                this.vid.Text             = "";
                this.vprice.Text          = "";
                this.vcatagory.Text       = "";
                this.vsize.Text           = "";
                this.vcolor.Text          = "";
                this.vbrand.Text          = "";
                this.vdpDate.SelectedDate = DateTime.Today;
                this.vname.Text           = "";
                this.vphone.Text          = "";
                this.vaddress.Text        = "";
                this.vcharges.Text        = "";
            }
        }