//======================================================================================================== //This method is called when the user clicks on the "Back" button when currently viewing archived entries. // It properly updates the dgv to show all entries in the weight table again //======================================================================================================== private async void btnCancelArchive_Click(object sender, EventArgs e) { SplashScreen _splash = new SplashScreen { StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = FormBorderStyle.None, WindowState = FormWindowState.Normal, MaximumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight), MinimumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight) }; await Task.Delay(200); _splash.Show(); _splash.BringToFront(); _splash.Focus(); await Task.Delay(200); DatabaseFunctions.ViewCurrent(); RefreshDGV(); DatabaseFunctions.DetachFile(); bolArchiveView = false; pnlDefault.Visible = true; pnlUpdate.Visible = false; pnlArchiveView.Visible = false; btnViewArchive.Visible = true; _splash.Close(); }
//======================================================================================================= //This method is called when the user clicks the "Archive Entry" button, it then shows a message box to // make sure the user wants to archive the order, if they click yes, it calls the "Archiving" method in // the DatabaseFunctions.cs file. //======================================================================================================= private async void btnArchiveEntry_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Are You Sure You Want To Archive This Entry?", "Archive Entry", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { SplashScreen _splash = new SplashScreen { StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = FormBorderStyle.None, WindowState = FormWindowState.Normal, MaximumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight), MinimumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight) }; await Task.Delay(200); _splash.Show(); _splash.BringToFront(); _splash.Focus(); await Task.Delay(200); DatabaseFunctions.Archiving(true); bolArchiveView = false; pnlDefault.Visible = true; pnlUpdate.Visible = false; pnlArchiveView.Visible = false; btnViewArchive.Visible = true; _splash.Close(); } }
//======================================================================================================== //This method is called when the user in view archived mode, which makes the entry not archived anymore. // If the list count is 0, it tells the user there are no entries to unarchive, if there is count greater // than 0 it calls DatabaseFunctions archive method //======================================================================================================== private async void btnUnarchive_Click(object sender, EventArgs e) { if (Program.PartWeights.Count > 0) { SplashScreen _splash = new SplashScreen { StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = FormBorderStyle.None, WindowState = FormWindowState.Normal, MaximumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight), MinimumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight) }; await Task.Delay(200); _splash.Show(); _splash.BringToFront(); _splash.Focus(); await Task.Delay(200); DatabaseFunctions.Archiving(false); bolArchiveView = false; pnlDefault.Visible = true; pnlUpdate.Visible = false; pnlArchiveView.Visible = false; btnViewArchive.Visible = true; _splash.Close(); } else { MessageBox.Show("No Entries To Unarchive"); } }
//======================================================================================================= //This method is called when the user hits the "View" button on frmMain. It then calls the proper // DatabaseFunctions method that will load the list with all current modules entered in the table // and also opens a new instance of frmView. Since this is the first time ViewCurrent is called, it // needs to create the new instance of frmView //======================================================================================================= private async void btnView_Click(object sender, EventArgs e) { this.Hide(); _FrmMainMen.Hide(); SplashScreen _splash = new SplashScreen { StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = FormBorderStyle.None, WindowState = FormWindowState.Normal, MaximumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight), MinimumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight) }; await Task.Delay(200); _splash.Show(); _splash.BringToFront(); _splash.Focus(); await Task.Delay(200); DatabaseFunctions.ViewCurrent(); _FrmView = new frmView(); await Task.Delay(200); _FrmView.Show(); _splash.Close(); }
//======================================================================================================= //This method is called when the user clicks the "Submit" button when they are currently in "UpdateRow" // mode. It makes sure there is data entered in each text box, when this is true, it calls the // "UpdateWeight" method from DatabaseFunction.cs. If the user has not entered info for each text box, // it will prompt them to fill out all fields and try again //======================================================================================================= private async void btnSubmitUpdate_Click(object sender, EventArgs e) { if (txtDepartUpdate.Text != "" && txtOp.Text != "" && txtPN.Text != "" && txtWeight.Text != "" && txtPartName.Text != "" && txtStdPack.Text != "") { SplashScreen _splash = new SplashScreen { StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = FormBorderStyle.None, WindowState = FormWindowState.Normal, MaximumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight), MinimumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight) }; await Task.Delay(200); _splash.Show(); _splash.BringToFront(); _splash.Focus(); await Task.Delay(200); DatabaseFunctions.UpdateWeight(txtDepartUpdate.Text, txtOp.Text, txtPN.Text, txtWeight.Text, txtPartName.Text, txtStdPack.Text, intTUID); pnlUpdate.Visible = false; pnlDefault.Visible = true; pnlArchiveView.Visible = false; btnViewArchive.Visible = true; _splash.Close(); } else { MessageBox.Show("Please Enter Info For Each Field"); } }
//======================================================================================================= //This method is called when the user clicks on the "Submit" button on frmMain. It then checks if all // text boxes arent empty, if they are they will prompt the user to enter info for all text boxes, if // all text boxes are filled out, it will call the proper DatabaseFunctions method to insert new entry // in the weight table //======================================================================================================= private async void btnSubmit_Click(object sender, EventArgs e) { if (txtDepart.Text != "" && txtOp.Text != "" && txtPN.Text != "" && txtWeight.Text != "" && txtPartName.Text != "" && txtSTDPack.Text != "") { SplashScreen _splash = new SplashScreen { StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = FormBorderStyle.None, WindowState = FormWindowState.Normal, MaximumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight), MinimumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight) }; await Task.Delay(200); _splash.Show(); _splash.BringToFront(); _splash.Focus(); await Task.Delay(200); DatabaseFunctions.InsertNew(txtDepart.Text, txtOp.Text, txtPN.Text, txtWeight.Text, txtPartName.Text, txtSTDPack.Text); _splash.Close(); } else { MessageBox.Show("Please Enter Info For Each Field"); } }
//======================================================================================================= //This method is called when the user clicks on the "Submit" button on frmMain. It then checks if all // text boxes arent empty, if they are they will prompt the user to enter info for all text boxes, if // all text boxes are filled out, it will call the proper DatabaseFunctions method to insert new entry // in the printer table //======================================================================================================= private async void btnSubmit_Click(object sender, EventArgs e) { string tempDept = txtDepart.Text; string tempPrinterName = txtPrinterName.Text; if (tempDept != "" && tempPrinterName != "") { SplashScreen _splash = new SplashScreen { StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = FormBorderStyle.None, WindowState = FormWindowState.Normal, MaximumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight), MinimumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight) }; await Task.Delay(200); _splash.Show(); _splash.BringToFront(); _splash.Focus(); await Task.Delay(200); DatabaseFunctions.InsertNew(tempDept, tempPrinterName); txtPrinterName.Text = ""; _splash.Close(); } else { System.Windows.MessageBox.Show("Please Enter Info For Each Field"); } }
public MainForm() { Thread.CurrentThread.CurrentUICulture = new CultureInfo(Properties.Settings.Default.userLanguage); allFileTypes.AddRange(videoFileTypes); allFileTypes.AddRange(audioFileTypes); allFileTypes.AddRange(ebooksFileTypes); allFileTypes.AddRange(subtitleFileTypes); allFileTypes.AddRange(torrentFileTypes); allFileTypes.AddRange(mobileFileTypes); allFileTypes.AddRange(archivesFileTypes); allFileTypes.AddRange(otherFileTypes); selectedFilesFileType = allFileTypes; InitializeComponent(); lblAboutChangelogVersion.Text = String.Format(lblAboutChangelogVersion.Text, Application.ProductVersion); imgSpinner.BringToFront(); // Hidden in Designer form = this; frmSplash = new SplashScreen(); Controls.Add(frmSplash); frmSplash.Dock = DockStyle.Fill; frmSplash.Location = new Point(0, 0); frmSplash.ClientSize = ClientSize; frmSplash.BringToFront(); frmSplash.Show(); }
//======================================================================================================= //This method is called when the user clicks the "Submit" button when they are currently in "UpdateRow" // mode. It makes sure there is data entered in each text box, when this is true, it calls the // "UpdateWeight" method from DatabaseFunction.cs. If the user has not entered info for each text box, // it will prompt them to fill out all fields and try again //======================================================================================================= private async void btnSubmitUpdate_Click(object sender, EventArgs e) { string tempDept = txtDepartUpdate.Text; string tempModName = txtModName.Text; string tempIPAddress = txtIPAddress.Text; if (tempDept != "" && tempModName != "" && tempIPAddress != "") { SplashScreen _splash = new SplashScreen { StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = FormBorderStyle.None, WindowState = FormWindowState.Normal, MaximumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight), MinimumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight) }; await Task.Delay(200); _splash.Show(); _splash.BringToFront(); _splash.Focus(); await Task.Delay(200); DatabaseFunctions.UpdateModule(intTUID, tempDept, tempModName, tempIPAddress); pnlUpdate.Visible = false; pnlDefault.Visible = true; pnlArchiveView.Visible = false; btnViewArchive.Visible = true; _splash.Close(); } else { MessageBox.Show("Please Enter Info For Each Field"); } }
private void _dataCleanerButton_Click(object sender, System.EventArgs e) { if (!Directory.Exists(_outputFolderTextbox.Text)) { Directory.CreateDirectory(_outputFolderTextbox.Text); } bool validInputData = CheckInputData(); if (!validInputData) { return; } EnableDisableComponents(false); _splashScreen = new SplashScreen(); _splashScreen.BringToFront(); Thread splashScreenThread = new Thread(new ThreadStart(DisplaySplashScreenCall)); splashScreenThread.IsBackground = true; splashScreenThread.Start(); Thread executeThread = new Thread(new ThreadStart(ExecuteData)); executeThread.IsBackground = true; executeThread.Start(); }
//======================================================================================================= //This method is called when the user hits the "Update" button. Which then calls the method to narrow the // current list to one department. If there is nothing entered in the text box, it will assume the user // wants to view the entire list of the printer table. If the count of the printers list is 0, it will // then prompt the user an invalid department was entered and clears out the text box; if it is greater // than 0 it refreshes the dgv to show the current modules entered in the specified department //======================================================================================================= private async void btnUpdate_Click(object sender, EventArgs e) { this.Visible = false; SplashScreen _splash = new SplashScreen { StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = FormBorderStyle.None, WindowState = FormWindowState.Normal, MaximumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight), MinimumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight) }; await Task.Delay(200); _splash.Show(); _splash.BringToFront(); _splash.Focus(); await Task.Delay(200); Program.ADAMMods.Clear(); if (txtDept.Text != "") { DatabaseFunctions.NarrowToDept(txtDept.Text); if (Program.ADAMMods.Count > 0) { RefreshDGV(); } else { txtDept.Text = ""; DatabaseFunctions.ViewCurrent(); RefreshDGV(); MessageBox.Show("Invalid Department Entered"); } } else { DatabaseFunctions.ViewCurrent(); RefreshDGV(); } _splash.Close(); this.Visible = true; }
public MainForm() { Program.Log.Info("Initializing"); InitializeComponent(); var form = this; Controls.Add(FormSplashScreen); FormSplashScreen.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom; FormSplashScreen.Location = new Point(0, 0); FormSplashScreen.Size = form.ClientSize; FormSplashScreen.BringToFront(); FormSplashScreen.Show(); ListboxSearchType.SelectedIndex = 0; DropdownSearchSort.SelectedIndex = 0; DropdownSearchSizePrefix.SelectedIndex = 0; DatetimeSearchLastModifiedMax.Value = DateTime.Now; Program.Log.Info("Initialized"); }