예제 #1
0
 private void LessonEditFm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (Biz.Grp != null && Biz.Modify && !ExUI.Confirm("退出将丢失对当前数据所做的编辑"))
     {
         e.Cancel = true;
     }
 }
예제 #2
0
 private void MMenuSysInit_Click(object sender, EventArgs e)
 {
     if (ExUI.Confirm("系统初始化,将删除所有数据"))
     {
         VC2WinFmApp.DataRule.SysInit();
         ExUI.ShowInfo("系统初始化结束,当前是一个空白系统,建议使用'菜单\\工具\\数据向导'快速建立贵校数据");
     }
 }
예제 #3
0
        private Boolean Save()
        {
            BaseEntity Ety;

            if (EditState == eDataEditState.esInsert)
            {
                Ety = MainBF.NewEty();
            }
            else
            {
                Ety = MainGrdBind.Current as BaseEntity;
                Ety = Ety.Clone() as BaseEntity;
            }

            SetEtyField(Ety);

            //检测
            if (String.IsNullOrEmpty(Ety.Name))
            {
                ExUI.ShowInfo("名称必须填写");
                tbName.Focus();
                return(false);
            }
            if (MainBF.NameExist(Ety) &&
                !ExUI.Confirm(MainBF.Kind + ": '" + Ety.Name + "'已存在,是否继续?"))
            {
                tbName.Focus();
                return(false);
            }

            Ety = MainBF.SaveEty(Ety);
            if (EditState == eDataEditState.esInsert)
            {
                MainGrdBind.Add(Ety);
            }
            else
            {
                MainGrdBind.Refresh();
            }

            return(true);
        }