Пример #1
0
        //========================================================================================================
        //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();
        }
Пример #2
0
        //=======================================================================================================
        //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 ub the text box, it will assume the user
        //  wants to view the entire list of the weight table. If the count of the PartWeights 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 parts entered in the specified department
        //=======================================================================================================
        private async void btnUpdate_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);

            Program.PartWeights.Clear();

            if (txtDept.Text != "")
            {
                DatabaseFunctions.NarrowToDept(txtDept.Text);
                if (Program.PartWeights.Count > 0)
                {
                    RefreshDGV();
                }
                else
                {
                    txtDept.Text = "";
                    DatabaseFunctions.ViewCurrent();
                    RefreshDGV();
                    MessageBox.Show("Invalid Department Entered");
                }
            }
            else
            {
                DatabaseFunctions.ViewCurrent();
                RefreshDGV();
            }
            _splash.Close();
        }
Пример #3
0
 //=======================================================================================================
 //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();
     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();
 }