private void LoadAct() { foreach (OleDbDataReader reader in ThisModule.OleDB.EachRows( "select Id, FActTimes from TClsLesson")) { Int64 ClsLsnId = Convert.ToInt64(reader[0]); ClsLsnContainer ClsLsnCnt; if (!ClsLsns.TryGetValue(ClsLsnId, out ClsLsnCnt)) { ThisModule.ErrorLog.Error("VcLsnAct恢复错误:ID对应的实体不存在 " + " ClsLesson: " + ClsLsnId); continue; } String ActTimes = reader[1].ToString(); if (String.IsNullOrEmpty(ActTimes)) { continue; } for (Int32 i = 0; i < ActTimes.Length; i++) { //for (Int32 i = ActTimes.Length - 1; i >= 0; i--) if (ActTimes[i] != '_') { EnLsnAct Act = new EnLsnAct(); ActId++; Act.Id = ActId; Act.Time.Week = (DayOfWeek)(i / (4 * 7)); Act.Time.BetideNode = (eBetideNode)((i % (4 * 7)) / 7); Act.Time.Order = i % 7; Act.Locked = ActTimes[i] == 'A'; Act.ClsLesson = ClsLsnCnt.ClsLsn; if (ClsLsnCnt.Acts.Count < ClsLsnCnt.ClsLsn.SharedTime) { ClsLsnCnt.Acts.Add(Act); } } } Int32 cntDec = ClsLsnCnt.ClsLsn.SharedTime - ClsLsnCnt.Acts.Count; for (Int32 cnt = 0; cnt < cntDec; cnt++) { EnLsnAct Act = new EnLsnAct(); ActId++; Act.Id = ActId; Act.ClsLesson = ClsLsnCnt.ClsLsn; ClsLsnCnt.Acts.Add(Act); } if (ClsLsnCnt.Acts.Count != ClsLsnCnt.ClsLsn.SharedTime) { ExUI.ShowInfo(ClsLsnCnt.Acts.Count + "/" + ClsLsnCnt.ClsLsn.SharedTime); } } }
private void MMenuSysInit_Click(object sender, EventArgs e) { if (ExUI.Confirm("系统初始化,将删除所有数据")) { VC2WinFmApp.DataRule.SysInit(); ExUI.ShowInfo("系统初始化结束,当前是一个空白系统,建议使用'菜单\\工具\\数据向导'快速建立贵校数据"); } }
private void MMenuWizardTeacher_Click(object sender, EventArgs e) { Int32 AppendCount = 0; if (WizardTeacherFm.WizardAddTeacher(ref AppendCount)) { ExUI.ShowInfo("成功添加教师" + AppendCount + "名"); } }
private void MMenuWizardSquad_Click(object sender, EventArgs e) { Int32 AppendCount = 0; if (WizardSquadFm.WizardAddSquad(ref AppendCount)) { ExUI.ShowInfo("成功添加班级" + AppendCount + "项"); } }
private void MMenuWizardCourse_Click(object sender, EventArgs e) { Int32 AppendCount = 0; if (WizardCourseFm.WizardAddCourse(ref AppendCount)) { ExUI.ShowInfo("成功添加课程" + AppendCount + "项"); } }
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); }
public static void ExportData(String kind, VCExportDataGroup data) { if (kind == cExportToHtml) { String fileName = ExFileDialog.GetSaveFileName(ExFileDialog.FileFilter_Html, data.Name + ".htm", Environment.GetFolderPath(Environment.SpecialFolder.Personal)); if (!String.IsNullOrEmpty(fileName)) { try { String[,] mData = ArrangeData(data); ToHtml.ExportDataToHtml(fileName, data.Name, mData); ExUI.ShowInfo("成功输出" + data.Name + ": " + fileName); } catch (Exception e) { ExUI.ShowInfo("输出失败信息: " + e.Message); } } } else if (kind == cExportToExcel) { String fileName = ExFileDialog.GetSaveFileName(ExFileDialog.FileFilter_Excel, data.Name + ".xls", Environment.GetFolderPath(Environment.SpecialFolder.Personal)); if (!String.IsNullOrEmpty(fileName)) { try { String[,] mData = ArrangeData(data); new BindToExcelImpl().ArrayToExcel(mData, fileName); ExUI.ShowInfo("成功输出" + data.Name + ": " + fileName); } catch (Exception e) { ExUI.ShowInfo("输出失败信息: " + e.Message); } } } }
private void InputDataError(object sender, DataGridViewDataErrorEventArgs e) { ExUI.ShowInfo("请输入正确的数据格式"); e.Cancel = true; }
public static void ExportData(String kind, VCExportData data) { ExUI.ShowInfo("暂未实现"); }