private void bt_add_Click(object sender, RoutedEventArgs e) { KitTemplate kt = findkit(cb_addkit.SelectedItem.ToString()); List <Commande_DisplayItem> check = cdi_list.Where(x => x.KitName == kt.getName().ToString() + " " + kt.getProperties().ToString()).ToList(); if (check.Count() == 0) { cdi_list.Add(new Commande_DisplayItem( kt.getName().ToString() + " " + kt.getProperties().ToString(), BikeQuantity.Text + "x", ((float)(kt.getPrice() * int.Parse(BikeQuantity.Text)) / 100).ToString("c2"), kt.getPrice() * int.Parse(BikeQuantity.Text) ) ); } else { check[0].qnt = BikeQuantity.Text + "x"; check[0].price = ((float)(kt.getPrice() * int.Parse(BikeQuantity.Text)) / 100).ToString("c2"); check[0].intprice = kt.getPrice() * int.Parse(BikeQuantity.Text); } total.Text = (((float)totalCalcul() / 100)).ToString("c2"); kitList.ItemsSource = null; kitList.ItemsSource = cdi_list; }
public modCompatibleKitWindow(KitTemplate kt_) { InitializeComponent(); // initialise the windows kt = kt_; //display the kit data tb_kitName.Text = kt.getName(); set_lb_selectCompIt_content(); }
public modKitWindow(KitTemplate kt_) { InitializeComponent(); kt = kt_; foreach (KitCategory i in Enum.GetValues(typeof(KitCategory))) { ComboBoxItem cbi = new ComboBoxItem(); cbi.Content = tools.Converter.GetCatName(i); cbi.Tag = i; kit_cat.Items.Add(cbi); } //display the user data tb_editName.Text = kt.getName(); tb_editProperties.Text = kt.getProperties(); tb_editPrice.Text = kt.getPrice().ToString(); kit_cat.SelectedIndex = (int)kt.getCategory(); tb_editBikeQtt.Text = kt.getBikeQtt().ToString(); }
public static int updateKitTemplate(KitTemplate kt) { string q = DatabaseQuery.updateKitTemplate(kt.getId(), kt.getName(), (int)kt.getCategory(), kt.getPrice(), kt.getProperties(), kt.getStockQtt(), kt.getStockLocationX(), kt.getStockLocationY(), kt.getBikeQtt()); return(Database.setData(q)); }