private void grdRepairs_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //Gets selected repair details
            Repair rep = new Repair();

            rep.getRepairInvoice(Convert.ToInt32(grdRepairs.Rows[grdRepairs.CurrentCell.RowIndex].Cells[0].Value));
            lblRepairIDFill.Text    = rep.getRepairID().ToString();
            lblDescriptionFill.Text = rep.getDescription();
            lblCostFill.Text        = rep.getCost().ToString();

            grpRepairInfo.Visible = true;


            //Sets a string value to the value in the grid at position 3
            string repairStatus = grdRepairs.Rows[grdRepairs.CurrentCell.RowIndex].Cells[3].Value.ToString();



            if (repairStatus == "COMPLETED")
            {
                //Fill labels with repair details
                lblTotalCostFill.Text    = Repair.getRepairCost(Convert.ToInt32(grdAllCustomer.Rows[grdAllCustomer.CurrentCell.RowIndex].Cells[0].Value)).ToString();
                lblTotalCost.Visible     = true;
                lblTotalCostFill.Visible = true;
                btnIssueInvoice.Visible  = true;
            }

            else
            {
                MessageBox.Show("Please select a COMPLETED Repair to finish the Invoice \n----------------------------------------------------------\nPlease Wait For Repair to Complete", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        private void grdRepairs_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //Gets selected repair details
            Repair rep = new Repair();

            rep.getRepairInvoice(Convert.ToInt32(grdRepairs.Rows[grdRepairs.CurrentCell.RowIndex].Cells[0].Value));
            lblRepairIDFill.Text    = rep.getRepairID().ToString();
            lblDescriptionFill.Text = rep.getDescription();
            lblCostFill.Text        = rep.getCost().ToString();

            grpRepairInfo.Visible = true;

            //Sets a string value to the value in the grid at position 3
            string repairStatus = grdRepairs.Rows[grdRepairs.CurrentCell.RowIndex].Cells[3].Value.ToString();

            if (repairStatus == "ISSUE INVOICE")
            {
                //Fill labels with repair details
                lblTotalCostFill.Text    = Repair.getRepairPayment(Convert.ToInt32(grdAllCustomer.Rows[grdAllCustomer.CurrentCell.RowIndex].Cells[0].Value), Convert.ToInt32(grdRepairs.Rows[grdRepairs.CurrentCell.RowIndex].Cells[0].Value)).ToString();
                lblTotalCost.Visible     = true;
                lblTotalCostFill.Visible = true;
                btnIssueInvoice.Visible  = true;
            }
        }