Beispiel #1
0
 private void OpenComputer(clsAllComputers prComputer)
 {
     if (prComputer != null)
     {
         Frame.Navigate(typeof(pgComputer), prComputer);
     }
 }
        internal async static Task <string> DeleteComputerAsync(clsAllComputers prComputers)
        {
            using (HttpClient lcHttpClient = new HttpClient())
            {
                HttpResponseMessage lcRespMessage = await lcHttpClient.DeleteAsync
                                                        ($"http://localhost:12292/api/ComputerSales/DeleteComputer?ComputerName={prComputers.Name}&BrandName={prComputers.BrandName}");

                return(await lcRespMessage.Content.ReadAsStringAsync());
            }
        }
        private void UpdatePage(clsOrder prOrder, clsAllComputers prComputers)
        {
            _Computers = prComputers;
            _Order     = prOrder;

            txtCustomerName.Text    = _Order.CustomerName;
            txtCustomerPhone.Text   = _Order.CustomerPhone;
            txtCustomerAddress.Text = _Order.CustomerAddress;
            txtComputerName.Text    = _Computers.ComputerID.ToString();
            txtQuantity.Text        = _Order.OrderQuantity.ToString();
            txtPrice.Text           = _Computers.Price.ToString();
            txtDate.Text            = _Order.OrderDateTime.ToString();
        }
        private void UpdatePage(clsAllComputers prComputers)
        {
            _Computers           = prComputers;
            txtComputerName.Text = _Computers.Name;
            txtPrice.Text        = _Computers.Price.ToString();
            txtLastModified.Text = _Computers.LastModified.ToString("d");
            txtQuantity.Text     = _Computers.Quantity.ToString();
            txtRam.Text          = _Computers.Ram;
            txtHDD.Text          = _Computers.HDD;
            txtGraphics.Text     = _Computers.Graphics;

            txtComputerName.IsEnabled = string.IsNullOrEmpty(_Computers.Name);
            txtPrice.IsEnabled        = string.IsNullOrEmpty(_Computers.Price.ToString());
            txtLastModified.IsEnabled = string.IsNullOrEmpty(_Computers.LastModified.ToString());
            txtQuantity.IsEnabled     = string.IsNullOrEmpty(_Computers.Quantity.ToString());
            txtRam.IsEnabled          = string.IsNullOrEmpty(_Computers.Ram);
            txtHDD.IsEnabled          = string.IsNullOrEmpty(_Computers.HDD);
            txtGraphics.IsEnabled     = string.IsNullOrEmpty(_Computers.Graphics);

            (ComputerSpecs.Content as IComputerControl).UpdateControl(prComputers);
        }
 private void DispatchComputerContent(clsAllComputers prComputer)
 {
     _ComputerContent[prComputer.Type].DynamicInvoke(prComputer);
     UpdatePage(prComputer);
 }
 private void RunLaptop(clsAllComputers prComputers)
 {
     ComputerSpecs.Content = new UserControlLaptop();
 }
Beispiel #7
0
        public void UpdateControl(clsAllComputers _Computers)
        {
            txtTowerType.Text = _Computers.TowerType;

            txtTowerType.IsEnabled = string.IsNullOrEmpty(_Computers.TowerType);
        }
Beispiel #8
0
 public void PushData(clsAllComputers _Computers)
 {
     _Computers.TowerType = txtTowerType.Text;
 }
        public void UpdateControl(clsAllComputers _Computers)
        {
            txtColor.Text = _Computers.Color;

            txtColor.IsEnabled = string.IsNullOrEmpty(_Computers.Color);
        }
 public void PushData(clsAllComputers _Computers)
 {
     _Computers.Color = txtColor.Text;
 }