Exemplo n.º 1
0
Arquivo: Form1.cs Projeto: oggiepl/Sky
        private void btnPrintWk_Click(object sender, EventArgs e)
        {
            Person employee = Business.Employees.Find(person => person.Id == (int)cbxIds.SelectedItem);

            if (employee == null)
            {
                MessageBox.Show("Id: " + cbxIds.SelectedItem + " does not exist");
            }
            PayStub payStub = employee.GetWork((new DateTime(2012, 6, 10)), DateTime.Now);

            txtOutput.Text  = payStub.Summary + Environment.NewLine;
            txtOutput.Text += "Total Hours: " + Math.Round(payStub.TotalHours, 2) + "\t$" +
                              payStub.GetPay(Business.PayRate[employee.Id - 1]);
        }
Exemplo n.º 2
0
        private void btnPrintWk_Click(object sender, EventArgs e)
        {
            Person employee = Business.Employees.Find(person => person.Id == (int)cbxIds.SelectedItem);

            if (employee == null)
            {
                MessageBox.Show("Id: " + cbxIds.SelectedItem + " does not exist");
            }

            DateTime dt    = dateTimePicker1.Value;
            DateTime start = new DateTime(dt.Year, dt.Month, dt.Day, 0, 0, 0);

            dt = dateTimePicker2.Value;
            DateTime end = new DateTime(dt.Year, dt.Month, dt.Day, 23, 59, 59);

            PayStub payStub = employee.GetWork(start, end);

            txtOutput.Text  = payStub.Summary + Environment.NewLine;
            txtOutput.Text += "Total Hours: " + Math.Round(payStub.TotalHours, 2) + "\t$" +
                              payStub.GetPay(Business.PayRate[employee.Id - 1]);
        }