Example #1
0
        private void btnFinished_Click(object sender, EventArgs e)
        {
            RepairParts soldParts = new RepairParts();
            Repairs     costOf    = new Repairs();
            int         i         = 0;

            RepairParts.nextRepairId();
            lstCart.SelectedIndex = 0;
            while (lstCart.SelectedIndex <= lstCart.Items.Count)
            {
                soldParts.setPart_Id(Convert.ToInt32(lstCart.Text.Substring(0, 5)));
                soldParts.setRepair_Id(RepairParts.nextRepairId());
                soldParts.setQty(Convert.ToInt32(lstCart.Text.Substring(22, 3)));
                soldParts.setunitCost(Convert.ToDecimal(lstCart.Text.Substring(26, 5)));
                soldParts.addRepair();
                if (lstCart.SelectedIndex < lstCart.Items.Count - 1)
                {
                    lstCart.SelectedIndex++;
                }

                else
                {
                    break;
                }
            }

            MessageBox.Show("The Repair has been Logged!");
            frmLogRepair lr = new frmLogRepair();

            lr.Show();
        }
Example #2
0
        private void LogRepair_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmLogRepair nextForm = new frmLogRepair(this);

            nextForm.Show();
        }