Exemplo n.º 1
0
 private void DisplayProdWorker(ProductionWorker pw)
 {
     lblEmpName.Text = pw.Name;
     lblEmpNum.Text  = pw.EmpNumber.ToString();
     lblShift.Text   = pw.WorkShift;
     lblPay.Text     = pw.HourlyPayRate.ToString();
 }
Exemplo n.º 2
0
 private void GetProdWorkerData(ProductionWorker pw)
 {
     pw.Name          = txtEmpName.Text;
     pw.EmpNumber     = int.Parse(txtEmpNum.Text);
     pw.HourlyPayRate = decimal.Parse(txtPay.Text);
     if (cmbShift.SelectedIndex != -1)
     {
         pw.WorkShift = cmbShift.Text;
     }
     else
     {
         throw new Exception("Select a shift");
     }
 }
Exemplo n.º 3
0
        private void btnCreateProdWorker_Click(object sender, EventArgs e)
        {
            ProductionWorker pw = new ProductionWorker();

            try
            {
                GetProdWorkerData(pw);
                DisplayProdWorker(pw);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }