Ejemplo n.º 1
0
 private void btnAddSellRule_Click(object sender, EventArgs e)
 {
     SellRuleWindow s = new SellRuleWindow();
     if (s.ShowDialog() == DialogResult.OK)
     {
         SellRule rule = s.SellRule;
         lstSellRules.Items.Add(rule);
         rule.Priority = lstSellRules.Items.Count;
         SaveSellRules();
     }
 }
Ejemplo n.º 2
0
 private void ModifySellRule()
 {
     if (lstSellRules.SelectedIndex < 0)
         return;
     SellRule selectedRule = (SellRule)lstSellRules.SelectedItem;
     int selectedIndex = lstSellRules.SelectedIndex;
     SellRuleWindow s = new SellRuleWindow(selectedRule);
     if (s.ShowDialog() == DialogResult.OK)
     {
         lstSellRules.Items.Remove(selectedRule);
         lstSellRules.Items.Insert(selectedIndex, s.SellRule);
         lstSellRules.SelectedItem = s.SellRule;
         SaveSellRules();
     }
 }