private void button3_Click(object sender, EventArgs e) { SettingsForm settingsForm = new SettingsForm(); settingsForm.ShowDialog(); }
void MenuEvents(int menuId) { try { switch (menuId) { case (int)MenuItems.ExitMenu: { if (Program.Default.EnableExit == 1) Application.Exit(); break; } case (int)MenuItems.ViewProductMenu: { BTPrintClass.PrintClass.CheckForClear(); ActionsClass.Action.OpenProducts(); ActionsClass.Action.OpenScanned(); using (ViewProductForm frm = new ViewProductForm()) { //this.Visible = false; frm.ShowDialog(); } ActionsClass.Action.CloseProducts(); ActionsClass.Action.ClosedScanned(); ActionsClass.Action.ClearCache(); // this.Visible = true; //this.Activate(); break; } case (int)MenuItems.InventarMenu: { BTPrintClass.PrintClass.CheckForClear(); ActionsClass.Action.OpenProducts(); ActionsClass.Action.OpenScanned(); using (InventarForm frm = new InventarForm()) { //this.Visible = false; frm.ShowDialog(); } ActionsClass.Action.CloseProducts(); ActionsClass.Action.ClosedScanned(); ActionsClass.Action.ClearCache(); //this.Visible = true; //this.Activate(); break; } case (int)MenuItems.SimpleIncome: { BTPrintClass.PrintClass.CheckForClear(); ActionsClass.Action.OpenProducts(); ActionsClass.Action.OpenScanned(); using (InventarForm frm = new InventarForm(InventarFormMode.SimpleIncome)) { //this.Visible = false; frm.ShowDialog(); } ActionsClass.Action.CloseProducts(); ActionsClass.Action.ClosedScanned(); ActionsClass.Action.ClearCache(); //this.Visible = true; //this.Activate(); break; } case (int)MenuItems.IncomeMenu: { //this.Visible = false; BTPrintClass.PrintClass.CheckForClear(); ActionsClass.Action.OpenProducts(); ActionsClass.Action.OpenScanned(); using ( IncomeForm frm = new IncomeForm()) { frm.ShowDialog(); } ActionsClass.Action.CloseProducts(); ActionsClass.Action.ClosedScanned(); ActionsClass.Action.ClearCache(); //this.Visible = true; //this.Activate(); //BTPrintClass.PrintClass.SetStatusEvent("Form Closed"); break; } case (int)MenuItems.TTNForm: { //this.Visible = false; //thread = new System.Threading.Thread( // new System.Threading.ThreadStart( // frm_onBeginLoad)); //thread.IsBackground = false; //thread.Start(); using (TtnForm frm = new TtnForm()) { frm.onEndLoad += new EndLoadDelegate(frm_onEndLoad); BTPrintClass.PrintClass.CheckForClear(); ActionsClass.Action.OpenProducts(); ActionsClass.Action.OpenScanned(); //this.Visible = false; frm.ShowDialog(); //this.Visible = true; } ActionsClass.Action.CloseProducts(); ActionsClass.Action.ClosedScanned(); ActionsClass.Action.ClearCache(); //this.Visible = true; //this.Activate(); break; } case (int)MenuItems.ReturnBoxes: { //this.Visible = false; //thread = new System.Threading.Thread( // new System.Threading.ThreadStart( // frm_onBeginLoad)); //thread.IsBackground = false; //thread.Start(); using (ReturnForm frm = new ReturnForm()) { frm.onEndLoad += new EndLoadDelegate(frm_onEndLoad); BTPrintClass.PrintClass.CheckForClear(); ActionsClass.Action.OpenProducts(); ActionsClass.Action.OpenScanned(); //this.Visible = false; frm.ShowDialog(); //this.Visible = true; } ActionsClass.Action.CloseProducts(); ActionsClass.Action.ClosedScanned(); ActionsClass.Action.ClearCache(); //this.Visible = true; //this.Activate(); break; } case (int)MenuItems.ViewSettingMenu: { BTPrintClass.PrintClass.CheckForClear(); using (SettingsForm frm = new SettingsForm()) { //this.Visible = false; frm.ShowDialog(); } // this.Visible = true; //this.Activate(); break; } default: { break; } } } catch (Exception err) { MessageBox.Show(err.Message , "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } this.Refresh(); BTPrintClass.PrintClass.SetStatusEvent("Main Form Refreshed"); }
private void button3_Click(object sender, EventArgs e) { SettingsForm settingsForm = new SettingsForm(); settingsForm.ShowDialog(); cbEraseTerminalDB.Checked = Properties.Settings.Default.EraseTerminalDB; }