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)); }