private void returnBookbtn_Click(object sender, EventArgs e) { try { int lendID = Int32.Parse(lendsDataGridView.Rows[lendsDataGridView.SelectedRows[0].Index].Cells[0].Value.ToString()); int bookID = (int)lendsTableAdapter.FiilBookIDByLendID(lendID); this.lendsTableAdapter.ReturnBook(lendID); this.stocksTableAdapter.IncreaseNumber(bookID); InformationForm information = new InformationForm("Selected book is returned from selected visitor.", "Info"); information.Show(); } catch (DBConcurrencyException) { MessageBox.Show("An errer occured while crud operation on database!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Please select a row first!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Lends_Load(sender, e); } }
private void InfoButton_Click(object sender, EventArgs e) { Form form = new InformationForm(this); this.Enabled = false; form.Show(); }
private static void ShowError() { var form = new InformationForm(); form.SetInfoText("Invalid Input"); form.ShowDialog(); }
private void ShowError(string text) { var infoDialog = new InformationForm(); infoDialog.SetInfoText(text); infoDialog.OnFinish += Finish; infoDialog.ShowDialog(); }
private void Evaluation_button_Click(object sender, EventArgs e) { InformationForm infoEvaluationForm = new InformationForm(this, mConfiguration); this.Enabled = false; this.Hide(); infoEvaluationForm.Show(); }
private void AxMap1_ShapeHighlighted(object sender, _DMapEvents_ShapeHighlightedEvent e) { if (identifyFlag) { InformationForm informationForm = new InformationForm(axMap1, e); informationForm.Show(); identifyFlag = false; } }
private void OnTimedEvent(object sender, ElapsedEventArgs e) { timer.Enabled = false; var unHandledLetter = Program.Service.GetUnhandledLetter(); if (unHandledLetter.NoticeCount != lastUnHandledLetter.NoticeCount) { lbNotice.Text = String.Format("通知({0})", unHandledLetter.NoticeCount.ToString()); } if (unHandledLetter.MessageCount != lastUnHandledLetter.MessageCount) { lbMessage.Text = String.Format("私信({0})", unHandledLetter.MessageCount.ToString()); } if (unHandledLetter.ReminderCount != lastUnHandledLetter.ReminderCount) { lbReminder.Text = String.Format("提醒({0})", unHandledLetter.ReminderCount.ToString()); } //todo: 需要考虑小于的情况 if (unHandledLetter.NoticeCount > lastUnHandledLetter.NoticeCount) { var infoForm = new InformationForm(String.Format("您有{0}条未处理的通知。", (unHandledLetter.NoticeCount).ToString()), Program.Service.NoticeLink); new Thread(() => { Application.Run(infoForm); }).Start(); } if (unHandledLetter.MessageCount > lastUnHandledLetter.MessageCount) { var infoForm = new InformationForm(String.Format("您有{0}条未处理的私信。", (unHandledLetter.MessageCount).ToString()), Program.Service.MessageLink); new Thread(() => { Application.Run(infoForm); }).Start(); } if (unHandledLetter.ReminderCount > lastUnHandledLetter.ReminderCount) { var infoForm = new InformationForm(String.Format("您有{0}条到期提醒。", (unHandledLetter.ReminderCount).ToString()), Program.Service.ReminderLink); new Thread(() => { Application.Run(infoForm); }).Start(); } lastUnHandledLetter = unHandledLetter; timer.Enabled = true; }
public InteractiveController(MainRepository mR, FormLogin fl) { mr = mR; fL = fl; fi = new FormInteractive(); ObjectForm = new InformationForm(); GetRequest(); InitListeners(); InitProgram(); }
private void btnUninstall_Click(object sender, EventArgs e) { var comd2 = "net stop \"" + txtName.Text + "\""; ExecuteCommandLine.ExecuteCommand(comd2); var comd = "sc delete \"" + txtName.Text + "\""; ExecuteCommandLine.ExecuteCommand(comd); //btnInstall.Enabled = true; //btnUninstall.Enabled = false; var frmSuccess = new InformationForm(); frmSuccess.Show(); }
private void btnInstall_Click(object sender, EventArgs e) { var comd1 = "sc.exe create " + txtName.Text + " binPath= \"" + txtPath.Text + "\""; ExecuteCommandLine.ExecuteCommand(comd1); var comd2 = "net start \"" + txtName.Text + "\""; ExecuteCommandLine.ExecuteCommand(comd2); //btnInstall.Enabled = false; //btnUninstall.Enabled = true; var frmSuccess = new InformationForm(); frmSuccess.Show(); }
///<summary> ///程序初始化 ///</summary> public void Initialization() { //鼠标悬停菜单透明 MainMenu.Renderer = new MyRenderer(); // //实例化:检测画面子菜单 SubForm_Check = new SubForm(); SubForm_Check.TopLevel = false; SubForm_Check.Dock = DockStyle.Fill; SubForm_Check.FormBorderStyle = FormBorderStyle.None; SubForm_Check.Size = MainFormPanel.Size; MainFormPanel.Controls.Add(SubForm_Check); SubForm_Check.Show(); //实例化:检测画面子菜单 InformationForm = new InformationForm(); InformationForm.TopLevel = false; InformationForm.Dock = DockStyle.Fill; InformationForm.FormBorderStyle = FormBorderStyle.None; InformationForm.Size = MainFormPanel.Size; MainFormPanel.Controls.Add(InformationForm); InformationForm.Show(); //实例化:参数更改画面 ChangeParaForm = new ChangeParaForm(); ChangeParaForm.TopLevel = false; ChangeParaForm.Dock = DockStyle.Fill; ChangeParaForm.FormBorderStyle = FormBorderStyle.None; ChangeParaForm.Size = MainFormPanel.Size; MainFormPanel.Controls.Add(ChangeParaForm); ChangeParaForm.Show(); //参数读写 ChangeParaForm.LineDetect.SaveParamsEvent += new LineDetect.SaveParamsDelegate(() => { SubForm_Check.CheckForm_Pos2.ReadParams(); }); ChangeParaForm.InspectionStandard.SaveParamsEvent += new InspectionStandard.SaveParamsDelegate(() => { SubForm_Check.CheckForm_Pos2.ReadParams(); }); //InformationForm刷新 SubForm_Check.CheckForm_Pos2.RefreshInformationForm_Event += new CheckForm_4Views.RefreshInformationForm_Delegate(RefreshInformationForm); SubForm_Check.CheckForm_Pos2.RefreshInformationForm_Chart_Event += new CheckForm_4Views.RefreshInformationForm_Chart_Event_Delegate(RefreshInformationForm_Chart); InformationForm.RefreshInformationForm_Chart_Event += new InformationForm.RefreshInformationForm_Chart_Event_Delegate(RefreshInformationForm_Chart); //生产数据更新 SubForm_Check.CheckForm_Pos2.ProductionData_Event += new CheckForm_4Views.ProductionData_Delegate(RefreshProductionData); }
private void deleteRecordbtn_Click(object sender, EventArgs e) { try { this.stocksTableAdapter.DeleteStock(Int32.Parse(stocksDataGridView.Rows[stocksDataGridView.SelectedRows[0].Index].Cells[0].Value.ToString())); InformationForm information = new InformationForm("Selected stock record is deleted.", "Info"); information.Show(); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Please select a row first!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.ViewStocks_Load(sender, e); } }
private void editBookbtn_Click(object sender, EventArgs e) { try { EditBook editBook = new EditBook(); editBook.bookID = Int32.Parse(booksDataGridView.Rows[booksDataGridView.SelectedRows[0].Index].Cells[0].Value.ToString()); editBook.ShowDialog(); InformationForm information = new InformationForm("Selected book is edited.", "Info"); information.Show(); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Please select a row first!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.ViewBooks_Load(sender, e); } }
private void lendBookbtn_Click(object sender, EventArgs e) { try { LendBook lendBook = new LendBook(); lendBook.ShowDialog(); if (isChanged) { InformationForm information = new InformationForm("A book is lent.", "Info"); information.Show(); } } catch (Exception) { MessageBox.Show("Something wrong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Lends_Load(sender, e); } }
private void addAuthorbtn_Click(object sender, EventArgs e) { try { AddAuthor addAuthor = new AddAuthor(); addAuthor.ShowDialog(); if (isChanged) { InformationForm information = new InformationForm("An author is added.", "Info"); information.Show(); } } catch (Exception) { MessageBox.Show("Something wrong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.ViewAuthors_Load(sender, e); } }
private void addStockRecordbtn_Click(object sender, EventArgs e) { try { NewRecord newRecord = new NewRecord(); newRecord.ShowDialog(); if (isChanged) { InformationForm information = new InformationForm("New stock record is added.", "Info"); information.Show(); } } catch (Exception) { MessageBox.Show("Something wrong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.ViewStocks_Load(sender, e); } }
private void editAuthorbtn_Click(object sender, EventArgs e) { try { EditAuthor editAuthor = new EditAuthor(); editAuthor.authorID = Int32.Parse(authorsDataGridView.Rows[authorsDataGridView.SelectedRows[0].Index].Cells[0].Value.ToString()); editAuthor.ShowDialog(); if (isChanged) { InformationForm information = new InformationForm("Selected author is edited.", "Info"); information.Show(); } } catch (ArgumentOutOfRangeException) { MessageBox.Show("Please select a row first!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.ViewAuthors_Load(sender, e); } }
private void doActionbtn_Click(object sender, EventArgs e) { switch (comboBox1.Text) { case "Add Genre": try { Genre genre = new Genre(); genre.name = tbParameter.Text; genresTableAdapter.Create(genre.name); InformationForm information = new InformationForm("A genre is added.", "Info"); information.Show(); } catch (DBConcurrencyException) { MessageBox.Show("An errer occured while crud operation on database!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.ViewGenres_Load(sender, e); } break; case "Edit Selected Genre Name": try { Genre genre = new Genre(); genre.name = tbParameter.Text; genresTableAdapter.UpdateGenre(genre.name, Int32.Parse(genresDataGridView.Rows[genresDataGridView.SelectedRows[0].Index].Cells[0].Value.ToString())); InformationForm information = new InformationForm("Selected genre is edited.", "Info"); information.Show(); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Please select a row to edit!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (DBConcurrencyException) { MessageBox.Show("An errer occured while crud operation on database!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.ViewGenres_Load(sender, e); } break; case "Delete Selected Genre": try { this.genresTableAdapter.DeleteGenre(Int32.Parse(genresDataGridView.Rows[genresDataGridView.SelectedRows[0].Index].Cells[0].Value.ToString())); InformationForm information = new InformationForm("Selected genre is deleted.", "Info"); information.Show(); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Please select a row first!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.ViewGenres_Load(sender, e); } break; default: break; } }
private void tsmInfo_Click(object sender, EventArgs e) { InformationForm infoForm = new InformationForm(); infoForm.Show(); }
public static void Show(string information) { InformationForm dialog = new InformationForm(information); dialog.ShowDialog(); }
private void pictureBox3_Click(object sender, EventArgs e) { InformationForm form = new InformationForm(); form.ShowDialog(); }