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 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 HalconMilenario_MouseHover(object sender, EventArgs e) { try { //Elimino el primer listener per a que no salti una altre vegada fi.halconMilenario.MouseHover -= HalconMilenario_MouseHover; //Instancio el listener leave fi.halconMilenario.MouseLeave += HalconMilenario_MouseLeave; //PictureBox pbox = ObjectForm.BackgroundImage; //pbox.Load("https://www.guioteca.com/curiosidades/files/2016/10/Halc%C3%B3n_Milenario.jpg"); ObjectForm.Show(); ObjectForm.Left = 400; ObjectForm.Top = 100; SetRequestForm(milenari.name, milenari.model, milenari.length + " m", milenari.max_atmosphering_speed + " Atm Speed"); } catch (Exception) { }; }
private void CheckInfoItem_Click(object sender, EventArgs e) { //按钮激活:信息统计按钮 MainMenuItemNum = 2; MainMenuItemActive(); MainMenuItemNum = 0; //子窗口调用:信息统计子窗口 MainFormPanel.Controls.Clear(); InformationForm.Show(); MainFormPanel.Controls.Add(InformationForm); }
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 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 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 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(); }