private void btnIssueInvoice_Click(object sender, EventArgs e) { //Instantiate customer and repair object Customer cust = new Customer(); Repair rep = new Repair(); //Setting customer ID cust.setCustomerID(Convert.ToInt32(grdAllCustomer.Rows[grdAllCustomer.CurrentCell.RowIndex].Cells[0].Value)); //calculating initial and after cost decimal totalCost = Convert.ToDecimal(lblTotalCostFill.Text); decimal initialCost = Convert.ToDecimal(lblCustomerBalance.Text); //Sets balance to initial and total cost combined cust.setCustomerBalance(totalCost + initialCost); //get customer ID string cno = grdAllCustomer.Rows[grdAllCustomer.CurrentCell.RowIndex].Cells[0].Value.ToString();; //Updates customer balance and repair status cust.updateCustomerBalance(); string status = "'ISSUE INVOICE'"; rep.updateRepairStatusINVOICE(Convert.ToInt32(cno), status); Customer cust1 = new Customer(); DataSet DataSet = new DataSet(); //Gets all customers by name grdAllCustomer.DataSource = Customer.getAllCustomerByName(DataSet, txtNameEntered.Text.ToString()).Tables["ss"]; MessageBox.Show("INVOICE SENT \n-------------------\nBALANCE UPDATED", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); grpRepairInfo.Visible = false; grpRepairsDone.Visible = false; }