Overtime and the Daily Time Sheet
|
|
Another to calculate overtime considers each day on its
own. In this case, a regular work day has 1 to 8 hours. Any period over 8
hours is considered overtime. As a result, an employee can work one or two
days in a week and get overtime, just like another employee can work 5 or
more days a week but not get overtime.
Practical
Learning: Evaluating a Payroll
|
|
- In the empty document, type the following:
using System;
using System.IO;
using System.Xml;
using System.Drawing;
using System.Windows.Forms;
public class PayrollSummary2 : Form
{
private Label lblStartDate;
private DateTimePicker dtpStartDate;
private Label lblEmployeeNumber;
private TextBox txtEmployeeNumber;
private TextBox txtEmployeeName;
private Button btnFindEvaluate;
private Label lblHourlySalary;
private TextBox txtHourlySalary;
private Label lblTimeSheetID;
private TextBox txtTimeSheetID;
private Label lblDoubleLine1;
private Label lblTimeSheetMonday;
private Label lblTimeSheetTuesday;
private Label lblTimeSheetWednesday;
private Label lblTimeSheetThursday;
private Label lblTimeSheetFriday;
private Label lblTimeSheetSaturday;
private Label lblTimeSheetSunday;
private Label lblTotals;
private Label lblTimeSheetWeek1;
private TextBox txtTSWk1Monday;
private TextBox txtTSWk1Tuesday;
private TextBox txtTSWk1Wednesday;
private TextBox txtTSWk1Thursday;
private TextBox txtTSWk1Friday;
private TextBox txtTSWk1Saturday;
private TextBox txtTSWk1Sunday;
private TextBox txtTotalTimeWeek1;
private Label lblLineWeek1Summary;
private Label lblSmrWk1RegularTime;
private TextBox txtSmrWk1MonRegularTime;
private TextBox txtSmrWk1TueRegularTime;
private TextBox txtSmrWk1WedRegularTime;
private TextBox txtSmrWk1ThuRegularTime;
private TextBox txtSmrWk1FriRegularTime;
private TextBox txtSmrWk1SatRegularTime;
private TextBox txtSmrWk1SunRegularTime;
private TextBox txtTotalRegularTimeWeek1;
private Label lblSmrWk1Overtime;
private TextBox txtSmrWk1MonOvertime;
private TextBox txtSmrWk1TueOvertime;
private TextBox txtSmrWk1WedOvertime;
private TextBox txtSmrWk1ThuOvertime;
private TextBox txtSmrWk1FriOvertime;
private TextBox txtSmrWk1SatOvertime;
private TextBox txtSmrWk1SunOvertime;
private TextBox txtTotalOvertimeWeek1;
private Label lblSmrWk1RegularPay;
private TextBox txtSmrWk1MonRegularPay;
private TextBox txtSmrWk1TueRegularPay;
private TextBox txtSmrWk1WedRegularPay;
private TextBox txtSmrWk1ThuRegularPay;
private TextBox txtSmrWk1FriRegularPay;
private TextBox txtSmrWk1SatRegularPay;
private TextBox txtSmrWk1SunRegularPay;
private TextBox txtTotalRegularPayWeek1;
private Label lblSmrWk1OvertimePay;
private TextBox txtSmrWk1MonOvertimePay;
private TextBox txtSmrWk1TueOvertimePay;
private TextBox txtSmrWk1WedOvertimePay;
private TextBox txtSmrWk1ThuOvertimePay;
private TextBox txtSmrWk1FriOvertimePay;
private TextBox txtSmrWk1SatOvertimePay;
private TextBox txtSmrWk1SunOvertimePay;
private TextBox txtTotalOvertimePayWeek1;
private Label lblDoubleLine2;
private Label lblTimeSheetWeek2;
private TextBox txtTSWk2Monday;
private TextBox txtTSWk2Tuesday;
private TextBox txtTSWk2Wednesday;
private TextBox txtTSWk2Thursday;
private TextBox txtTSWk2Friday;
private TextBox txtTSWk2Saturday;
private TextBox txtTSWk2Sunday;
private TextBox txtTotalTimeWeek2;
private Label lblLineWeek2Summary;
private Label lblSmrWk2RegularTime;
private TextBox txtSmrWk2MonRegularTime;
private TextBox txtSmrWk2TueRegularTime;
private TextBox txtSmrWk2WedRegularTime;
private TextBox txtSmrWk2ThuRegularTime;
private TextBox txtSmrWk2FriRegularTime;
private TextBox txtSmrWk2SatRegularTime;
private TextBox txtSmrWk2SunRegularTime;
private TextBox txtTotalRegularTimeWeek2;
private Label lblSmrWk2Overtime;
private TextBox txtSmrWk2MonOvertime;
private TextBox txtSmrWk2TueOvertime;
private TextBox txtSmrWk2WedOvertime;
private TextBox txtSmrWk2ThuOvertime;
private TextBox txtSmrWk2FriOvertime;
private TextBox txtSmrWk2SatOvertime;
private TextBox txtSmrWk2SunOvertime;
private TextBox txtTotalOvertimeWeek2;
private Label lblSmrWk2RegularPay;
private TextBox txtSmrWk2MonRegularPay;
private TextBox txtSmrWk2TueRegularPay;
private TextBox txtSmrWk2WedRegularPay;
private TextBox txtSmrWk2ThuRegularPay;
private TextBox txtSmrWk2FriRegularPay;
private TextBox txtSmrWk2SatRegularPay;
private TextBox txtSmrWk2SunRegularPay;
private TextBox txtTotalRegularPayWeek2;
private Label lblSmrWk2OvertimePay;
private TextBox txtSmrWk2MonOvertimePay;
private TextBox txtSmrWk2TueOvertimePay;
private TextBox txtSmrWk2WedOvertimePay;
private TextBox txtSmrWk2ThuOvertimePay;
private TextBox txtSmrWk2FriOvertimePay;
private TextBox txtSmrWk2SatOvertimePay;
private TextBox txtSmrWk2SunOvertimePay;
private TextBox txtTotalOvertimePayWeek2;
private Label lblTime;
private Label lblPay;
private Label lblRegular;
private TextBox txtRegularTime;
private TextBox txtRegularPay;
private Label lblOvertime;
private TextBox txtOvertime;
private TextBox txtOvertimePay;
private Label lblGrossSalary;
private TextBox txtGrossSalary;
private Button btnClose;
private Label lblDoubleLine3;
private Label lblSummarySunday;
private double hourlySalary, overtimeSalary;
private double week1Monday;
private double week1Tuesday;
private double week1Wednesday;
private double week1Thursday;
private double week1Friday;
private double week1Saturday;
private double week1Sunday;
private double week2Monday;
private double week2Tuesday;
private double week2Wednesday;
private double week2Thursday;
private double week2Friday;
private double week2Saturday;
private double week2Sunday;
public PayrollSummary2()
{
InitializeComponent();
}
private void InitializeComponent()
{
// Label: Start Date
lblStartDate = new Label();
lblStartDate.AutoSize = true;
lblStartDate.Location = new System.Drawing.Point(22, 22);
lblStartDate.TabIndex = 344;
lblStartDate.Text = "Start Date:";
Controls.Add(lblStartDate);
// Date/Time Picker: Start Date
dtpStartDate = new DateTimePicker();
dtpStartDate.Location = new System.Drawing.Point(100, 18);
dtpStartDate.Size = new System.Drawing.Size(200, 20);
dtpStartDate.TabIndex = 346;
Controls.Add(dtpStartDate);
// Label: Employee Number
lblEmployeeNumber = new Label();
lblEmployeeNumber.AutoSize = true;
lblEmployeeNumber.Location = new System.Drawing.Point(21, 49);
lblEmployeeNumber.TabIndex = 347;
lblEmployeeNumber.Text = "Employee #:";
Controls.Add(lblEmployeeNumber);
// Text Box: Employee Number
txtEmployeeNumber = new TextBox();
txtEmployeeNumber.Location = new System.Drawing.Point(100, 46);
txtEmployeeNumber.Size = new System.Drawing.Size(64, 20);
txtEmployeeNumber.TabIndex = 348;
txtEmployeeNumber.Leave += new EventHandler(txtEmployeeNumberLeave);
Controls.Add(txtEmployeeNumber);
// Text Box: Employee Name
txtEmployeeName = new TextBox();
txtEmployeeName.Location = new System.Drawing.Point(170, 46);
txtEmployeeName.Name = "txtEmployeeName";
txtEmployeeName.Size = new System.Drawing.Size(200, 20);
txtEmployeeName.TabIndex = 376;
// Button: Find
btnFindEvaluate = new Button();
btnFindEvaluate.Location = new System.Drawing.Point(383, 73);
btnFindEvaluate.Size = new System.Drawing.Size(91, 23);
btnFindEvaluate.TabIndex = 375;
btnFindEvaluate.Text = "Find Time Sheet and Evaluate";
btnFindEvaluate.Click += new EventHandler(btnFindEvaluateClick);
Controls.Add(btnFindEvaluate);
// Label: Hourly Salary
lblHourlySalary = new Label();
lblHourlySalary.AutoSize = true;
lblHourlySalary.Location = new System.Drawing.Point(22, 78);
lblHourlySalary.TabIndex = 353;
lblHourlySalary.Text = "Hourly Salary:";
Controls.Add(lblHourlySalary);
// Text Box: Hourly Salary
txtHourlySalary = new TextBox();
txtHourlySalary.Location = new System.Drawing.Point(100, 75);
txtHourlySalary.Size = new System.Drawing.Size(64, 20);
txtHourlySalary.TabIndex = 380;
txtHourlySalary.Text = "0.00";
txtHourlySalary.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtHourlySalary);
// Label: Time Sheet ID
lblTimeSheetID = new Label();
lblTimeSheetID.AutoSize = true;
lblTimeSheetID.Location = new System.Drawing.Point(220, 78);
lblTimeSheetID.TabIndex = 494;
lblTimeSheetID.Text = "Time Sheet #:";
Controls.Add(lblTimeSheetID);
// Text Box: TimeSheetID
txtTimeSheetID = new TextBox();
txtTimeSheetID.Location = new System.Drawing.Point(300, 75);
txtTimeSheetID.Size = new System.Drawing.Size(70, 20);
txtTimeSheetID.TabIndex = 495;
Controls.Add(txtTimeSheetID);
// Label: Double Line 1
lblDoubleLine1.AutoSize = true;
lblDoubleLine1.Location = new System.Drawing.Point(22, 107);
lblDoubleLine1.TabIndex = 508;
lblDoubleLine1.Text = "=========================================================================================";
Controls.Add(lblDoubleLine1);
// Label: Time Sheet Monday
lblTimeSheetMonday = new Label();
lblTimeSheetMonday.AutoSize = true;
lblTimeSheetMonday.Location = new System.Drawing.Point(95, 130);
lblTimeSheetMonday.TabIndex = 356;
lblTimeSheetMonday.Text = "Monday";
Controls.Add(lblTimeSheetMonday);
// Label: Time Sheet Tuesday
lblTimeSheetTuesday = new Label();
lblTimeSheetTuesday.AutoSize = true;
lblTimeSheetTuesday.Location = new System.Drawing.Point(152, 130);
lblTimeSheetTuesday.TabIndex = 357;
lblTimeSheetTuesday.Text = "Tuesday";
Controls.Add(lblTimeSheetTuesday);
// Label: Time Sheet Wednesday
lblTimeSheetWednesday = new Label();
lblTimeSheetWednesday.AutoSize = true;
lblTimeSheetWednesday.Location = new System.Drawing.Point(206, 130);
lblTimeSheetWednesday.TabIndex = 358;
lblTimeSheetWednesday.Text = "Wednesday";
Controls.Add(lblTimeSheetWednesday);
// Label: Time Sheet Thursday
lblTimeSheetThursday = new Label();
lblTimeSheetThursday.AutoSize = true;
lblTimeSheetThursday.Location = new System.Drawing.Point(270, 130);
lblTimeSheetThursday.TabIndex = 359;
lblTimeSheetThursday.Text = "Thursday";
Controls.Add(lblTimeSheetThursday);
// Label: Time Sheet Friday
lblTimeSheetFriday = new Label();
lblTimeSheetFriday.AutoSize = true;
lblTimeSheetFriday.Location = new System.Drawing.Point(325, 130);
lblTimeSheetFriday.TabIndex = 360;
lblTimeSheetFriday.Text = "Friday";
Controls.Add(lblTimeSheetFriday);
// Label: Time Sheet Saturday
lblTimeSheetSaturday = new Label();
lblTimeSheetSaturday.AutoSize = true;
lblTimeSheetSaturday.Location = new System.Drawing.Point(382, 130);
lblTimeSheetSaturday.TabIndex = 361;
lblTimeSheetSaturday.Text = "Saturday";
Controls.Add(lblTimeSheetSaturday);
// Label: Time Sheet Sunday
lblTimeSheetSunday = new Label();
lblTimeSheetSunday.AutoSize = true;
lblTimeSheetSunday.Location = new System.Drawing.Point(437, 130);
lblTimeSheetSunday.TabIndex = 362;
lblTimeSheetSunday.Text = "Sunday";
Controls.Add(lblTimeSheetSunday);
// Label: Totals
lblTotals = new Label();
lblTotals.AutoSize = true;
lblTotals.Location = new System.Drawing.Point(510, 130);
lblTotals.TabIndex = 385;
lblTotals.Text = "Total";
Controls.Add(lblTotals);
// Label: Time Sheet Week 1
lblTimeSheetWeek1 = new Label();
lblTimeSheetWeek1.AutoSize = true;
lblTimeSheetWeek1.Location = new System.Drawing.Point(20, 152);
lblTimeSheetWeek1.TabIndex = 355;
lblTimeSheetWeek1.Text = "Week 1:";
Controls.Add(lblTimeSheetWeek1);
// Text Box: Time Sheet Week 1 - Monday
txtTSWk1Monday = new TextBox();
txtTSWk1Monday.Location = new System.Drawing.Point(98, 149);
txtTSWk1Monday.Size = new System.Drawing.Size(51, 20);
txtTSWk1Monday.TabIndex = 363;
txtTSWk1Monday.Text = "0.00";
txtTSWk1Monday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk1Monday);
// Text Box: Time Sheet Week 1 - Tuesday
txtTSWk1Tuesday = new TextBox();
txtTSWk1Tuesday.Location = new System.Drawing.Point(155, 149);
txtTSWk1Tuesday.Size = new System.Drawing.Size(51, 20);
txtTSWk1Tuesday.TabIndex = 364;
txtTSWk1Tuesday.Text = "0.00";
txtTSWk1Tuesday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk1Tuesday);
// Text Box: Time Sheet Week 1 - Wednesday
txtTSWk1Wednesday = new TextBox();
txtTSWk1Wednesday.Location = new System.Drawing.Point(212, 149);
txtTSWk1Wednesday.Size = new System.Drawing.Size(51, 20);
txtTSWk1Wednesday.TabIndex = 365;
txtTSWk1Wednesday.Text = "0.00";
txtTSWk1Wednesday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk1Wednesday);
// Text Box: Time Sheet Week 1 - Thursday
txtTSWk1Thursday = new TextBox();
txtTSWk1Thursday.Location = new System.Drawing.Point(269, 149);
txtTSWk1Thursday.Size = new System.Drawing.Size(51, 20);
txtTSWk1Thursday.TabIndex = 366;
txtTSWk1Thursday.Text = "0.00";
txtTSWk1Thursday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk1Thursday);
// Text Box: Time Sheet Week 1 - Friday
txtTSWk1Friday = new TextBox();
txtTSWk1Friday.Location = new System.Drawing.Point(326, 149);
txtTSWk1Friday.Size = new System.Drawing.Size(51, 20);
txtTSWk1Friday.Text = "0.00";
txtTSWk1Friday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk1Friday);
//
// Text Box: Time Sheet Week 1 - Saturday
txtTSWk1Saturday = new TextBox();
txtTSWk1Saturday.Location = new System.Drawing.Point(383, 149);
txtTSWk1Saturday.Size = new System.Drawing.Size(51, 20);
txtTSWk1Saturday.Text = "0.00";
txtTSWk1Saturday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk1Saturday);
// Text Box: Time Sheet Week 1 - Sunday
txtTSWk1Sunday = new TextBox();
txtTSWk1Sunday.Location = new System.Drawing.Point(440, 149);
txtTSWk1Sunday.Size = new System.Drawing.Size(51, 20);
txtTSWk1Sunday.Text = "0.00";
txtTSWk1Sunday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk1Sunday);
// Text Box: Total Time Week 1
txtTotalTimeWeek1 = new TextBox();
txtTotalTimeWeek1.Location = new System.Drawing.Point(507, 151);
txtTotalTimeWeek1.Size = new System.Drawing.Size(51, 20);
txtTotalTimeWeek1.Text = "0.00";
txtTotalTimeWeek1.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTotalTimeWeek1);
// Label: LineWeek1Summary
lblLineWeek1Summary = new Label();
lblLineWeek1Summary.AutoSize = true;
lblLineWeek1Summary.Location = new System.Drawing.Point(20, 175);
lblLineWeek1Summary.TabIndex = 370;
lblLineWeek1Summary.Text = "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
Controls.Add(lblLineWeek1Summary);
// Label: Summary Week 1 - Regular Time
lblSmrWk1RegularTime = new Label();
lblSmrWk1RegularTime.AutoSize = true;
lblSmrWk1RegularTime.Location = new System.Drawing.Point(19, 197);
lblSmrWk1RegularTime.Text = "Regular Time:";
Controls.Add(lblSmrWk1RegularTime);
// Text Box: Summary Week 1 - Monday Regular Time
txtSmrWk1MonRegularTime = new TextBox();
txtSmrWk1MonRegularTime.Location = new System.Drawing.Point(98, 194);
txtSmrWk1MonRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1MonRegularTime.Text = "0.00";
txtSmrWk1MonRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1MonRegularTime);
// Text Box: Summary Week 1 - TueRegularTime
txtSmrWk1TueRegularTime = new TextBox();
txtSmrWk1TueRegularTime.Location = new System.Drawing.Point(155, 194);
txtSmrWk1TueRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1TueRegularTime.Text = "0.00";
txtSmrWk1TueRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1TueRegularTime);
// Text Box: Summary Week 1 - WedRegularTime
txtSmrWk1WedRegularTime = new TextBox();
txtSmrWk1WedRegularTime.Location = new System.Drawing.Point(212, 194);
txtSmrWk1WedRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1WedRegularTime.Text = "0.00";
txtSmrWk1WedRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1WedRegularTime);
// Text Box: Summary Week 1 - ThuRegularTime
txtSmrWk1ThuRegularTime = new TextBox();
txtSmrWk1ThuRegularTime.Location = new System.Drawing.Point(269, 194);
txtSmrWk1ThuRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1ThuRegularTime.Text = "0.00";
txtSmrWk1ThuRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1ThuRegularTime);
// Text Box: Summary Week 1 - Friday RegularTime
txtSmrWk1FriRegularTime = new TextBox();
txtSmrWk1FriRegularTime.Location = new System.Drawing.Point(326, 194);
txtSmrWk1FriRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1FriRegularTime.Text = "0.00";
txtSmrWk1FriRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1FriRegularTime);
// Text Box: Summary Week 1 - Saturday Regular Time
txtSmrWk1SatRegularTime = new TextBox();
txtSmrWk1SatRegularTime.Location = new System.Drawing.Point(383, 194);
txtSmrWk1SatRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1SatRegularTime.Text = "0.00";
txtSmrWk1SatRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1SatRegularTime);
// Text Box: Summary Week 1 - Sunday Regular Time
txtSmrWk1SunRegularTime = new TextBox();
txtSmrWk1SunRegularTime.Location = new System.Drawing.Point(440, 194);
txtSmrWk1SunRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1SunRegularTime.Text = "0.00";
txtSmrWk1SunRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1SunRegularTime);
// Text Box: Total Regular Time Week 1
txtTotalRegularTimeWeek1 = new TextBox();
txtTotalRegularTimeWeek1.Location = new System.Drawing.Point(507, 196);
txtTotalRegularTimeWeek1.Size = new System.Drawing.Size(51, 20);
txtTotalRegularTimeWeek1.Text = "0.00";
txtTotalRegularTimeWeek1.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTotalRegularTimeWeek1);
// Label: Summary Week 1 - Overtime
lblSmrWk1Overtime = new Label();
lblSmrWk1Overtime.AutoSize = true;
lblSmrWk1Overtime.Location = new System.Drawing.Point(19, 223);
lblSmrWk1Overtime.Text = "Over Time:";
Controls.Add(lblSmrWk1Overtime);
// Text Box: Summary Week 1 - Monday Overtime
txtSmrWk1MonOvertime = new TextBox();
txtSmrWk1MonOvertime.Location = new System.Drawing.Point(98, 220);
txtSmrWk1MonOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1MonOvertime.Text = "0.00";
txtSmrWk1MonOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1MonOvertime);
// Text Box: Summary Week 1 - Tuesday Overtime
txtSmrWk1TueOvertime = new TextBox();
txtSmrWk1TueOvertime.Location = new System.Drawing.Point(155, 220);
txtSmrWk1TueOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1TueOvertime.Text = "0.00";
txtSmrWk1TueOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1TueOvertime);
// Text Box: Summary Week 1 - Wednesday Overtime
txtSmrWk1WedOvertime = new TextBox();
txtSmrWk1WedOvertime.Location = new System.Drawing.Point(212, 220);
txtSmrWk1WedOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1WedOvertime.Text = "0.00";
txtSmrWk1WedOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1WedOvertime);
// Text Box: Summary Week 1 - Thursday Overtime
txtSmrWk1ThuOvertime = new TextBox();
txtSmrWk1ThuOvertime.Location = new System.Drawing.Point(269, 220);
txtSmrWk1ThuOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1ThuOvertime.Text = "0.00";
txtSmrWk1ThuOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1ThuOvertime);
// Text Box: Summary Week 1 - Friday Overtime
txtSmrWk1FriOvertime = new TextBox();
txtSmrWk1FriOvertime.Location = new System.Drawing.Point(326, 220);
txtSmrWk1FriOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1FriOvertime.Text = "0.00";
txtSmrWk1FriOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1FriOvertime);
// Text Box: Summary Week 1 - Saturday Overtime
txtSmrWk1SatOvertime = new TextBox();
txtSmrWk1SatOvertime.Location = new System.Drawing.Point(383, 220);
txtSmrWk1SatOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1SatOvertime.Text = "0.00";
txtSmrWk1SatOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1SatOvertime);
// Text Box: Summary Week 1 - Sunday Overtime
txtSmrWk1SunOvertime = new TextBox();
txtSmrWk1SunOvertime.Location = new System.Drawing.Point(440, 220);
txtSmrWk1SunOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk1SunOvertime.Text = "0.00";
txtSmrWk1SunOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1SunOvertime);
// Text Box: Total Overtime Week 1
txtTotalOvertimeWeek1 = new TextBox();
txtTotalOvertimeWeek1.Location = new System.Drawing.Point(507, 222);
txtTotalOvertimeWeek1.Size = new System.Drawing.Size(51, 20);
txtTotalOvertimeWeek1.Text = "0.00";
txtTotalOvertimeWeek1.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTotalOvertimeWeek1);
// Label: Summary Week 1 - Regular Pay
lblSmrWk1RegularPay = new Label();
lblSmrWk1RegularPay.AutoSize = true;
lblSmrWk1RegularPay.Location = new System.Drawing.Point(19, 249);
lblSmrWk1RegularPay.Text = "Regular Pay:";
Controls.Add(lblSmrWk1RegularPay);
// Text Box: Summary Week 1 - Monday Regular Pay
txtSmrWk1MonRegularPay = new TextBox();
txtSmrWk1MonRegularPay.Location = new System.Drawing.Point(98, 246);
txtSmrWk1MonRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1MonRegularPay.Text = "0.00";
txtSmrWk1MonRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1MonRegularPay);
//
// Text Box: Summary Week 1 - Tuesday Regular Pay
txtSmrWk1TueRegularPay = new TextBox();
txtSmrWk1TueRegularPay.Location = new System.Drawing.Point(155, 246);
txtSmrWk1TueRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1TueRegularPay.Text = "0.00";
txtSmrWk1TueRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1TueRegularPay);
// Text Box: Summary Week 1 - Wednesday Regular Pay
txtSmrWk1WedRegularPay = new TextBox();
txtSmrWk1WedRegularPay.Location = new System.Drawing.Point(212, 246);
txtSmrWk1WedRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1WedRegularPay.Text = "0.00";
txtSmrWk1WedRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1WedRegularPay);
// Text Box: Summary Week 1 - Thursday Regular Pay
txtSmrWk1ThuRegularPay = new TextBox();
txtSmrWk1ThuRegularPay.Location = new System.Drawing.Point(269, 246);
txtSmrWk1ThuRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1ThuRegularPay.Text = "0.00";
txtSmrWk1ThuRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1ThuRegularPay);
// Text Box: Summary Week 1 - Friday Regular Pay
txtSmrWk1FriRegularPay = new TextBox();
txtSmrWk1FriRegularPay.Location = new System.Drawing.Point(326, 246);
txtSmrWk1FriRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1FriRegularPay.Text = "0.00";
txtSmrWk1FriRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1FriRegularPay);
// Text Box: Summary Week 1 - Saturday Regular Pay
txtSmrWk1SatRegularPay = new TextBox();
txtSmrWk1SatRegularPay.Location = new System.Drawing.Point(383, 246);
txtSmrWk1SatRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1SatRegularPay.Text = "0.00";
txtSmrWk1SatRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1SatRegularPay);
// Text Box: Summary Week 1 - Sunday Regular Pay
txtSmrWk1SunRegularPay = new TextBox();
txtSmrWk1SunRegularPay.Location = new System.Drawing.Point(440, 246);
txtSmrWk1SunRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1SunRegularPay.Text = "0.00";
txtSmrWk1SunRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1SunRegularPay);
// Text Box: Total Regular Pay Week 1
txtTotalRegularPayWeek1 = new TextBox();
txtTotalRegularPayWeek1.Location = new System.Drawing.Point(507, 248);
txtTotalRegularPayWeek1.Size = new System.Drawing.Size(51, 20);
txtTotalRegularPayWeek1.Text = "0.00";
txtTotalRegularPayWeek1.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTotalRegularPayWeek1);
// Label: Summary Week 1 - OvertimePay
lblSmrWk1OvertimePay = new Label();
lblSmrWk1OvertimePay.AutoSize = true;
lblSmrWk1OvertimePay.Location = new System.Drawing.Point(19, 275);
lblSmrWk1OvertimePay.Text = "Overtime Pay:";
Controls.Add(lblSmrWk1OvertimePay);
// Text Box: Summary Week 1 - Monday Overtime Pay
txtSmrWk1MonOvertimePay = new TextBox();
txtSmrWk1MonOvertimePay.Location = new System.Drawing.Point(98, 272);
txtSmrWk1MonOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1MonOvertimePay.Text = "0.00";
txtSmrWk1MonOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1MonOvertimePay);
// Text Box: Summary Week 1 - Tuesday Overtime Pay
txtSmrWk1TueOvertimePay = new TextBox();
txtSmrWk1TueOvertimePay.Location = new System.Drawing.Point(155, 272);
txtSmrWk1TueOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1TueOvertimePay.Text = "0.00";
txtSmrWk1TueOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1TueOvertimePay);
// Text Box: Summary Week 1 - Wednesday Overtime Pay
txtSmrWk1WedOvertimePay = new TextBox();
txtSmrWk1WedOvertimePay.Location = new System.Drawing.Point(212, 272);
txtSmrWk1WedOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1WedOvertimePay.Text = "0.00";
txtSmrWk1WedOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1WedOvertimePay);
// Text Box: Summary Week 1 - ThuOvertimePay
txtSmrWk1ThuOvertimePay = new TextBox();
txtSmrWk1ThuOvertimePay.Location = new System.Drawing.Point(269, 272);
txtSmrWk1ThuOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1ThuOvertimePay.Text = "0.00";
txtSmrWk1ThuOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1ThuOvertimePay);
// Text Box: Summary Week 1 - Friday Overtime Pay
txtSmrWk1FriOvertimePay = new TextBox();
txtSmrWk1FriOvertimePay.Location = new System.Drawing.Point(326, 272);
txtSmrWk1FriOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1FriOvertimePay.Text = "0.00";
txtSmrWk1FriOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1FriOvertimePay);
// Text Box: Summary Week 1 - Saturday OvertimePay
txtSmrWk1SatOvertimePay = new TextBox();
txtSmrWk1SatOvertimePay.Location = new System.Drawing.Point(383, 272);
txtSmrWk1SatOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1SatOvertimePay.Text = "0.00";
txtSmrWk1SatOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1SatOvertimePay);
// Text Box: Summary Week 1 - Sunday Overtime Pay
txtSmrWk1SunOvertimePay = new TextBox();
txtSmrWk1SunOvertimePay.Location = new System.Drawing.Point(440, 272);
txtSmrWk1SunOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk1SunOvertimePay.Text = "0.00";
txtSmrWk1SunOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk1SunOvertimePay);
// Text Box: Total Overtime Pay Week 1
txtTotalOvertimePayWeek1 = new TextBox();
txtTotalOvertimePayWeek1.Location = new System.Drawing.Point(507, 274);
txtTotalOvertimePayWeek1.Size = new System.Drawing.Size(51, 20);
txtTotalOvertimePayWeek1.Text = "0.00";
txtTotalOvertimePayWeek1.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTotalOvertimePayWeek1);
// Label: Double Line
lblDoubleLine2.AutoSize = true;
lblDoubleLine2.Location = new System.Drawing.Point(19, 300);
lblDoubleLine2.TabIndex = 434;
lblDoubleLine2.Text = "==============================================================================================================================";
// Label: Time Sheet Week 2
lblTimeSheetWeek2 = new Label();
lblTimeSheetWeek2.AutoSize = true;
lblTimeSheetWeek2.Location = new System.Drawing.Point(19, 327);
lblTimeSheetWeek2.Text = "Week 2:";
Controls.Add(lblTimeSheetWeek2);
// Text Box: Time Sheet Week 2 - Monday
txtTSWk2Monday = new TextBox();
txtTSWk2Monday.Location = new System.Drawing.Point(98, 323);
txtTSWk2Monday.Size = new System.Drawing.Size(51, 20);
txtTSWk2Monday.Text = "0.00";
txtTSWk2Monday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk2Monday);
// Text Box: Time Sheet Week 2 - Tuesday
txtTSWk2Tuesday = new TextBox();
txtTSWk2Tuesday.Location = new System.Drawing.Point(155, 323);
txtTSWk2Tuesday.Size = new System.Drawing.Size(51, 20);
txtTSWk2Tuesday.Text = "0.00";
txtTSWk2Tuesday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk2Tuesday);
// Text Box: Time Sheet Week 2 - Wednesday
txtTSWk2Wednesday = new TextBox();
txtTSWk2Wednesday.Location = new System.Drawing.Point(212, 323);
txtTSWk2Wednesday.Size = new System.Drawing.Size(51, 20);
txtTSWk2Wednesday.Text = "0.00";
txtTSWk2Wednesday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk2Wednesday);
// Text Box: Time Sheet Week 2 - Thursday
txtTSWk2Thursday = new TextBox();
txtTSWk2Thursday.Location = new System.Drawing.Point(269, 323);
txtTSWk2Thursday.Size = new System.Drawing.Size(51, 20);
txtTSWk2Thursday.Text = "0.00";
txtTSWk2Thursday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk2Thursday);
// Text Box: Time Sheet Week 2 - Friday
txtTSWk2Friday = new TextBox();
txtTSWk2Friday.Location = new System.Drawing.Point(326, 323);
txtTSWk2Friday.Size = new System.Drawing.Size(51, 20);
txtTSWk2Friday.Text = "0.00";
txtTSWk2Friday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk2Friday);
// Text Box: Time Sheet Week 2 - Saturday
txtTSWk2Saturday = new TextBox();
txtTSWk2Saturday.Location = new System.Drawing.Point(383, 323);
txtTSWk2Saturday.Size = new System.Drawing.Size(51, 20);
txtTSWk2Saturday.Text = "0.00";
txtTSWk2Saturday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk2Saturday);
// Text Box: Time Sheet Week 2 - Sunday
txtTSWk2Sunday = new TextBox();
txtTSWk2Sunday.Location = new System.Drawing.Point(440, 323);
txtTSWk2Sunday.Size = new System.Drawing.Size(51, 20);
txtTSWk2Sunday.Text = "0.00";
txtTSWk2Sunday.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTSWk2Sunday);
// Text Box: Total Time Week 2
txtTotalTimeWeek2 = new TextBox();
txtTotalTimeWeek2.Location = new System.Drawing.Point(507, 325);
txtTotalTimeWeek2.Size = new System.Drawing.Size(51, 20);
txtTotalTimeWeek2.Text = "0.00";
txtTotalTimeWeek2.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTotalTimeWeek2);
// Label: SmrWk2RegularTime
lblSmrWk2RegularTime = new Label();
lblSmrWk2RegularTime.AutoSize = true;
lblSmrWk2RegularTime.Location = new System.Drawing.Point(19, 370);
lblSmrWk2RegularTime.TabIndex = 445;
lblSmrWk2RegularTime.Text = "Regular Time:";
Controls.Add(lblSmrWk2RegularTime);
// Text Box: Summary Week 2 - Monday Regular Time
txtSmrWk2MonRegularTime = new TextBox();
txtSmrWk2MonRegularTime.Location = new System.Drawing.Point(98, 367);
txtSmrWk2MonRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2MonRegularTime.Text = "0.00";
txtSmrWk2MonRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2MonRegularTime);
// Text Box: Summary Week 2 - Tueday Regular Time
txtSmrWk2TueRegularTime = new TextBox();
txtSmrWk2TueRegularTime.Location = new System.Drawing.Point(155, 367);
txtSmrWk2TueRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2TueRegularTime.Text = "0.00";
txtSmrWk2TueRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2TueRegularTime);
// Text Box: Summary Week 2 - Wednesday Regular Time
txtSmrWk2WedRegularTime = new TextBox();
txtSmrWk2WedRegularTime.Location = new System.Drawing.Point(212, 367);
txtSmrWk2WedRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2WedRegularTime.Text = "0.00";
txtSmrWk2WedRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2WedRegularTime);
// Text Box: Summary Week 2 - Thursday Regular Time
txtSmrWk2ThuRegularTime = new TextBox();
txtSmrWk2ThuRegularTime.Location = new System.Drawing.Point(269, 367);
txtSmrWk2ThuRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2ThuRegularTime.Text = "0.00";
txtSmrWk2ThuRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2ThuRegularTime);
// Text Box: Summary Week 2 - Friday Regular Time
txtSmrWk2FriRegularTime = new TextBox();
txtSmrWk2FriRegularTime.Location = new System.Drawing.Point(326, 367);
txtSmrWk2FriRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2FriRegularTime.Text = "0.00";
txtSmrWk2FriRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2FriRegularTime);
// Text Box: Summary Week 2 - Saturday Regular Time
txtSmrWk2SatRegularTime = new TextBox();
txtSmrWk2SatRegularTime.Location = new System.Drawing.Point(383, 367);
txtSmrWk2SatRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2SatRegularTime.Text = "0.00";
txtSmrWk2SatRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2SatRegularTime);
// Text Box: Summary Week 2 - Sunday Regular Time
txtSmrWk2SunRegularTime = new TextBox();
txtSmrWk2SunRegularTime.Location = new System.Drawing.Point(440, 367);
txtSmrWk2SunRegularTime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2SunRegularTime.Text = "0.00";
txtSmrWk2SunRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2SunRegularTime);
// Text Box: TotalRegularTimeWeek2
txtTotalRegularTimeWeek2 = new TextBox();
txtTotalRegularTimeWeek2.Location = new System.Drawing.Point(507, 369);
txtTotalRegularTimeWeek2.Size = new System.Drawing.Size(51, 20);
txtTotalRegularTimeWeek2.Text = "0.00";
txtTotalRegularTimeWeek2.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTotalRegularTimeWeek2);
// Label: Summary Week 2 - Overtime
lblSmrWk2Overtime = new Label();
lblSmrWk2Overtime.AutoSize = true;
lblSmrWk2Overtime.Location = new System.Drawing.Point(19, 396);
lblSmrWk2Overtime.Text = "Over Time:";
Controls.Add(lblSmrWk2Overtime);
// Text Box: Summary Week 2 - Monday Overtime
txtSmrWk2MonOvertime = new TextBox();
txtSmrWk2MonOvertime.Location = new System.Drawing.Point(98, 393);
txtSmrWk2MonOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2MonOvertime.Text = "0.00";
txtSmrWk2MonOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2MonOvertime);
// Text Box: Summary Week 2 - Tueday Overtime
txtSmrWk2TueOvertime = new TextBox();
txtSmrWk2TueOvertime.Location = new System.Drawing.Point(155, 393);
txtSmrWk2TueOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2TueOvertime.Text = "0.00";
txtSmrWk2TueOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2TueOvertime);
// Text Box: Summary Week 2 - Wednesday Overtime
txtSmrWk2WedOvertime = new TextBox();
txtSmrWk2WedOvertime.Location = new System.Drawing.Point(212, 393);
txtSmrWk2WedOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2WedOvertime.Text = "0.00";
txtSmrWk2WedOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2WedOvertime);
// Text Box: Summary Week 2 - Thursday Overtime
txtSmrWk2ThuOvertime = new TextBox();
txtSmrWk2ThuOvertime.Location = new System.Drawing.Point(269, 393);
txtSmrWk2ThuOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2ThuOvertime.Text = "0.00";
txtSmrWk2ThuOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2ThuOvertime);
// Text Box: Summary Week 2 - Friday Overtime
txtSmrWk2FriOvertime = new TextBox();
txtSmrWk2FriOvertime.Location = new System.Drawing.Point(326, 393);
txtSmrWk2FriOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2FriOvertime.Text = "0.00";
txtSmrWk2FriOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2FriOvertime);
// Text Box: Summary Week 2 - Saturday Overtime
txtSmrWk2SatOvertime = new TextBox();
txtSmrWk2SatOvertime.Location = new System.Drawing.Point(383, 393);
txtSmrWk2SatOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2SatOvertime.Text = "0.00";
txtSmrWk2SatOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2SatOvertime);
// Text Box: Summary Week 2 - Sunday Overtime
txtSmrWk2SunOvertime = new TextBox();
txtSmrWk2SunOvertime.Location = new System.Drawing.Point(440, 393);
txtSmrWk2SunOvertime.Size = new System.Drawing.Size(51, 20);
txtSmrWk2SunOvertime.Text = "0.00";
txtSmrWk2SunOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2SunOvertime);
// Text Box: Total Overtime Week 2
txtTotalOvertimeWeek2 = new TextBox();
txtTotalOvertimeWeek2.Location = new System.Drawing.Point(507, 395);
txtTotalOvertimeWeek2.Size = new System.Drawing.Size(51, 20);
txtTotalOvertimeWeek2.Text = "0.00";
txtTotalOvertimeWeek2.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTotalOvertimeWeek2);
// Label: Summary Week 2 Regular Pay
lblSmrWk2RegularPay = new Label();
lblSmrWk2RegularPay.AutoSize = true;
lblSmrWk2RegularPay.Location = new System.Drawing.Point(19, 422);
lblSmrWk2RegularPay.TabIndex = 461;
lblSmrWk2RegularPay.Text = "Regular Pay:";
Controls.Add(lblSmrWk2RegularPay);
// Text Box: Summary Week 2 - Monday Regular Pay
txtSmrWk2MonRegularPay = new TextBox();
txtSmrWk2MonRegularPay.Location = new System.Drawing.Point(98, 419);
txtSmrWk2MonRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2MonRegularPay.Text = "0.00";
txtSmrWk2MonRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2MonRegularPay);
Controls.Add(txtEmployeeName);
// Text Box: Summary Week 2 - Tueday Regular Pay
txtSmrWk2TueRegularPay = new TextBox();
txtSmrWk2TueRegularPay.Location = new System.Drawing.Point(155, 419);
txtSmrWk2TueRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2TueRegularPay.Text = "0.00";
txtSmrWk2TueRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2TueRegularPay);
// Text Box: Summary Week 2 - Wednesday Regular Pay
txtSmrWk2WedRegularPay = new TextBox();
txtSmrWk2WedRegularPay.Location = new System.Drawing.Point(212, 419);
txtSmrWk2WedRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2WedRegularPay.Text = "0.00";
txtSmrWk2WedRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2WedRegularPay);
// Text Box: Summary Week 2 - Thursday Regular Pay
txtSmrWk2ThuRegularPay = new TextBox();
txtSmrWk2ThuRegularPay.Location = new System.Drawing.Point(269, 419);
txtSmrWk2ThuRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2ThuRegularPay.Text = "0.00";
txtSmrWk2ThuRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2ThuRegularPay);
// Text Box: Summary Week 2 - Friday Regular Pay
txtSmrWk2FriRegularPay = new TextBox();
txtSmrWk2FriRegularPay.Location = new System.Drawing.Point(326, 419);
txtSmrWk2FriRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2FriRegularPay.Text = "0.00";
txtSmrWk2FriRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2FriRegularPay);
// Text Box: Summary Week 2 - Saturday Regular Pay
txtSmrWk2SatRegularPay = new TextBox();
txtSmrWk2SatRegularPay.Location = new System.Drawing.Point(383, 419);
txtSmrWk2SatRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2SatRegularPay.Text = "0.00";
txtSmrWk2SatRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2SatRegularPay);
// Text Box: Summary Week 2 - Sunday Regular Pay
txtSmrWk2SunRegularPay = new TextBox();
txtSmrWk2SunRegularPay.Location = new System.Drawing.Point(440, 419);
txtSmrWk2SunRegularPay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2SunRegularPay.Text = "0.00";
txtSmrWk2SunRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2SunRegularPay);
// Text Box: Total Regular Pay Week 2
txtTotalRegularPayWeek2 = new TextBox();
txtTotalRegularPayWeek2.Location = new System.Drawing.Point(507, 421);
txtTotalRegularPayWeek2.Size = new System.Drawing.Size(51, 20);
txtTotalRegularPayWeek2.Text = "0.00";
txtTotalRegularPayWeek2.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTotalRegularPayWeek2);
// Label: Summary Week 2 - Overtime Pay
lblSmrWk2OvertimePay = new Label();
lblSmrWk2OvertimePay.AutoSize = true;
lblSmrWk2OvertimePay.Location = new System.Drawing.Point(19, 448);
lblSmrWk2OvertimePay.Size = new System.Drawing.Size(73, 13);
lblSmrWk2OvertimePay.Text = "Overtime Pay:";
Controls.Add(lblSmrWk2OvertimePay);
// Text Box: Summary Week 2 - Monday Overtime Pay
txtSmrWk2MonOvertimePay = new TextBox();
txtSmrWk2MonOvertimePay.Location = new System.Drawing.Point(98, 445);
txtSmrWk2MonOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2MonOvertimePay.Text = "0.00";
txtSmrWk2MonOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2MonOvertimePay);
// Text Box: Summary Week 2 - Tueday Overtime Pay
txtSmrWk2TueOvertimePay = new TextBox();
txtSmrWk2TueOvertimePay.Location = new System.Drawing.Point(155, 445);
txtSmrWk2TueOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2TueOvertimePay.Text = "0.00";
txtSmrWk2TueOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2TueOvertimePay);
// Text Box: Summary Week 2 - Wednesday Overtime Pay
txtSmrWk2WedOvertimePay = new TextBox();
txtSmrWk2WedOvertimePay.Location = new System.Drawing.Point(212, 445);
txtSmrWk2WedOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2WedOvertimePay.Text = "0.00";
txtSmrWk2WedOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2WedOvertimePay);
// Text Box: Summary Week 2 - Thursday Overtime Pay
txtSmrWk2ThuOvertimePay = new TextBox();
txtSmrWk2ThuOvertimePay.Location = new System.Drawing.Point(269, 445);
txtSmrWk2ThuOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2ThuOvertimePay.Text = "0.00";
txtSmrWk2ThuOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2ThuOvertimePay);
// Text Box: Summary Week 2 - Friday Overtime Pay
txtSmrWk2FriOvertimePay = new TextBox();
txtSmrWk2FriOvertimePay.Location = new System.Drawing.Point(326, 445);
txtSmrWk2FriOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2FriOvertimePay.Text = "0.00";
txtSmrWk2FriOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2FriOvertimePay);
// Text Box: Summary Week 2 - Saturday Overtime Pay
txtSmrWk2SatOvertimePay = new TextBox();
txtSmrWk2SatOvertimePay.Location = new System.Drawing.Point(383, 445);
txtSmrWk2SatOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2SatOvertimePay.Text = "0.00";
txtSmrWk2SatOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2SatOvertimePay);
// Text Box: Summary Week 2 - Sunday Overtime Pay
txtSmrWk2SunOvertimePay = new TextBox();
txtSmrWk2SunOvertimePay.Location = new System.Drawing.Point(440, 445);
txtSmrWk2SunOvertimePay.Size = new System.Drawing.Size(51, 20);
txtSmrWk2SunOvertimePay.Text = "0.00";
txtSmrWk2SunOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtSmrWk2SunOvertimePay);
// Text Box: Total Overtime Pay Week 2
txtTotalOvertimePayWeek2 = new TextBox();
txtTotalOvertimePayWeek2.Location = new System.Drawing.Point(507, 447);
txtTotalOvertimePayWeek2.Size = new System.Drawing.Size(51, 20);
txtTotalOvertimePayWeek2.Text = "0.00";
txtTotalOvertimePayWeek2.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtTotalOvertimePayWeek2);
Controls.Add(lblDoubleLine);
lblDoubleLine = new Label();
lblDoubleLine1 = new Label();
lblDoubleLine3 = new Label();
// Label: Line Week 2 Summary
lblLineWeek2Summary = new Label();
lblLineWeek2Summary.AutoSize = true;
lblLineWeek2Summary.Location = new System.Drawing.Point(20, 348);
lblLineWeek2Summary.Text = "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
Controls.Add(lblLineWeek2Summary);
// Label: Time
lblTime = new Label();
lblTime.AutoSize = true;
lblTime.Location = new System.Drawing.Point(661, 332);
lblTime.Text = "Time";
Controls.Add(lblTime);
// Label: Pay
lblPay = new Label();
lblPay.AutoSize = true;
lblPay.Location = new System.Drawing.Point(720, 332);
lblPay.Text = "Pay";
Controls.Add(lblPay);
// Label: Regular
lblRegular = new Label();
lblRegular.AutoSize = true;
lblRegular.Location = new System.Drawing.Point(589, 353);
lblRegular.Text = "Regular:";
Controls.Add(lblRegular);
// Text Box: Regular Time
txtRegularTime = new TextBox();
txtRegularTime.Location = new System.Drawing.Point(664, 350);
txtRegularTime.Size = new System.Drawing.Size(51, 20);
txtRegularTime.Text = "0.00";
txtRegularTime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtRegularTime);
// Text Box: Regular Pay
txtRegularPay = new TextBox();
txtRegularPay.Location = new System.Drawing.Point(721, 350);
txtRegularPay.Size = new System.Drawing.Size(51, 20);
txtRegularPay.Text = "0.00";
txtRegularPay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtRegularPay);
// Label: Overtime
lblOvertime = new Label();
lblOvertime.AutoSize = true;
lblOvertime.Location = new System.Drawing.Point(589, 379);
lblOvertime.Text = "Overtime:";
Controls.Add(lblOvertime);
// Text Box: Overtime
txtOvertime = new TextBox();
txtOvertime.Location = new System.Drawing.Point(664, 376);
txtOvertime.Size = new System.Drawing.Size(51, 20);
txtOvertime.Text = "0.00";
txtOvertime.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtOvertime);
// Text Box: Overtime Pay
txtOvertimePay = new TextBox();
txtOvertimePay.Location = new System.Drawing.Point(721, 376);
txtOvertimePay.Size = new System.Drawing.Size(51, 20);
txtOvertimePay.Text = "0.00";
txtOvertimePay.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtOvertimePay);
// Label: Gross Salary
lblGrossSalary = new Label();
lblGrossSalary.AutoSize = true;
lblGrossSalary.Location = new System.Drawing.Point(589, 409);
lblGrossSalary.Text = "Gross Salary:";
Controls.Add(lblGrossSalary);
// Text Box: Gross Salary
txtGrossSalary = new TextBox();
txtGrossSalary.Location = new System.Drawing.Point(664, 406);
txtGrossSalary.Size = new System.Drawing.Size(79, 20);
txtGrossSalary.Text = "0.00";
txtGrossSalary.TextAlign = HorizontalAlignment.Right;
Controls.Add(txtGrossSalary);
// Button: Close
btnClose = new Button();
btnClose.Location = new System.Drawing.Point(664, 444);
btnClose.Size = new System.Drawing.Size(108, 23);
btnClose.Text = "Close";
btnClose.Click += new EventHandler(btnCloseClick);
Controls.Add(btnClose);
// lblDoubleLine3
lblDoubleLine3.AutoSize = true;
lblDoubleLine3.Location = new System.Drawing.Point(19, 476);
lblDoubleLine3.Text = "==============================================================================================================================";
Controls.Add(lblDoubleLine3);
// Label: Summary Sunday
lblSummarySunday = new Label();
lblSummarySunday.AutoSize = true;
lblSummarySunday.Location = new System.Drawing.Point(437, 249);
lblSummarySunday.Text = "Sunday";
Controls.Add(lblSummarySunday);
// Form: Payroll Summary 2
ClientSize = new System.Drawing.Size(797, 501);
MaximizeBox = false;
StartPosition = FormStartPosition.CenterScreen;
Text = "Fun Department Store - Payroll Summary";
Load += new EventHandler(PayrollSummaryLoad);
}
private void ResetForm()
{
hourlySalary = 0.00;
overtimeSalary = 0.00;
week1Monday = 0.00;
week1Tuesday = 0.00;
week1Wednesday = 0.00;
week1Thursday = 0.00;
week1Friday = 0.00;
week1Saturday = 0.00;
week1Sunday = 0.00;
week2Monday = 0.00;
week2Tuesday = 0.00;
week2Wednesday = 0.00;
week2Thursday = 0.00;
week2Friday = 0.00;
week2Saturday = 0.00;
week2Sunday = 0.00;
txtEmployeeNumber.Text = "";
txtEmployeeName.Text = "";
txtHourlySalary.Text = "";
txtTSWk1Monday.Text = "0.00";
txtTSWk1Tuesday.Text = "0.00";
txtTSWk1Wednesday.Text = "0.00";
txtTSWk1Thursday.Text = "0.00";
txtTSWk1Friday.Text = "0.00";
txtTSWk1Saturday.Text = "0.00";
txtTSWk1Sunday.Text = "0.00";
txtTotalTimeWeek1.Text = "0.00";
txtTotalRegularTimeWeek1.Text = "0.00";
txtTotalOvertimeWeek1.Text = "0.00";
txtTotalRegularPayWeek1.Text = "0.00";
txtTotalOvertimePayWeek1.Text = "0.00";
txtSmrWk1MonRegularTime.Text = "0.00";
txtSmrWk1MonOvertime.Text = "0.00";
txtSmrWk1MonRegularPay.Text = "0.00";
txtSmrWk1MonOvertimePay.Text = "0.00";
txtSmrWk1TueRegularTime.Text = "0.00";
txtSmrWk1TueOvertime.Text = "0.00";
txtSmrWk1TueRegularPay.Text = "0.00";
txtSmrWk1TueOvertimePay.Text = "0.00";
txtSmrWk1WedRegularTime.Text = "0.00";
txtSmrWk1WedOvertime.Text = "0.00";
txtSmrWk1WedRegularPay.Text = "0.00";
txtSmrWk1WedOvertimePay.Text = "0.00";
txtSmrWk1ThuRegularTime.Text = "0.00";
txtSmrWk1ThuOvertime.Text = "0.00";
txtSmrWk1ThuRegularPay.Text = "0.00";
txtSmrWk1ThuOvertimePay.Text = "0.00";
txtSmrWk1FriRegularTime.Text = "0.00";
txtSmrWk1FriOvertime.Text = "0.00";
txtSmrWk1FriRegularPay.Text = "0.00";
txtSmrWk1FriOvertimePay.Text = "0.00";
txtSmrWk1SatRegularTime.Text = "0.00";
txtSmrWk1SatOvertime.Text = "0.00";
txtSmrWk1SatRegularPay.Text = "0.00";
txtSmrWk1SatOvertimePay.Text = "0.00";
txtSmrWk1SunRegularTime.Text = "0.00";
txtSmrWk1SunOvertime.Text = "0.00";
txtSmrWk1SunRegularPay.Text = "0.00";
txtSmrWk1SunOvertimePay.Text = "0.00";
txtTSWk2Monday.Text = "0.00";
txtTSWk2Tuesday.Text = "0.00";
txtTSWk2Wednesday.Text = "0.00";
txtTSWk2Thursday.Text = "0.00";
txtTSWk2Friday.Text = "0.00";
txtTSWk2Saturday.Text = "0.00";
txtTSWk2Sunday.Text = "0.00";
txtTotalTimeWeek2.Text = "0.00";
txtTotalRegularTimeWeek2.Text = "0.00";
txtTotalOvertimeWeek2.Text = "0.00";
txtTotalRegularPayWeek2.Text = "0.00";
txtTotalOvertimePayWeek2.Text = "0.00";
txtSmrWk2MonRegularTime.Text = "0.00";
txtSmrWk2MonOvertime.Text = "0.00";
txtSmrWk2MonRegularPay.Text = "0.00";
txtSmrWk2MonOvertimePay.Text = "0.00";
txtSmrWk2TueRegularTime.Text = "0.00";
txtSmrWk2TueOvertime.Text = "0.00";
txtSmrWk2TueRegularPay.Text = "0.00";
txtSmrWk2TueOvertimePay.Text = "0.00";
txtSmrWk2WedRegularTime.Text = "0.00";
txtSmrWk2WedOvertime.Text = "0.00";
txtSmrWk2WedRegularPay.Text = "0.00";
txtSmrWk2WedOvertimePay.Text = "0.00";
txtSmrWk2ThuRegularTime.Text = "0.00";
txtSmrWk2ThuOvertime.Text = "0.00";
txtSmrWk2ThuRegularPay.Text = "0.00";
txtSmrWk2ThuOvertimePay.Text = "0.00";
txtSmrWk2FriRegularTime.Text = "0.00";
txtSmrWk2FriOvertime.Text = "0.00";
txtSmrWk2FriRegularPay.Text = "0.00";
txtSmrWk2FriOvertimePay.Text = "0.00";
txtSmrWk2SatRegularTime.Text = "0.00";
txtSmrWk2SatOvertime.Text = "0.00";
txtSmrWk2SatRegularPay.Text = "0.00";
txtSmrWk2SatOvertimePay.Text = "0.00";
txtSmrWk2SunRegularTime.Text = "0.00";
txtSmrWk2SunOvertime.Text = "0.00";
txtSmrWk2SunRegularPay.Text = "0.00";
txtSmrWk2SunOvertimePay.Text = "0.00";
txtRegularTime.Text = "0.00";
txtOvertime.Text = "0.00";
txtRegularPay.Text = "0.00";
txtOvertimePay.Text = "0.00";
txtGrossSalary.Text = "0.00";
}
private void PayrollSummaryLoad(object sender, EventArgs e)
{
ResetForm();
}
private void txtEmployeeNumberLeave(object sender, EventArgs e)
{
bool employeeFound = false;
XmlDocument xdEmployees = new XmlDocument();
string strEmployeesFile = @"C:\Fun Department Store - Payroll\Employees.xml";
if (string.IsNullOrEmpty(txtEmployeeNumber.Text))
{
return;
}
if (File.Exists(strEmployeesFile))
{
using (FileStream fsEmployees = new FileStream(strEmployeesFile, FileMode.Open, FileAccess.Read))
{
xdEmployees.Load(fsEmployees);
XmlNodeList xnlEmployees = xdEmployees.GetElementsByTagName("EmployeeNumber");
foreach (XmlNode xnEmployee in xnlEmployees)
{
if (xnEmployee.InnerText == txtEmployeeNumber.Text)
{
txtEmployeeName.Text = xnEmployee.NextSibling.InnerText + " " + xnEmployee.NextSibling.NextSibling.InnerText;
txtHourlySalary.Text = xnEmployee.NextSibling.NextSibling.NextSibling.InnerText;
employeeFound = true;
}
}
if (employeeFound == false)
{
MessageBox.Show("There is no staff member with that employee number.",
"FunDS - Employees Time Sheets",
MessageBoxButtons.OK, MessageBoxIcon.Information);
ResetForm();
return;
}
}
}
}
private void btnFindEvaluateClick(object sender, EventArgs e)
{
bool timeSheetFound = false;
XmlDocument xdTimeSheets = new XmlDocument();
string strTimeSheetsFile = @"C:\Fun Department Store - Payroll\TimeSheets.xml";
if (string.IsNullOrEmpty(txtEmployeeNumber.Text))
{
return;
}
if (File.Exists(strTimeSheetsFile))
{
using (FileStream fsTimeSheets = new FileStream(strTimeSheetsFile, FileMode.Open, FileAccess.Read))
{
xdTimeSheets.Load(fsTimeSheets);
XmlNodeList xnlTimeSheets = xdTimeSheets.DocumentElement.SelectNodes("/TimeSheets/TimeSheet/EmployeeNumber[.='" + txtEmployeeNumber.Text + "']");
foreach (XmlNode xnTimeSheet in xnlTimeSheets)
{
if (xnTimeSheet.NextSibling.InnerText == dtpStartDate.Value.ToShortDateString())
{
txtTimeSheetID.Text = xnTimeSheet.PreviousSibling.InnerText;
txtTSWk1Monday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk1Tuesday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk1Wednesday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk1Thursday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk1Friday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk1Saturday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk1Sunday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk2Monday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk2Tuesday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk2Wednesday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk2Thursday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk2Friday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk2Saturday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
txtTSWk2Sunday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
timeSheetFound = true;
ProcessTimeSheet();
}
}
if (timeSheetFound == false)
{
MessageBox.Show("There is no time sheet for that start date and that employee number.",
"FunDS - Employees Time Sheets",
MessageBoxButtons.OK, MessageBoxIcon.Information);
ResetForm();
}
}
}
}
public Tuple<double, double, double, double> GetWeek1MondaySummary()
{
week1Monday = double.Parse(txtTSWk1Monday.Text);
double regTime = 0.00;
double overTime = 0.00;
if (week1Monday <= 8.00)
regTime = week1Monday;
else
regTime = 8.00;
if (week1Monday <= 8.00)
overTime = 0.00;
else
overTime = week1Monday - 8.00;
double regPay = regTime * hourlySalary;
double overPay = overTime * overtimeSalary;
return new Tuple<double, double, double, double>(regTime, overTime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek1TuesdaySummary()
{
week1Tuesday = double.Parse(txtTSWk1Tuesday.Text);
double regTime = 0.00, overtime = 0.00;
if (week1Tuesday <= 8.00)
regTime = week1Tuesday;
else
regTime = 8.00;
if (week1Tuesday <= 8.00)
overtime = 0.00;
else
overtime = week1Tuesday - 8.00;
return new Tuple<double, double, double, double>(regTime, overtime, regTime * hourlySalary, overtime * overtimeSalary);
}
public Tuple<double, double, double, double> GetWeek1WednesdaySummary()
{
week1Wednesday = double.Parse(txtTSWk1Wednesday.Text);
double regTime = 0.00, overtime = 0.00;
if (week1Wednesday <= 8.00)
{
regTime = week1Wednesday;
overtime = 0.00;
}
else
{
regTime = 8.00;
overtime = week1Wednesday - 8.00;
}
return new Tuple<double, double, double, double>(regTime, overtime, regTime * hourlySalary, overtime * overtimeSalary);
}
public Tuple<double, double, double, double> GetWeek1ThursdaySummary()
{
week1Thursday = double.Parse(txtTSWk1Thursday.Text);
double regTime = 0.00;
double overtime = 0.00;
double regPay = 0.00;
double overPay = 0.00;
if (week1Thursday <= 8.00)
regTime = week1Thursday;
else
regTime = 8.00;
if (week1Thursday <= 8.00) overtime = 0.00; else overtime = week1Thursday - 8.00;
if (week1Thursday <= 8.00) regPay = week1Thursday * hourlySalary; else regPay = 8.00 * hourlySalary;
if (week1Thursday <= 8.00) overPay = 0.00; else overPay = (week1Thursday - 8.00) * overtimeSalary;
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek1FridaySummary()
{
week1Friday = double.Parse(txtTSWk1Friday.Text);
double regTime = 0.00, overtime = 0.00, regPay = 0.00, overPay = 0.00;
if (week1Friday <= 8.00) regTime = week1Friday; else regTime = 8.00;
if (week1Friday <= 8.00) overtime = 0.00; else overtime = week1Friday - 8.00;
if (week1Friday <= 8.00) regPay = week1Friday * hourlySalary; else regPay = 8.00 * hourlySalary;
if (week1Friday <= 8.00) overPay = 0.00; else overPay = (week1Friday - 8.00) * overtimeSalary;
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek1SaturdaySummary()
{
week1Saturday = double.Parse(txtTSWk1Saturday.Text);
double regTime = 0.00, overtime = 0.00, regPay = 0.00, overPay = 0.00;
if (week1Saturday <= 8.00) regTime = week1Saturday; else regTime = 8.00;
if (week1Saturday <= 8.00) overtime = 0.00; else overtime = week1Saturday - 8.00;
if (week1Saturday <= 8.00) regPay = week1Saturday * hourlySalary; else regPay = 8.00 * hourlySalary;
if (week1Saturday <= 8.00) overPay = 0.00; else overPay = overtime * overtimeSalary;
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek1SundaySummary()
{
week1Sunday = double.Parse(txtTSWk1Sunday.Text);
double regTime = 0.00, overtime = 0.00, regPay = 0.00, overPay = 0.00;
if (week1Sunday <= 8.00)
{
regTime = week1Sunday;
overtime = 0.00;
regPay = week1Sunday * hourlySalary;
overPay = 0.00;
}
else
{
regTime = 8.00;
overtime = week1Sunday - 8.00;
regPay = 8.00 * hourlySalary;
overPay = (week1Sunday - 8.00) * overtimeSalary;
}
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek2MondaySummary()
{
week2Monday = double.Parse(txtTSWk2Monday.Text);
double regTime = 0.00, overtime = 0.00, regPay = 0.00, overPay = 0.00;
if (week2Monday <= 8.00) { regTime = week2Monday; overtime = 0.00; regPay = week2Monday; overPay = 0.00; }
else
{
regTime = 8.00;
overtime = week2Monday - 8.00;
regPay = 8.00 * hourlySalary;
overPay = (week2Monday - 8.00) * overtimeSalary;
}
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek2TuesdaySummary()
{
week2Tuesday = double.Parse(txtTSWk2Tuesday.Text);
double regTime = 0.00, overtime = 0.00, regPay = 0.00, overPay = 0.00;
if (week2Tuesday <= 8.00) { regTime = week2Tuesday; overtime = 0.00; regPay = week2Tuesday * hourlySalary; overPay = 0.00; }
else { regTime = 8.00; overtime = week2Tuesday - 8.00; regPay = 8.00 * hourlySalary; overPay = (week2Tuesday - 8.00) * overtimeSalary; }
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek2WednesdaySummary()
{
week2Wednesday = double.Parse(txtTSWk2Wednesday.Text);
double regTime = 0.00, overtime = 0.00, regPay = 0.00, overPay = 0.00;
if (week2Wednesday <= 8.00) { regTime = week2Wednesday; overtime = 0.00; regPay = week2Wednesday * hourlySalary; overPay = 0.00; }
else { regTime = 8.00; overtime = week2Wednesday - 8.00; regPay = 8.00 * hourlySalary; overPay = (week2Wednesday - 8.00) * overtimeSalary; }
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek2ThursdaySummary()
{
week2Thursday = double.Parse(txtTSWk2Thursday.Text);
double regTime = 0.00, overtime = 0.00, regPay = 0.00, overPay = 0.00;
if (week2Thursday <= 8.00) { regTime = week2Thursday; overtime = 0.00; regPay = week2Thursday * hourlySalary; overPay = 0.00; }
else { regTime = 8.00; overtime = week2Thursday - 8.00; regPay = 8.00 * hourlySalary; overPay = (week2Thursday - 8.00) * overtimeSalary; }
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek2FridaySummary()
{
week2Friday = double.Parse(txtTSWk2Friday.Text);
double regTime = 0.00, overtime = 0.00, regPay = 0.00, overPay = 0.00;
if (week2Friday <= 8.00) { regTime = week2Friday; overtime = 0.00; regPay = week2Friday * hourlySalary; overPay = 0.00; }
else { regTime = 8.00; overtime = week2Friday - 8.00; regPay = 8.00 * hourlySalary; overPay = (week2Friday - 8.00) * overtimeSalary; }
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek2SaturdaySummary()
{
week2Saturday = double.Parse(txtTSWk2Saturday.Text);
double regTime = 0.00, overtime = 0.00, regPay = 0.00, overPay = 0.00;
if (week2Saturday <= 8.00) { regTime = week2Saturday; overtime = 0.00; regPay = week2Saturday * hourlySalary; overPay = 0.00; }
else { regTime = 8.00; overtime = week2Saturday - 8.00; regPay = 8.00 * hourlySalary; overPay = (week2Saturday - 8.00) * overtimeSalary; }
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public Tuple<double, double, double, double> GetWeek2SundaySummary()
{
week2Sunday = double.Parse(txtTSWk2Sunday.Text);
double regTime = 0.00, overtime = 0.00, regPay = 0.00, overPay = 0.00;
if (week2Sunday <= 8.00) { regTime = week2Sunday; overtime = 0.00; regPay = week2Sunday * hourlySalary; overPay = 0.00; }
else { regTime = 8.00; overtime = week2Sunday - 8.00; regPay = 8.00 * hourlySalary; overPay = (week2Sunday - 8.00) * overtimeSalary; }
return new Tuple<double, double, double, double>(regTime, overtime, regPay, overPay);
}
public double TotalTimeWorked
{
get
{
return week1Monday + week1Tuesday + week1Wednesday + week1Thursday + week1Friday + week1Saturday + week1Sunday +
week2Monday + week2Tuesday + week2Wednesday + week2Thursday + week2Friday + week2Saturday + week2Sunday;
}
}
public Tuple<double, double, double, double> GetTimePaySummary()
{
Tuple<double, double, double, double> w1Mon = GetWeek1MondaySummary();
Tuple<double, double, double, double> w1Tue = GetWeek1TuesdaySummary();
Tuple<double, double, double, double> w1Wed = GetWeek1WednesdaySummary();
Tuple<double, double, double, double> w1Thu = GetWeek1ThursdaySummary();
Tuple<double, double, double, double> w1Fri = GetWeek1FridaySummary();
Tuple<double, double, double, double> w1Sat = GetWeek1SaturdaySummary();
Tuple<double, double, double, double> w1Sun = GetWeek1SundaySummary();
Tuple<double, double, double, double> w2Mon = GetWeek2MondaySummary();
Tuple<double, double, double, double> w2Tue = GetWeek2TuesdaySummary();
Tuple<double, double, double, double> w2Wed = GetWeek2WednesdaySummary();
Tuple<double, double, double, double> w2Thu = GetWeek2ThursdaySummary();
Tuple<double, double, double, double> w2Fri = GetWeek2FridaySummary();
Tuple<double, double, double, double> w2Sat = GetWeek2SaturdaySummary();
Tuple<double, double, double, double> w2Sun = GetWeek2SundaySummary();
double totalRegularTime = 0.00, totalOvertime = 0.00, totalRegularPay = 0.00, totalOvertimePay = 0.00;
totalRegularTime = w1Mon.Item1 + w1Tue.Item1 + w1Wed.Item1 + w1Thu.Item1 + w1Fri.Item1 + w1Sat.Item1 + w1Sun.Item1 +
w2Mon.Item1 + w2Tue.Item1 + w2Wed.Item1 + w2Thu.Item1 + w2Fri.Item1 + w2Sat.Item1 + w2Sun.Item1;
totalOvertime = w1Mon.Item2 + w1Tue.Item2 + w1Wed.Item2 + w1Thu.Item2 + w1Fri.Item2 + w1Sat.Item2 + w1Sun.Item2 +
w2Mon.Item2 + w2Tue.Item2 + w2Wed.Item2 + w2Thu.Item2 + w2Fri.Item2 + w2Sat.Item2 + w2Sun.Item2;
totalRegularPay = w1Mon.Item3 + w1Tue.Item3 + w1Wed.Item3 + w1Thu.Item3 + w1Fri.Item3 + w1Sat.Item3 + w1Sun.Item3 +
w2Mon.Item3 + w2Tue.Item3 + w2Wed.Item3 + w2Thu.Item3 + w2Fri.Item3 + w2Sat.Item3 + w2Sun.Item3;
totalOvertimePay = w1Mon.Item4 + w1Tue.Item4 + w1Wed.Item4 + w1Thu.Item4 + w1Fri.Item4 + w1Sat.Item4 + w1Sun.Item4 +
w2Mon.Item4 + w2Tue.Item4 + w2Wed.Item4 + w2Thu.Item4 + w2Fri.Item4 + w2Sat.Item4 + w2Sun.Item4;
return new Tuple<double, double, double, double>(totalRegularTime, totalOvertime, totalRegularPay, totalOvertimePay);
}
public double GrossSalary
{
get
{
Tuple<double, double, double, double> grossSalary = GetTimePaySummary();
return grossSalary.Item3 + grossSalary.Item4;
}
}
private Tuple<double, double, double, double> GetWorkDaySummary(double timeWorked, double hourlySalary)
{
double regTime = 0.00;
double overTime = 0.00;
double overtimeSalary = hourlySalary * 1.50;
if (timeWorked <= 8.00)
regTime = timeWorked;
else
regTime = 8.00;
if (timeWorked <= 8.00)
overTime = 0.00;
else
overTime = timeWorked - 8.00;
double regPay = regTime * hourlySalary;
double overPay = overTime * overtimeSalary;
return new Tuple<double, double, double, double>(regTime, overTime, regPay, overPay);
}
private void ProcessTimeSheet()
{
Tuple<double, double, double, double> wk1MondaySummary = GetWorkDaySummary(double.Parse(txtTSWk1Monday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk1TuesdaySummary = GetWorkDaySummary(double.Parse(txtTSWk1Tuesday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk1WednesdaySummary = GetWorkDaySummary(double.Parse(txtTSWk1Wednesday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk1ThursdaySummary = GetWorkDaySummary(double.Parse(txtTSWk1Thursday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk1FridaySummary = GetWorkDaySummary(double.Parse(txtTSWk1Friday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk1SaturdaySummary = GetWorkDaySummary(double.Parse(txtTSWk1Saturday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk1SundaySummary = GetWorkDaySummary(double.Parse(txtTSWk1Sunday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk2MondaySummary = GetWorkDaySummary(double.Parse(txtTSWk2Monday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk2TuesdaySummary = GetWorkDaySummary(double.Parse(txtTSWk2Tuesday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk2WednesdaySummary = GetWorkDaySummary(double.Parse(txtTSWk2Wednesday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk2ThursdaySummary = GetWorkDaySummary(double.Parse(txtTSWk2Thursday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk2FridaySummary = GetWorkDaySummary(double.Parse(txtTSWk2Friday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk2SaturdaySummary = GetWorkDaySummary(double.Parse(txtTSWk2Saturday.Text), double.Parse(txtHourlySalary.Text));
Tuple<double, double, double, double> wk2SundaySummary = GetWorkDaySummary(double.Parse(txtTSWk2Sunday.Text), double.Parse(txtHourlySalary.Text));
txtTotalTimeWeek1.Text = (double.Parse(txtTSWk1Monday.Text) + double.Parse(txtTSWk1Tuesday.Text) + double.Parse(txtTSWk1Wednesday.Text) + double.Parse(txtTSWk1Thursday.Text) + double.Parse(txtTSWk1Friday.Text) + double.Parse(txtTSWk1Saturday.Text) + double.Parse(txtTSWk1Sunday.Text)).ToString("F");
txtTotalRegularTimeWeek1.Text = (wk1MondaySummary.Item1 + wk1TuesdaySummary.Item1 + wk1WednesdaySummary.Item1 + wk1ThursdaySummary.Item1 + wk1FridaySummary.Item1 + wk1SaturdaySummary.Item1 + wk1SundaySummary.Item1).ToString("F");
txtTotalOvertimeWeek1.Text = (wk1MondaySummary.Item2 + wk1TuesdaySummary.Item2 + wk1WednesdaySummary.Item2 + wk1ThursdaySummary.Item2 + wk1FridaySummary.Item2 + wk1SaturdaySummary.Item2 + wk1SundaySummary.Item2).ToString("F");
txtTotalRegularPayWeek1.Text = (wk1MondaySummary.Item3 + wk1TuesdaySummary.Item3 + wk1WednesdaySummary.Item3 + wk1ThursdaySummary.Item3 + wk1FridaySummary.Item3 + wk1SaturdaySummary.Item3 + wk1SundaySummary.Item3).ToString("F");
txtTotalOvertimePayWeek1.Text = (wk1MondaySummary.Item4 + wk1TuesdaySummary.Item4 + wk1WednesdaySummary.Item4 + wk1ThursdaySummary.Item4 + wk1FridaySummary.Item4 + wk1SaturdaySummary.Item4 + wk1SundaySummary.Item4).ToString("F");
txtTotalTimeWeek2.Text = (double.Parse(txtTSWk2Monday.Text) + double.Parse(txtTSWk2Tuesday.Text) + double.Parse(txtTSWk2Wednesday.Text) + double.Parse(txtTSWk2Thursday.Text) + double.Parse(txtTSWk2Friday.Text) + double.Parse(txtTSWk2Saturday.Text) + double.Parse(txtTSWk2Sunday.Text)).ToString("F");
txtTotalRegularTimeWeek2.Text = (wk2MondaySummary.Item1 + wk2TuesdaySummary.Item1 + wk2WednesdaySummary.Item1 + wk2ThursdaySummary.Item1 + wk2FridaySummary.Item1 + wk2SaturdaySummary.Item1 + wk2SundaySummary.Item1).ToString("F");
txtTotalOvertimeWeek2.Text = (wk2MondaySummary.Item2 + wk2TuesdaySummary.Item2 + wk2WednesdaySummary.Item2 + wk2ThursdaySummary.Item2 + wk2FridaySummary.Item2 + wk2SaturdaySummary.Item2 + wk2SundaySummary.Item2).ToString("F");
txtTotalRegularPayWeek2.Text = (wk2MondaySummary.Item3 + wk2TuesdaySummary.Item3 + wk2WednesdaySummary.Item3 + wk2ThursdaySummary.Item3 + wk2FridaySummary.Item3 + wk2SaturdaySummary.Item3 + wk2SundaySummary.Item3).ToString("F");
txtTotalOvertimePayWeek2.Text = (wk2MondaySummary.Item4 + wk2TuesdaySummary.Item4 + wk2WednesdaySummary.Item4 + wk2ThursdaySummary.Item4 + wk2FridaySummary.Item4 + wk2SaturdaySummary.Item4 + wk2SundaySummary.Item4).ToString("F");
double totalRegularTime = wk1MondaySummary.Item1 + wk1TuesdaySummary.Item1 + wk1WednesdaySummary.Item1 + wk1ThursdaySummary.Item1 + wk1FridaySummary.Item1 + wk1SaturdaySummary.Item1 + wk1SundaySummary.Item1 +
wk2MondaySummary.Item1 + wk2TuesdaySummary.Item1 + wk2WednesdaySummary.Item1 + wk2ThursdaySummary.Item1 + wk2FridaySummary.Item1 + wk2SaturdaySummary.Item1 + wk2SundaySummary.Item1;
double totalOvertime = wk1MondaySummary.Item2 + wk1TuesdaySummary.Item2 + wk1WednesdaySummary.Item2 + wk1ThursdaySummary.Item2 + wk1FridaySummary.Item2 + wk1SaturdaySummary.Item2 + wk1SundaySummary.Item2 +
wk2MondaySummary.Item2 + wk2TuesdaySummary.Item2 + wk2WednesdaySummary.Item2 + wk2ThursdaySummary.Item2 + wk2FridaySummary.Item2 + wk2SaturdaySummary.Item2 + wk2SundaySummary.Item2;
double totalRegularPay = wk1MondaySummary.Item3 + wk1TuesdaySummary.Item3 + wk1WednesdaySummary.Item3 + wk1ThursdaySummary.Item3 + wk1FridaySummary.Item3 + wk1SaturdaySummary.Item3 + wk1SundaySummary.Item3 +
wk2MondaySummary.Item3 + wk2TuesdaySummary.Item3 + wk2WednesdaySummary.Item3 + wk2ThursdaySummary.Item3 + wk2FridaySummary.Item3 + wk2SaturdaySummary.Item3 + wk2SundaySummary.Item3;
double totalOvertimePay = wk1MondaySummary.Item4 + wk1TuesdaySummary.Item4 + wk1WednesdaySummary.Item4 + wk1ThursdaySummary.Item4 + wk1FridaySummary.Item4 + wk1SaturdaySummary.Item4 + wk1SundaySummary.Item4 +
wk2MondaySummary.Item4 + wk2TuesdaySummary.Item4 + wk2WednesdaySummary.Item4 + wk2ThursdaySummary.Item4 + wk2FridaySummary.Item4 + wk2SaturdaySummary.Item4 + wk2SundaySummary.Item4;
txtSmrWk1MonRegularTime.Text = wk1MondaySummary.Item1.ToString("F");
txtSmrWk1MonOvertime.Text = wk1MondaySummary.Item2.ToString("F");
txtSmrWk1MonRegularPay.Text = wk1MondaySummary.Item3.ToString("F");
txtSmrWk1MonOvertimePay.Text = wk1MondaySummary.Item4.ToString("F");
txtSmrWk1TueRegularTime.Text = wk1TuesdaySummary.Item1.ToString("F");
txtSmrWk1TueOvertime.Text = wk1TuesdaySummary.Item2.ToString("F");
txtSmrWk1TueRegularPay.Text = wk1TuesdaySummary.Item3.ToString("F");
txtSmrWk1TueOvertimePay.Text = wk1TuesdaySummary.Item4.ToString("F");
txtSmrWk1WedRegularTime.Text = wk1WednesdaySummary.Item1.ToString("F");
txtSmrWk1WedOvertime.Text = wk1WednesdaySummary.Item2.ToString("F");
txtSmrWk1WedRegularPay.Text = wk1WednesdaySummary.Item3.ToString("F");
txtSmrWk1WedOvertimePay.Text = wk1WednesdaySummary.Item4.ToString("F");
txtSmrWk1ThuRegularTime.Text = wk1ThursdaySummary.Item1.ToString("F");
txtSmrWk1ThuOvertime.Text = wk1ThursdaySummary.Item2.ToString("F");
txtSmrWk1ThuRegularPay.Text = wk1ThursdaySummary.Item3.ToString("F");
txtSmrWk1ThuOvertimePay.Text = wk1ThursdaySummary.Item4.ToString("F");
txtSmrWk1FriRegularTime.Text = wk1FridaySummary.Item1.ToString("F");
txtSmrWk1FriOvertime.Text = wk1FridaySummary.Item2.ToString("F");
txtSmrWk1FriRegularPay.Text = wk1FridaySummary.Item3.ToString("F");
txtSmrWk1FriOvertimePay.Text = wk1FridaySummary.Item4.ToString("F");
txtSmrWk1SatRegularTime.Text = wk1SaturdaySummary.Item1.ToString("F");
txtSmrWk1SatOvertime.Text = wk1SaturdaySummary.Item2.ToString("F");
txtSmrWk1SatRegularPay.Text = wk1SaturdaySummary.Item3.ToString("F");
txtSmrWk1SatOvertimePay.Text = wk1SaturdaySummary.Item4.ToString("F");
txtSmrWk1SunRegularTime.Text = wk1SundaySummary.Item1.ToString("F");
txtSmrWk1SunOvertime.Text = wk1SundaySummary.Item2.ToString("F");
txtSmrWk1SunRegularPay.Text = wk1SundaySummary.Item3.ToString("F");
txtSmrWk1SunOvertimePay.Text = wk1SundaySummary.Item4.ToString("F");
txtSmrWk2MonRegularTime.Text = wk2MondaySummary.Item1.ToString("F");
txtSmrWk2MonOvertime.Text = wk2MondaySummary.Item2.ToString("F");
txtSmrWk2MonRegularPay.Text = wk2MondaySummary.Item3.ToString("F");
txtSmrWk2MonOvertimePay.Text = wk2MondaySummary.Item4.ToString("F");
txtSmrWk2TueRegularTime.Text = wk2TuesdaySummary.Item1.ToString("F");
txtSmrWk2TueOvertime.Text = wk2TuesdaySummary.Item2.ToString("F");
txtSmrWk2TueRegularPay.Text = wk2TuesdaySummary.Item3.ToString("F");
txtSmrWk2TueOvertimePay.Text = wk2TuesdaySummary.Item4.ToString("F");
txtSmrWk2WedRegularTime.Text = wk2WednesdaySummary.Item1.ToString("F");
txtSmrWk2WedOvertime.Text = wk2WednesdaySummary.Item2.ToString("F");
txtSmrWk2WedRegularPay.Text = wk2WednesdaySummary.Item3.ToString("F");
txtSmrWk2WedOvertimePay.Text = wk2WednesdaySummary.Item4.ToString("F");
txtSmrWk2ThuRegularTime.Text = wk2ThursdaySummary.Item1.ToString("F");
txtSmrWk2ThuOvertime.Text = wk2ThursdaySummary.Item2.ToString("F");
txtSmrWk2ThuRegularPay.Text = wk2ThursdaySummary.Item3.ToString("F");
txtSmrWk2ThuOvertimePay.Text = wk2ThursdaySummary.Item4.ToString("F");
txtSmrWk2FriRegularTime.Text = wk2FridaySummary.Item1.ToString("F");
txtSmrWk2FriOvertime.Text = wk2FridaySummary.Item2.ToString("F");
txtSmrWk2FriRegularPay.Text = wk2FridaySummary.Item3.ToString("F");
txtSmrWk2FriOvertimePay.Text = wk2FridaySummary.Item4.ToString("F");
txtSmrWk2SatRegularTime.Text = wk2SaturdaySummary.Item1.ToString("F");
txtSmrWk2SatOvertime.Text = wk2SaturdaySummary.Item2.ToString("F");
txtSmrWk2SatRegularPay.Text = wk2SaturdaySummary.Item3.ToString("F");
txtSmrWk2SatOvertimePay.Text = wk2SaturdaySummary.Item4.ToString("F");
txtSmrWk2SunRegularTime.Text = wk2SundaySummary.Item1.ToString("F");
txtSmrWk2SunOvertime.Text = wk2SundaySummary.Item2.ToString("F");
txtSmrWk2SunRegularPay.Text = wk2SundaySummary.Item3.ToString("F");
txtSmrWk2SunOvertimePay.Text = wk2SundaySummary.Item4.ToString("F");
double totalTimeWorked = double.Parse(txtTSWk1Monday.Text) + double.Parse(txtTSWk1Tuesday.Text) + double.Parse(txtTSWk1Wednesday.Text) +
double.Parse(txtTSWk1Thursday.Text) + double.Parse(txtTSWk1Friday.Text) + double.Parse(txtTSWk1Saturday.Text) +
double.Parse(txtTSWk1Sunday.Text) + double.Parse(txtTSWk2Monday.Text) + double.Parse(txtTSWk2Tuesday.Text) +
double.Parse(txtTSWk2Wednesday.Text) + double.Parse(txtTSWk2Thursday.Text) + double.Parse(txtTSWk2Friday.Text) +
double.Parse(txtTSWk2Saturday.Text) + double.Parse(txtTSWk2Sunday.Text);
double grossSalary = wk1MondaySummary.Item3 + wk1MondaySummary.Item4 + wk1TuesdaySummary.Item3 + wk1TuesdaySummary.Item4 + wk1WednesdaySummary.Item3 +
wk1WednesdaySummary.Item4 + wk1ThursdaySummary.Item3 + wk1ThursdaySummary.Item4 + wk1FridaySummary.Item3 + wk1FridaySummary.Item4 +
wk1SaturdaySummary.Item3 + wk1SaturdaySummary.Item4 + wk1SundaySummary.Item3 + wk1SundaySummary.Item4 + wk2MondaySummary.Item3 +
wk2MondaySummary.Item4 + wk2TuesdaySummary.Item3 + wk2TuesdaySummary.Item4 + wk2WednesdaySummary.Item3 + wk2WednesdaySummary.Item4 +
wk2ThursdaySummary.Item3 + wk2ThursdaySummary.Item4 + wk2FridaySummary.Item3 + wk2FridaySummary.Item4 + wk2SaturdaySummary.Item3 +
wk2SaturdaySummary.Item4 + wk2SundaySummary.Item3 + wk2SundaySummary.Item4;
txtRegularTime.Text = totalRegularTime.ToString("F");
txtOvertime.Text = totalOvertime.ToString("F");
txtRegularPay.Text = totalRegularPay.ToString("F");
txtOvertimePay.Text = totalOvertimePay.ToString("F");
txtGrossSalary.Text = grossSalary.ToString("F");
}
private void btnCloseClick(object sender, EventArgs e)
{
Close();
}
}
- On the main menu, click File -> New
- When asked whether you want to save, click Save (or Yes)
- Set the Save As Type to All Files
- Set the File Name to PayrollEvaluation2.cs and press Enter
- In the empty document, type:
using System;
using System.IO;
using System.Xml;
using System.Drawing;
using System.Windows.Forms;
public class PayrollSystem : Form
{
private Button btnEmployeesTimeSheet;
private Button btnPayrollSummary1;
private Button btnEmployees;
private Button btnClose;
private Button btnPayrollSummary2;
public PayrollSystem()
{
InitializeComponent();
}
private void InitializeComponent()
{
// Button: Employees Time Sheet
btnEmployeesTimeSheet = new Button();
btnEmployeesTimeSheet.Font = new System.Drawing.Font("Palatino Linotype", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
btnEmployeesTimeSheet.Location = new System.Drawing.Point(23, 27);
btnEmployeesTimeSheet.Size = new System.Drawing.Size(817, 67);
btnEmployeesTimeSheet.Text = "Employees Time Sheet ...";
btnEmployeesTimeSheet.Click += new EventHandler(btnEmployeesTimeSheetClick);
Controls.Add(btnEmployeesTimeSheet);
// Button: Payroll Summary 1
btnPayrollSummary1 = new Button();
btnPayrollSummary1.Font = new System.Drawing.Font("Palatino Linotype", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
btnPayrollSummary1.Location = new System.Drawing.Point(23, 114);
btnPayrollSummary1.Size = new System.Drawing.Size(400, 67);
btnPayrollSummary1.Text = "Payroll System 1 ...";
btnPayrollSummary1.Click += new EventHandler(btnPayrollSummaryClick);
Controls.Add(btnPayrollSummary1);
// Button: Employees
btnEmployees = new Button();
btnEmployees.Font = new System.Drawing.Font("Palatino Linotype", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
btnEmployees.Location = new System.Drawing.Point(23, 204);
btnEmployees.Size = new System.Drawing.Size(400, 67);
btnEmployees.Text = "Employees ...";
btnEmployees.Click += new EventHandler(btnEmployeesClick);
Controls.Add(btnEmployees);
// Button: PayrollSummary2
btnPayrollSummary2 = new Button();
btnPayrollSummary2.Font = new System.Drawing.Font("Palatino Linotype", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
btnPayrollSummary2.Location = new System.Drawing.Point(440, 114);
btnPayrollSummary2.Size = new System.Drawing.Size(400, 67);
btnPayrollSummary2.Text = "Payroll System 2 ...";
btnPayrollSummary2.Click += new EventHandler(btnPayrollSummary2Click);
Controls.Add(btnPayrollSummary2);
// Button: Close
btnClose = new Button();
btnClose.Font = new System.Drawing.Font("Palatino Linotype", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
btnClose.Location = new System.Drawing.Point(440, 204);
btnClose.Size = new System.Drawing.Size(400, 67);
btnClose.Text = "Close";
btnClose.Click += new EventHandler(btnCloseClick);
Controls.Add(btnClose);
// Form: Payroll System
ClientSize = new System.Drawing.Size(863, 298);
MaximizeBox = false;
StartPosition = FormStartPosition.CenterScreen;
Text = "Fun Department Store - Payroll System";
Load += new EventHandler(PayrollSystemLoad);
}
private void PayrollSystemLoad(object sender, EventArgs e)
{
Directory.CreateDirectory(@"C:\Fun Department Store - Payroll");
}
private void btnEmployeesTimeSheetClick(object sender, EventArgs e)
{
TimeSheet ts = new TimeSheet();
ts.ShowDialog();
}
private void btnPayrollSummaryClick(object sender, EventArgs e)
{
PayrollSummary1 ps = new PayrollSummary1();
ps.Show();
}
private void btnPayrollSummary2Click(object sender, EventArgs e)
{
PayrollSummary2 ps = new PayrollSummary2();
ps.Show();
}
private void btnEmployeesClick(object sender, EventArgs e)
{
Employees clerks = new Employees();
clerks.Show();
}
private void btnCloseClick(object sender, EventArgs e)
{
Close();
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new PayrollSystem());
}
}
- On the main menu, click File -> New
- When asked whether you want to save, click Save (or Yes)
- Set the Save As Type to All Files
- Set the File Name to TimeSheetCalculations.cs and press Enter
- If you want to build the application, start the Command Prompt
(Start -> (All) Programs -> Accessories -> Command Prompt)
- Type CD\ and press Enter
- Type CD TimeSheetCalculations and press Enter
- Type C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc /t:winexe
TimeSheetCaculations.cs Employee.cs Employees.cs TimeSheet.cs
PayrollSummary1.cs PayrollSummary2.cs and press Enter
- If you want to execute the application, type PayrollSystem
and press Enter
- If you want to test the application, click the Employees button to
open its form
- Click the New Employee button:
- Create a few employees records as follows:
Employee # |
First Name |
Last Name |
Hourly Salary |
283749 |
Catherine |
Watts |
38.85 |
837405 |
Herbert |
Mann |
14.75 |
428041 |
Jeanine |
Hewsen |
34.05 |
952748 |
David |
Evans |
17.25 |
606384 |
Robert |
Gibson |
22.25 |
172847 |
Carl |
Lowry |
26.85 |
- Close the Employees
- Open the TimeSheet form:
- Close the Employees form
- Click the Employees Time Sheet
|
|