private void Buy_Clicked(object sender, EventArgs e)
        {
            var       buttonSender = (Button)sender;
            HeadPhone headPhone    = (buttonSender.CommandParameter as HeadPhone);

            viewModels.headPhonesChoose.Add(headPhone);
        }
        public async void Init(HeadPhone _headphone)
        {
            viewModel.headPhone = _headphone;
            await viewModel.GetBrand();

            viewModel.headPhone.Brands = viewModel.Brandss.Single(x => x.Id == _headphone.BrandId);
        }
示例#3
0
        public void Post([FromBody] HeadPhone headPhone)
        {
            headPhone.Id     = Guid.NewGuid();
            headPhone.Brands = null;

            _gearContext.HeadPhones.Add(headPhone);
            _gearContext.SaveChanges();
        }
 private async void CPUlist_ItemTapped(object sender, ItemTappedEventArgs e)
 {
     HeadPhone selected = e.Item as HeadPhone;
     await Navigation.PushAsync(new HeadPhoneInfo(selected));
 }
        private void SaveItembutton_Click(object sender, EventArgs e)
        {
            if (cmbItem.SelectedItem == null)
            {
                MessageBox.Show("Select Item!!");
            }
            else if (cmbBrandName.SelectedItem.ToString() == "")
            {
                MessageBox.Show("Write Brand");
            }

            else
            {
                Item   d        = null;
                string Itemname = cmbItem.SelectedItem.ToString();
                //MessageBox.Show(Itemname);
                if (Itemname == ProductName.Dongle3G.ToString())
                {
                    d = new Dongle3G();
                }
                else if (Itemname == ProductName.Laptop.ToString())
                {
                    d = new Laptop();
                }
                else if (Itemname == ProductName.HeadPhone.ToString())
                {
                    d = new HeadPhone();
                }
                else if (Itemname == ProductName.OS_License.ToString())
                {
                    d = new OS_License();
                }
                else if (Itemname == ProductName.Antivirus.ToString())
                {
                    d = new AntiVirus();
                }
                else if (Itemname == ProductName.Application_License.ToString())
                {
                    d = new ApplicationLicense();
                }
                try
                {
                    d.Brand        = cmbBrandName.SelectedItem.ToString();
                    d.CreationDate = CreationDateTimePicker.Value;

                    // d.ActualExpiryDate = ActualExpiryTimePicker.Value;


                    d.WarrantyExpiration = WarrantyExpiryTimePicker.Value;
                    d.WarrantyExists     = "True";
                    d.IsAssigned         = "False";
                    itemhelper.Save(d, productFilePath);
                    MessageBox.Show("Item Added");
                    // MessageBox.Show();

                    ItInfrastructureManagementLoad(null, null);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
示例#6
0
 public Study(HeadPhone headPhone, YouTube youtube, Computer computer)
 {
     _headPhone = headPhone;
     _youTube   = youtube;
     _computer  = computer;
 }
 public HeadPhoneInfo(HeadPhone headPhone)
 {
     InitializeComponent();
     this.BindingContext = viewModel = new GearViewModel();
     Init(headPhone);
 }