internal static void AddConstraint(TourCostRule rule) { using (FrmRuleConstraintEditor frm = new FrmRuleConstraintEditor(rule)) { frm.ShowDialog(); } }
internal static void EditConstraint(TourCostRule rule, TourCostRuleConstraint con) { using (FrmRuleConstraintEditor frm = new FrmRuleConstraintEditor(rule, con)) { frm.ShowDialog(); } }
internal static void EditRule(TourCostRule rule) { using (FrmRuleEditor frm = new FrmRuleEditor(rule)) { frm.ShowDialog(); } }
internal static void LoadGroupRules(TourCostGroup group) { List <Int32> grpRules = new List <int>(); repo.LoadByGroupId(group.Id, grpRules); foreach (Int32 id in grpRules) { TourCostRule rule = rules.FindById(id); if (rule != null) { group.Rules.Add(rule); } } }
protected void OnItemCheck(object sender, ItemCheckEventArgs e) { TourCostRule item = (TourCostRule)this.Items[e.Index]; if (item != null) { if (e.NewValue == CheckState.Checked) { if (DomainModel.TourCostGroups.AddRuleToGroup(this.Group, item)) { this.Group.Rules.Add(item); } } else if (e.NewValue == CheckState.Unchecked) { if (DomainModel.TourCostGroups.RemoveRuleFromGroup(this.Group, item)) { this.Group.Rules.Remove(item); } } } }
internal static void DeleteRule(TourCostRule rule) { DomainModel.TourCostRules.Delete(rule); }
public static bool RemoveRuleFromGroup(TourCostGroup group, TourCostRule rule) { return(repo.RemoveRuleFromGroup(group.Id, rule.Id)); }
public static bool AddRuleToGroup(TourCostGroup group, TourCostRule rule) { return(repo.AddRuleToGroup(group.Id, rule.Id)); }