private void BtnAbout_Click(object sender, EventArgs e) { MsgBox AboutBox = new MsgBox(false); AboutBox.Show(this); AboutBox.Location = new Point(300, 200); }
private void button2_Click(object sender, EventArgs e) { try { MsgBox msgbox1 = new MsgBox(); msgbox1.Show(); } catch (Exception ex) { MessageBox.Show("Error: " + ex.ToString()); } }
public void Load_TimeTable_File_To_Grid(String FileName, System.Windows.Forms.Form mdiparent) { LastErrors.Clear(); bool Flag = SUID_ReadOnly_List.Count == 0; if (Flag && MessageBox.Show("載入資是否唯讀(不能修改)?","問唯讀",MessageBoxButtons.YesNo) == DialogResult.No) { Flag = false; } StreamReader sr = new StreamReader(FileName); string input = null; while ((input = sr.ReadLine()) != null) { string[] ar = input.Split(':'); if (ar.Length > 1) { int key = int.Parse(ar[0]); int a_suid = int.Parse(ar[1]); int classno = key / 100; int weekno = key / 10 % 10; int lessonno = key % 10; if (htbIDLessionUnit.ContainsKey(int.Parse(ar[1])) && Validate_SubjectUnitForLessonCell(a_suid, weekno, lessonno)) { AddSubjectToTimeTable(a_suid, weekno, lessonno); //htbs.TimeTableGrid[classno, weekno, lessonno] = a_suid; if (Flag) SUID_ReadOnly_List.Add(a_suid); } else if (TimeTableGrid[classno, weekno, lessonno] != a_suid) { LastErrors.Add(String.Format("ERROR:{0}:{1}-weekno{2},lessno{3},classno{4}", a_suid, htbIDLessionUnit[a_suid],weekno,lessonno,classno)); } } } if (LastErrors.Count > 0) { MsgBox mb = new MsgBox(LastErrors.ToArray()); if (mdiparent != null) { mb.MdiParent = mdiparent; mb.Show(); } else mb.ShowDialog(); } sr.Close(); sr.Dispose(); }
private void mnuLastError(Object sender, EventArgs e) { MsgBox msb = new MsgBox(Basic_HTB_Info.GetInstance().LastErrors.ToArray()); msb.MdiParent = this; msb.Show(); }
public FormTimeTableMDI() { InitializeComponent(); htbs = Basic_HTB_Info.GetInstance(); htbs.log("½Ð¡yÀɮסz:¡y¸ü¤J¤W¦¸¦sÀÉ ¡z¡C"); MsgBox msb = new MsgBox(Basic_HTB_Info.GetInstance().logToArray()); msb.MdiParent = this; msb.Show(); MainMenu fmainMenu = new MainMenu(); MenuItem initdata_msys = fmainMenu.MenuItems.Add("A.ªì©l¤Æ¸ê®Æ"); initdata_msys.MenuItems.Add(new MenuItem("Teacher.dat", (sender, e) => { Process notePad = new Process(); notePad.StartInfo.FileName = "notepad.exe"; String path_ = Basic_HTB_Info.baseFilePath + @"\BasicInfo\Teacher.dat"; notePad.StartInfo.Arguments = path_; notePad.Start(); })); initdata_msys.MenuItems.Add(new MenuItem("Subject.dat", (sender, e) => { Process notePad = new Process(); notePad.StartInfo.FileName = "notepad.exe"; String path_ = Basic_HTB_Info.baseFilePath + @"\BasicInfo\Subject.dat"; notePad.StartInfo.Arguments = path_; notePad.Start(); })); initdata_msys.MenuItems.Add(new MenuItem("Class.dat", (sender, e) => { Process notePad = new Process(); notePad.StartInfo.FileName = "notepad.exe"; String path_ = Basic_HTB_Info.baseFilePath + @"\BasicInfo\Class.dat"; notePad.StartInfo.Arguments = path_; notePad.Start(); })); initdata_msys.MenuItems.Add(new MenuItem("ClassMaster.dat", (sender, e) => { Process notePad = new Process(); notePad.StartInfo.FileName = "notepad.exe"; String path_ = Basic_HTB_Info.baseFilePath + @"\BasicInfo\ClassMaster.dat"; notePad.StartInfo.Arguments = path_; notePad.Start(); })); initdata_msys.MenuItems.Add("¥H¤W¥\¯à»Ýn«±Òµ{¦¡"); initdata_msys.MenuItems.Add("-"); initdata_msys.MenuItems.Add(new MenuItem("A4.½Òµ{¤À°tªí®æ_¶×¥X¡y³Ì¤p¥ô½Ò³æ¦ì Def Unit->file¡zCourse Assig Grid", (sender, e) => { FormCourseAssignGrid fcg = new FormCourseAssignGrid(new C_FormCourseAssignGridForSubjectUnit()); fcg.ShowDialog(); })); initdata_msys.MenuItems.Add(new MenuItem("A5.±Ð®v¥ð®§ªí_Teacher_Week_Take_Rest_Grid", (sender, e) => { FormCourseAssignGrid fcg = new FormCourseAssignGrid(new C_FormCourseAssignGridForTeacherRest()); fcg.ShowDialog(); })); initdata_msys.MenuItems.Add("-"); initdata_msys.MenuItems.Add(new MenuItem("A6.¦Û°Ê¤À°t½Òªíµ¦²¤", (sender, e) => { FormAssgControl fac = new FormAssgControl(); fac.ShowDialog(); })); MenuItem msys = fmainMenu.MenuItems.Add("B.ÀÉ®×"); msys.MenuItems.Add(new MenuItem("B1.¸ü¤J¤W½Ò³æ¦ìªí_Load Lesson Unit", this.menuLoadLessonUnitItem_click)); msys.MenuItems.Add(new MenuItem("B2.¸ü¤J±Ð®v¥ð®§ªíLoad Teacher Rest TimeTable", this.menuLoadTeacherRestimeTableItem_click)); msys.MenuItems.Add("-"); msys.MenuItems.Add(new MenuItem("B3.À˵ø¤À°t½Òµ{¤jªíAssig Subject Grid TimeTable", this.menuAssigSubjectGrid)); msys.MenuItems.Add("-"); msys.MenuItems.Add(new MenuItem("B4.¸ü¤J¤W¦¸¦sÀÉ Load old TimeTable", this.menuLoadOldTimeTableItem_click)); msys.MenuItems.Add("-"); msys.MenuItems.Add(new MenuItem("B5.¦sÀÉ",(sender, e)=>{ SaveTiemTableGridOut(); } )); MenuItem subj_With = fmainMenu.MenuItems.Add("C ¤À°t¦Cªí"); MenuItem subj_With_Class = subj_With.MenuItems.Add("C1.«ö¯Z"); MenuItem subj_With_Teacher = subj_With.MenuItems.Add("C2.«ö±Ð®v"); msys = fmainMenu.MenuItems.Add("D.¤À°t¯Zªí"); for (int i = 1; i <= htbs.htbIDClass.Count; i++) { msys.MenuItems.Add(new MenuItem(string.Format("{0}.{1}", i, htbs.htbIDClass[i]), this.menuClassNoItem_click)); subj_With_Class.MenuItems.Add(new MenuItem(string.Format("{0}.{1} Subject_List", i, htbs.htbIDClass[i]), this.menuFormClassNoTimeTableDoubleClick)); } msys.MenuItems.Add("All", this.menuAllClassNoItem_Click); msys = fmainMenu.MenuItems.Add("E.±Ð®vªí"); msys.MenuItems.Add(new MenuItem("±Ð®v", (sender, e) =>{ TeachernoInput ti = new TeachernoInput("Teacher Name:"); if (ti.ShowDialog() == DialogResult.OK ) { String[] stra = ti.out_res.Split(','); foreach (String s in stra) { if (Basic_HTB_Info.GetInstance().htbTeacherID.ContainsKey(s)) { int akey = int.Parse(Basic_HTB_Info.GetInstance().htbTeacherID[s].ToString()); FormClassNoTimeTableDoubleClick_Action aTT = new FormClassNoTimeTableDoubleClick_Action(""+akey+"."+s, new C_FormClassNoTimeTableDoubleClick_Teacher(akey)); aTT.MdiParent = this; aTT.updateList(); aTT.button_ADD.Enabled = false; aTT.Show(); } } } })); for (int i = 1; i <= htbs.htbIDTeacher.Count; i++) { msys.MenuItems.Add(new MenuItem(string.Format("{0}.{1}", i, htbs.htbIDTeacher[i]), this.menuTeacherNoItem_click)); subj_With_Teacher.MenuItems.Add(new MenuItem(string.Format("{0}.{1} Subject_List", i, htbs.htbIDTeacher[i]), this.menuFormClassNoTimeTableDoubleClick_Teacher)); } msys = fmainMenu.MenuItems.Add("F.³øªí"); msys.MenuItems.Add("F1.±Ð®v½Òµ{¦w±ÆReport Teacher TimeTable", mnuReport_Teacher_TimeTable); msys.MenuItems.Add("F2.¯Z¯Å½Òµ{¦w±ÆReport Class TimeTable", mnuReport_Class_TimeTable); msys.MenuItems.Add("-"); msys.MenuItems.Add("F3.½Òµ{¦w±ÆReport ClassSubjectTeacherCrosorTable", mnuReport_Cross_Table); msys.MenuItems.Add("F4.½Òµ{©P¸`¦w±ÆReport ClassSubjectWeekLessonCrosorTable", mnuReport_Cross_Week_Table); msys.MenuItems.Add("-"); msys.MenuItems.Add("F5.©P/¸`/(¯Z¯Å¬Y½Òµ{)Report Class TimeTable", mnuReport_WeekDay_Course_TimeTable); msys.MenuItems.Add("-"); msys.MenuItems.Add("F6.¤W¶Ç³ø¦Ü¦øªA¾¹", mnuReport_UploadTo250); msys = fmainMenu.MenuItems.Add("G.µ¡¤f"); msys.MenuItems.Add("G1 ¦P¨BDATA", mnuSynFormData_click); msys.MenuItems.Add("-"); msys.MenuItems.Add(new MenuItem("±Æ¦C¹Ï¼Ð", this.mnuIcons_click)); msys.MenuItems.Add(new MenuItem("¼h¼hÅ|Å|", this.mnuCascade_click)); msys.MenuItems.Add(new MenuItem("¤ô¥¾Q¥", this.mnuTileHorizontal_click)); msys.MenuItems.Add(new MenuItem("««ª½¾Q¥", this.mnuTileVertical_click)); msys.MenuItems.Add(new MenuItem("Ãö³¬©Ò¦³¤lµ¡¤f", this.CloseAllSubForm_click)); msys.MenuItems.Add("-"); msys.MenuItems.Add(new MenuItem("¦rÅé¤@", (sender, e) => { adjustFont(16f); })); msys.MenuItems.Add(new MenuItem("¦rÅé¤G", (sender, e) => { adjustFont(12f); })); msys.MenuItems.Add(new MenuItem("¦rÅé¤T", (sender, e) => { adjustFont(8f); })); msys.MenuItems.Add(new MenuItem("¦rÅé¥|", (sender, e) => { adjustFont(7f); })); msys.MenuItems.Add(new MenuItem("¦rÅé¤j¤p", this.mnuFontNum_click)); msys = fmainMenu.MenuItems.Add("H.¸ê°T"); msys.MenuItems.Add("Ū§Ú", mnuReadMe); msys.MenuItems.Add("À˵øLast Errors", mnuLastError); msys.MenuItems.Add("²M°£Clear Erros List", mnuClrError); msys.MenuItems.Add("-"); msys.MenuItems.Add(new MenuItem("«¸m¦r¨åªí Clear HTBS", this.menuClearHtbs)); this.Menu = fmainMenu; this.FormClosing += (sender, e) => { SaveTiemTableGridOut(); }; }
private void BtnQuit_Click(object sender, EventArgs e) { MsgBox QuitBox = new MsgBox(true); QuitBox.Show(this); QuitBox.Location = new Point(300, 200); }
private void btnConfirm_Click(object sender, EventArgs e) { string pre = txtPre.Text; int len = Common.Utils.TypeConverter.ObjectToInt(this.txtLen.Text); if (string.IsNullOrEmpty(this.txtStart.Text)) { Alert.Show("请输入起始编号!"); return; } if (string.IsNullOrEmpty(this.txtEnd.Text)) { Alert.Show("请输入结束编号!"); return; } bmHelper.BindControlToModel<Prod_Components>(GModel, this.groupBox2.Controls, ""); int start = Common.Utils.TypeConverter.ObjectToInt(txtStart.Text); int end = Common.Utils.TypeConverter.ObjectToInt(txtEnd.Text); List<Prod_Components> list = compInstance.GetPComponentsList(); List<string> newCompList = new List<string>(); StringBuilder sb = new StringBuilder(); //int successCount = 0; for (int i = start; i <= end; i++) { string index = i.ToString(); string result = string.Empty; if (len != 0) { result = index.PadLeft(len, '0'); } else { result = index; } string compno = pre + result; if (list.FirstOrDefault(o => o.PRDC_CompNo == compno) != null) { sb.Append(compno).Append(","); continue; } Prod_Components comp = new Prod_Components(); if (string.IsNullOrEmpty(compno)) { continue; } comp = GModel; comp.PRDC_CompNo = compno; comp.CreateTime = DateTime.Now; comp.UpdateTime = DateTime.Now; comp.PRDC_RecDate = DateTime.Now; comp.PRDC_iType = iTypeEnum.Comp.ToString(); comp.PRDC_VerifyResult = "Check"; compInstance.CompInsert(comp); newCompList.Add(compno); } this.txtStart.Text = string.Empty; this.txtEnd.Text = string.Empty; InsertDocument(newCompList); if (sb.ToString().Length != 0) { //Alert.Show(string.Format("以下零件编号已经存在请确认后重新输入")); MsgBox msgBox = new MsgBox(string.Format("成功生成{0}个,另外以下零件编号已存在请确认后重新输入:\n{1}", newCompList.Count,sb.ToString().Trim(','))); msgBox.Show(); } else { Alert.Show("批量生成成功!"); } }
private void btnConfirm_Click(object sender, EventArgs e) { string pre = txtPre.Text; int len = Common.Utils.TypeConverter.ObjectToInt(this.txtLen.Text); if (string.IsNullOrEmpty(this.txtStart.Text)) { Alert.Show("请输入起始编号!"); return; } if (string.IsNullOrEmpty(this.txtEnd.Text)) { Alert.Show("请输入结束编号!"); return; } bmHelper.BindControlToModel<Prod_Pool>(GModel, this.groupBox2.Controls, ""); int start = Common.Utils.TypeConverter.ObjectToInt(txtStart.Text); int end = Common.Utils.TypeConverter.ObjectToInt(txtEnd.Text); List<Prod_Pool> list = compInstance.GetAllProdCompList(); StringBuilder sb = new StringBuilder(); for (int i = start; i <= end; i++) { string index = i.ToString(); string result = string.Empty; if (len != 0) { result = index.PadLeft(len, '0'); } else { result = index; } string compno = pre + result; if (list.FirstOrDefault(o => o.PRP_ProdCode==compno) != null) { sb.Append(compno).Append(","); continue; } Prod_Pool comp = new Prod_Pool(); comp = GModel; comp.PRP_ProdCode = compno; comp.CreateTime = DateTime.Now; comp.UpdateTime = DateTime.Now; comp.PRP_IDate = DateTime.Now; //comp.PRDC_RecDate = DateTime.Now; comp.PRP_iType = ProdStat.In.ToString(); compInstance.PCInsert(comp); } this.txtStart.Text = string.Empty; this.txtEnd.Text = string.Empty; if (sb.ToString().Length != 0) { //Alert.Show(string.Format("以下零件编号已经存在请确认后重新输入")); MsgBox msgBox = new MsgBox(string.Format("以下成品编号已存在请确认后重新输入:\n{0}", sb.ToString().Trim(','))); msgBox.Show(); } else { Alert.Show("批量生成成功!"); } }