예제 #1
0
        private void RuleGrid_DoubleClick(object sender, EventArgs e)
        {
            CurrencyManager cm = (CurrencyManager)this.BindingContext[this.RuleGrid.DataSource];

            if (cm.Count == 0)
            {
                return;
            }

            Object obj = cm.Current;

            if (obj == null || !(obj is VcActEtyRelation))
            {
                return;
            }

            VcActEtyRelation actEtyRln = obj as VcActEtyRelation;

            if (actEtyRln.Relation == eActEtyRelation.rule)
            {
                RuleSetupFm.SetEntityRule(actEtyRln.Entity);
            }
            else if (actEtyRln.Relation == eActEtyRelation.clash)
            {
                this.OpenScheduleFm((actEtyRln.Entity as EnClsLesson).Squad);
            }
            else  //教师
            {
                this.OpenScheduleFm(actEtyRln.Entity);
            }
        }
예제 #2
0
        public static void SetEntityRule(BaseEntity Ety)
        {
            Debug.Assert(Ety != null, "不可用null调用SetEntityRule");

            RuleSetupFm Fm = new RuleSetupFm();

            Fm.Entity = Ety;
            Fm.Text   = "设置<" + Ety + ">的规则";
            Fm.ShowDialog();
        }