//======================================================================================================== //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 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(); } }