예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            frmRepairLog lr = new frmRepairLog();

            lr.Show();
            this.Close();
        }
예제 #2
0
        private void frmRepairComplete_Load(object sender, EventArgs e)
        {
            //string status value = COMPLETED
            string status = "COMPLETED";


            //Fills grid with all repairs
            DataSet ds = new DataSet();

            grdAllRepairs.DataSource         = Repair.getAllRepairs(ds, status).Tables["ss"];
            grdAllRepairs.AllowUserToAddRows = false;

            //sets size of grid columns
            DataGridViewColumn column0 = grdAllRepairs.Columns[0];

            column0.Width = 25;

            DataGridViewColumn column4 = grdAllRepairs.Columns[4];

            column4.Width = 300;

            DataGridViewColumn column5 = grdAllRepairs.Columns[5];

            column5.Width = 25;

            DataGridViewColumn column6 = grdAllRepairs.Columns[6];

            column6.Width = 45;

            //if grid empty, close
            if (grdAllRepairs.RowCount == 0)
            {
                DialogResult result = MessageBox.Show("* * * WARNING * * * \n\n--------------------------------------------------------------\n\nNo Repairs have been ADDED to allow COMPLETETION...\n\n--------------------------------------------------------------\n\nWould you like to ADD a Repair?", "Warning",
                                                      MessageBoxButtons.YesNo, MessageBoxIcon.Warning);


                if (result == DialogResult.Yes)
                {
                    frmRepairLog ca = new frmRepairLog();
                    this.Close();
                    ca.Show();
                }
                else if (result == DialogResult.No)
                {
                    frmMainMenu mm = new frmMainMenu();
                    this.Close();
                    mm.Show();
                }
            }
        }