Home

Example Application: A Time Sheet

     

Introduction

A time sheet is a dialog box or a form on which employees record the time they have worked. Most companies use a two-week schedule. In most cases, an employee records the time one week at a time.

If you create an application for a time sheet, of course there are various ways you can implement it, depending on what the company or its accounting department wants. For our simple example, we will first let a user enter his employee number and the starting date of the time sheet. Based on these two pieces of information, we will check whether the employee had previously entered or started a time sheet for that time frame. If that’s the case, we will open that time sheet and display its record. If there is no time recorded for the employee in that time frame, we will let the user create a new time sheet.

The Employees

Obviously the primary users of a time sheet are the employees. A company may need a lot of information from employees but in most cases, an employee number and the name of the employee are enough.

Practical LearningPractical Learning: Introducing a Time Sheet

  1. Start Notepad or any text editor of your choice
  2. Type the following code:
    using System;
    using System.Drawing;
    using System.Windows.Forms;
    
    public class Employee : Form
    {
        private Label lblFirstName;
        public TextBox txtFirstName;
        private Label lblLastName;
        public TextBox txtLastName;
        private Label lblEmployeeNumber;
        public TextBox txtEmployeeNumber;
        private Label lblHourlySalary;
        public TextBox txtHourlySalary;
        private Button btnOK;
        private Button btnCancel;
    
        public Employee()
        {
            InitializeComponent();
        }
    
        private void InitializeComponent()
        {
            // Label: First Name
            lblFirstName = new Label();
            lblFirstName.AutoSize = true;
            lblFirstName.Location = new System.Drawing.Point(18, 26);
            lblFirstName.TabIndex = 4;
            lblFirstName.Text = "First Name:";
            Controls.Add(lblFirstName);
    
            // Text Box: First Name
            txtFirstName = new TextBox();
            txtFirstName.Location = new System.Drawing.Point(96, 23);
            txtFirstName.Size = new System.Drawing.Size(88, 20);
            txtFirstName.TabIndex = 5;
            Controls.Add(txtFirstName);
    
            // Label: LastName
            lblLastName = new Label();
            lblLastName.AutoSize = true;
            lblLastName.Location = new System.Drawing.Point(200, 26);
            lblLastName.TabIndex = 6;
            lblLastName.Text = "Last Name:";
            Controls.Add(lblLastName);
    
            // Text Box: LastName
            txtLastName = new TextBox();
            txtLastName.Location = new System.Drawing.Point(281, 23);
            txtLastName.Size = new System.Drawing.Size(88, 20);
            txtLastName.TabIndex = 7;
            Controls.Add(txtLastName);
    
            // Label: Hourly Salary
            lblHourlySalary = new Label();
            lblHourlySalary.AutoSize = true;
            lblHourlySalary.Location = new System.Drawing.Point(18, 61);
            lblHourlySalary.TabIndex = 20;
            lblHourlySalary.Text = "Hourly Salary:";
            Controls.Add(lblHourlySalary);
    
            // Text Box: Hourly Salary
            txtHourlySalary = new TextBox();
            txtHourlySalary.Location = new System.Drawing.Point(96, 58);
            txtHourlySalary.Size = new System.Drawing.Size(88, 20);
            txtHourlySalary.TabIndex = 21;
            Controls.Add(txtHourlySalary);
    
            // Label: Employee Number
            lblEmployeeNumber = new Label();
            lblEmployeeNumber.AutoSize = true;
            lblEmployeeNumber.Location = new System.Drawing.Point(200, 61);
            lblEmployeeNumber.Size = new System.Drawing.Size(66, 13);
            lblEmployeeNumber.TabIndex = 23;
            lblEmployeeNumber.Text = "Employee #:";
            Controls.Add(lblEmployeeNumber);
    
            // Text Box: Employee Number
            txtEmployeeNumber = new TextBox();
            txtEmployeeNumber.Location = new System.Drawing.Point(281, 58);
            txtEmployeeNumber.Size = new System.Drawing.Size(88, 20);
            txtEmployeeNumber.TabIndex = 24;
            Controls.Add(txtEmployeeNumber);
    
            // Button: OK
            btnOK = new Button();
            btnOK.DialogResult = DialogResult.OK;
            btnOK.Location = new System.Drawing.Point(198, 96);
            btnOK.Size = new System.Drawing.Size(75, 23);
            btnOK.TabIndex = 25;
            btnOK.Text = "OK";
            Controls.Add(btnOK);
    
            // Button: Cancel
            btnCancel = new Button();
            btnCancel.DialogResult = DialogResult.Cancel;
            btnCancel.Location = new System.Drawing.Point(294, 96);
            btnCancel.Size = new System.Drawing.Size(75, 23);
            btnCancel.TabIndex = 26;
            btnCancel.Text = "Cancel";
            Controls.Add(btnCancel);
    
            // Dialog Box: Employee
            AcceptButton = this.btnOK;
            CancelButton = this.btnCancel;
            ClientSize = new System.Drawing.Size(389, 139);
            FormBorderStyle = FormBorderStyle.FixedDialog;
            MaximizeBox = false;
            MinimizeBox = false;
            ShowInTaskbar = false;
            StartPosition = FormStartPosition.CenterScreen;
            Text = "Fun Department Store - New Employee";
        }
    }
  3. On the main menu, click File -> New
  4. When asked whether you want to save, click Save (or Yes)
  5. Display the C: drive in the top combo box
  6. Click New Folder
  7. Type TimeSheetCalculations and press Enter twice to display the new folder in the top combo box
  8. Set the Save As Type to All Files
  9. Set the File Name to Employee.cs and press Enter
  10. In the empty document, type the following code:
    using System;
    using System.IO;
    using System.Xml;
    using System.Drawing;
    using System.Windows.Forms;
    
    public class Employees : Form
    {
        private ListView lvwEmployees;
        private ColumnHeader colEmployeeNumber;
        private ColumnHeader colFirstName;
        private ColumnHeader colLastName;
        private ColumnHeader colHourlySalary;
        private TextBox txtNumberOfEmployees;
        private Label lblNumberOfEmployees;
        private Button btnNewEmployee;
        private Button btnClose;
    
        public Employees()
        {
            InitializeComponent();
        }
    
        private void InitializeComponent()
        {
            // Form: Employees
            ClientSize = new System.Drawing.Size(342, 185);
    
            // Column: Employee Number
            colEmployeeNumber = new ColumnHeader();
            colEmployeeNumber.Text = "Employee #";
            colEmployeeNumber.Width = 70;
    
            // Column: First Name 
            colFirstName = new ColumnHeader();
            colFirstName.Text = "First Name";
            colFirstName.Width = 65;
    
            // Column: Last Name
            colLastName = new ColumnHeader();
            colLastName.Text = "Last Name";
            colLastName.Width = 70;
    
            // Column: Hourly Salary
            colHourlySalary = new ColumnHeader();
            colHourlySalary.Text = "Hourly Salary";
            colHourlySalary.TextAlign = HorizontalAlignment.Right;
            colHourlySalary.Width = 75;
    
            // List View: Employees
            lvwEmployees = new ListView();
            lvwEmployees.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            lvwEmployees.Columns.AddRange(new ColumnHeader[] { colEmployeeNumber, colFirstName, colLastName, colHourlySalary});
            lvwEmployees.FullRowSelect = true;
            lvwEmployees.GridLines = true;
            lvwEmployees.Location = new System.Drawing.Point(19, 12);
            lvwEmployees.Size = new System.Drawing.Size(307, 125);
            lvwEmployees.View = View.Details;
            Controls.Add(lvwEmployees);
    
            // Label: Number of Employees
            lblNumberOfEmployees = new Label();
            lblNumberOfEmployees.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
            lblNumberOfEmployees.AutoSize = true;
            lblNumberOfEmployees.Location = new System.Drawing.Point(16, 155);
            lblNumberOfEmployees.Text = "Count:";
            Controls.Add(lblNumberOfEmployees);
    
            // Text Box: Number of Employees
            txtNumberOfEmployees = new TextBox();
            txtNumberOfEmployees.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
            txtNumberOfEmployees.Location = new System.Drawing.Point(60, 152);
            txtNumberOfEmployees.Size = new System.Drawing.Size(60, 20);
            txtNumberOfEmployees.TabIndex = 35;
            txtNumberOfEmployees.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtNumberOfEmployees);
    
            // Button: New Employee
            btnNewEmployee = new Button();
            btnNewEmployee.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
            btnNewEmployee.Location = new System.Drawing.Point(136, 150);
            btnNewEmployee.Size = new System.Drawing.Size(109, 23);
            btnNewEmployee.Text = "New Employee ...";
            btnNewEmployee.Click += new EventHandler(btnNewEmployeeClick);
            Controls.Add(btnNewEmployee);
    
            // Button: Close
            btnClose = new Button();
            btnClose.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
            btnClose.Location = new System.Drawing.Point(251, 150);
            btnClose.Size = new System.Drawing.Size(75, 23);
            btnClose.Text = "Close";
            btnClose.Click += new EventHandler(btnCloseClick);
            Controls.Add(btnClose);
    
            // Form: Employees
            MaximizeBox = false;
            StartPosition = FormStartPosition.CenterScreen;
            Text = "Fun Department Store - Employees";
            Load += new EventHandler(EmployeesLoad);
        }
    
        private void ShowEmployees()
        {
            XmlDocument xdEmployees = new XmlDocument();
            string strEmployeesFile = @"C:\Fun Department Store - Payroll\Employees.xml";
    
            if (File.Exists(strEmployeesFile))
            {
                lvwEmployees.Items.Clear();
                xdEmployees.Load(strEmployeesFile);
    
                XmlElement xeEmployee = xdEmployees.DocumentElement;
                XmlNodeList xnlEmployees = xeEmployee.ChildNodes;
    
                foreach (XmlNode xnEmployee in xnlEmployees)
                {
                    ListViewItem lviEmployee = new ListViewItem(xnEmployee.FirstChild.InnerText); // Employee Number
    
                    lviEmployee.SubItems.Add(xnEmployee.FirstChild.NextSibling.InnerText); // First Name
                    lviEmployee.SubItems.Add(xnEmployee.FirstChild.NextSibling.NextSibling.InnerText); // Last Name
                    lviEmployee.SubItems.Add(xnEmployee.FirstChild.NextSibling.NextSibling.NextSibling.InnerText); // Hourly Salary
    
                    lvwEmployees.Items.Add(lviEmployee);
                }
    
                txtNumberOfEmployees.Text = xnlEmployees.Count.ToString();
            }
        }
    
        private void EmployeesLoad(object sender, EventArgs e)
        {
            ShowEmployees();
        }
    
        private void btnNewEmployeeClick(object sender, EventArgs e)
        {
            Employee empl = new Employee();
            XmlDocument xdEmployees = new XmlDocument();
            string strEmployeesFile = @"C:\Fun Department Store - Payroll\Employees.xml";
    
            if (empl.ShowDialog() == DialogResult.OK)
            {
                if (!File.Exists(strEmployeesFile))
                {
                    xdEmployees.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                                        "<Employees></Employees>");
                    xdEmployees.Save(strEmployeesFile);
                }
    
                xdEmployees.Load(strEmployeesFile);
    
                XmlElement elmXML = xdEmployees.CreateElement("Employee");
                // Create the XML code of the child element of Employee
                string strNewEmployee = "<EmployeeNumber>" + empl.txtEmployeeNumber.Text + "</EmployeeNumber>" +
                                        "<FirstName>" + empl.txtFirstName.Text + "</FirstName>" +
                                        "<LastName>" + empl.txtLastName.Text + "</LastName>" +
                                        "<HourlySalary>" + empl.txtHourlySalary.Text + "</HourlySalary>";
                elmXML.InnerXml = strNewEmployee;
                // Append the new element as a child of employees
                xdEmployees.DocumentElement.AppendChild(elmXML);
    
                // Save the XML file
                xdEmployees.Save(strEmployeesFile);
    
                ShowEmployees();
            }
        }
    
        private void btnCloseClick(object sender, EventArgs e)
        {
            Close();
        }
    }
  11. On the main menu, click File -> New
  12. When asked whether you want to save, click Save (or Yes)
  13. Set the Save As Type to All Files
  14. Set the File Name to Employees.cs and press Enter

Creating a Time Sheet

As far as a database is concerned, a time sheet is a list that contains some information about the employees and the time they workd. In most cases, the basic information about an employee is just what is enough to identify the employee. This should be a piece of informatiion that uniquely identify each emmployee. For most businesses, this is done through an employee number. The time worked is registered for each day from 0 to 24. Most companies also allow fractions of an hour, usually as half an hour. Some (rare) companies also consider time in fractions of quarters (.25,.50, and .75).

After an employee has filled her time sheet, she can click a button such as Submit, OK, or Apply.

Most companies require that each employee enter the time worked at the end of the day, and most of the time, the employee registers the time worked for one day at a time, or for only that day. To address this issue, after an employee has entered his employee number and the start date of the time sheet, we will check if the employee had previously entered time for at least one day based on the employee number and the start date. If we find such a record, we will open that time sheet and let the user update it. If we don't find a time sheet with that information, we will consider that the employee has filling a new time sheet.

Practical LearningPractical Learning: Introducing a Time Sheet

  1. In the empty document, type the following code:
    using System;
    using System.IO;
    using System.Xml;
    using System.Drawing;
    using System.Windows.Forms;
    
    public class TimeSheet : Form
    {
        private Label lblEmployeeNumber;
        private TextBox txtEmployeeNumber;
        private TextBox txtEmployeeName;
        private Label lblStartDate;
        private DateTimePicker dtpStartDate;
        private Label lblEndDate;
        private TextBox txtEndDate;
        private Label lblLine1;
        private Label lblMonday;
        private Label lblTuesday;
        private Label lblWednesday;
        private Label lblThursday;
        private Label lblFriday;
        private Label lblSaturday;
        private Label lblSunday;
        private Label lblWeek1;
        private TextBox txtWeek1Monday;
        private TextBox txtWeek1Tuesday;
        private TextBox txtWeek1Wednesday;
        private TextBox txtWeek1Thursday;
        private TextBox txtWeek1Friday;
        private TextBox txtWeek1Saturday;
        private TextBox txtWeek1Sunday;
        private Label lblWeek2;
        private TextBox txtWeek2Monday;
        private TextBox txtWeek2Tuesday;
        private TextBox txtWeek2Wednesday;
        private TextBox txtWeek2Thursday;
        private TextBox txtWeek2Friday;
        private TextBox txtWeek2Saturday;
        private TextBox txtWeek2Sunday;
        private Label lblLine2;
        private Label lblTimeSheetID;
        private TextBox txtTimeSheetID;
        private Button btnUpdate;
        private Button btnSubmit;
        private Button btnClose;
    
        public TimeSheet()
        {
            InitializeComponent();
        }
        private void InitializeComponent()
        {
            // Label: Employee Number
            lblEmployeeNumber = new Label();
            lblEmployeeNumber.AutoSize = true;
            lblEmployeeNumber.Location = new System.Drawing.Point(14, 20);
            lblEmployeeNumber.TabIndex = 331;
            lblEmployeeNumber.Text = "Employee #:";
            Controls.Add(lblEmployeeNumber);
    
            // Text Box: EmployeeNumber
            txtEmployeeNumber = new TextBox();
            txtEmployeeNumber.Location = new System.Drawing.Point(98, 14);
            txtEmployeeNumber.Size = new System.Drawing.Size(64, 20);
            txtEmployeeNumber.TabIndex = 332;
            txtEmployeeNumber.Leave += new EventHandler(txtEmployeeNumberLeave);
            Controls.Add(txtEmployeeNumber);
    
            // Text Box: Employee Name
            txtEmployeeName = new TextBox();
            txtEmployeeName.Location = new System.Drawing.Point(168, 14);
            txtEmployeeName.Size = new System.Drawing.Size(130, 20);
            txtEmployeeName.TabIndex = 363;
            Controls.Add(txtEmployeeName);
    
            // Label: Start Date
            lblStartDate = new Label();
            lblStartDate.AutoSize = true;
            lblStartDate.Location = new System.Drawing.Point(14, 51);
            lblStartDate.TabIndex = 333;
            lblStartDate.Text = "Start Date:";
            Controls.Add(lblStartDate);
    
            // Date/Time Picker: Start Date
            dtpStartDate = new DateTimePicker();
            dtpStartDate.Location = new System.Drawing.Point(98, 45);
            dtpStartDate.Size = new System.Drawing.Size(200, 20);
            dtpStartDate.TabIndex = 364;
            dtpStartDate.CloseUp += new EventHandler(dtpStartDateCloseUp);
            Controls.Add(dtpStartDate);
    
            // Label: End Date
            lblEndDate = new Label();
            lblEndDate.AutoSize = true;
            lblEndDate.Location = new System.Drawing.Point(314, 51);
            lblEndDate.TabIndex = 334;
            lblEndDate.Text = "End Date:";
            Controls.Add(lblEndDate);
    
            // Text Box: End Date
            txtEndDate = new TextBox();
            txtEndDate.Location = new System.Drawing.Point(379, 45);
            txtEndDate.Size = new System.Drawing.Size(75, 20);
            txtEndDate.TabIndex = 365;
            Controls.Add(txtEndDate);
    
            // Label: Line 1
            lblLine1 = new Label();
            lblLine1.AutoSize = true;
            lblLine1.Location = new System.Drawing.Point(13, 79);
            lblLine1.TabIndex = 336;
            lblLine1.Text = "--------------------------------------------------------------------------------------------------------------------------------------------------------------";
            Controls.Add(lblLine1);
    
            // Label: Monday
            lblMonday = new Label();
            lblMonday.AutoSize = true;
            lblMonday.Location = new System.Drawing.Point(95, 101);
            lblMonday.TabIndex = 340;
            lblMonday.Text = "Monday";
            Controls.Add(lblMonday);
    
            // Label: Tuesday
            lblTuesday = new Label();
            lblTuesday.AutoSize = true;
            lblTuesday.Location = new System.Drawing.Point(152, 101);
            lblTuesday.TabIndex = 341;
            lblTuesday.Text = "Tuesday";
            Controls.Add(lblTuesday);
    
            // Label: Wednesday
            lblWednesday = new Label();
            lblWednesday.AutoSize = true;
            lblWednesday.Location = new System.Drawing.Point(206, 101);
            lblWednesday.TabIndex = 342;
            lblWednesday.Text = "Wednesday";
            Controls.Add(lblWednesday);
    
            // Label: Thursday
            lblThursday = new Label();
            lblThursday.AutoSize = true;
            lblThursday.Location = new System.Drawing.Point(270, 101);
            lblThursday.TabIndex = 343;
            lblThursday.Text = "Thursday";
            Controls.Add(lblThursday);
    
            // Label: Friday
            lblFriday = new Label();
            lblFriday.AutoSize = true;
            lblFriday.Location = new System.Drawing.Point(325, 101);
            lblFriday.TabIndex = 344;
            lblFriday.Text = "Friday";
            Controls.Add(lblFriday);
    
            // Label: Saturday
            lblSaturday = new Label();
            lblSaturday.AutoSize = true;
            lblSaturday.Location = new System.Drawing.Point(382, 101);
            lblSaturday.TabIndex = 345;
            lblSaturday.Text = "Saturday";
            Controls.Add(lblSaturday);
    
            // Label: Sunday
            lblSunday = new Label();
            lblSunday.AutoSize = true;
            lblSunday.Location = new System.Drawing.Point(437, 101);
            lblSunday.TabIndex = 346;
            lblSunday.Text = "Sunday";
            Controls.Add(lblSunday);
    
            // Label: Week 1
            lblWeek1 = new Label();
            lblWeek1.AutoSize = true;
            lblWeek1.Location = new System.Drawing.Point(14, 127);
            lblWeek1.TabIndex = 361;
            lblWeek1.Text = "Week 1:";
            Controls.Add(lblWeek1);
    
            // Text Box: Week 1 - Monday
            txtWeek1Monday = new TextBox();
            txtWeek1Monday.Location = new System.Drawing.Point(98, 124);
            txtWeek1Monday.Size = new System.Drawing.Size(51, 20);
            txtWeek1Monday.TabIndex = 347;
            txtWeek1Monday.Text = "0.00";
            txtWeek1Monday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek1Monday);
    
            // Text Box: Week 1 - Tuesday
            txtWeek1Tuesday = new TextBox();
            txtWeek1Tuesday.Location = new System.Drawing.Point(155, 124);
            txtWeek1Tuesday.Size = new System.Drawing.Size(51, 20);
            txtWeek1Tuesday.TabIndex = 348;
            txtWeek1Tuesday.Text = "0.00";
            txtWeek1Tuesday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek1Tuesday);
    
            // Text Box: Week 1 - Wednesday
            txtWeek1Wednesday = new TextBox();
            txtWeek1Wednesday.Location = new System.Drawing.Point(212, 124);
            txtWeek1Wednesday.Size = new System.Drawing.Size(51, 20);
            txtWeek1Wednesday.TabIndex = 349;
            txtWeek1Wednesday.Text = "0.00";
            txtWeek1Wednesday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek1Wednesday);
    
            // Text Box: Week 1 - Thursday
            txtWeek1Thursday = new TextBox();
            txtWeek1Thursday.Location = new System.Drawing.Point(269, 124);
            txtWeek1Thursday.Size = new System.Drawing.Size(51, 20);
            txtWeek1Thursday.TabIndex = 350;
            txtWeek1Thursday.Text = "0.00";
            txtWeek1Thursday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek1Thursday);
    
            // Text Box: Week 1 - Friday
            txtWeek1Friday = new TextBox();
            txtWeek1Friday.Location = new System.Drawing.Point(326, 124);
            txtWeek1Friday.Size = new System.Drawing.Size(51, 20);
            txtWeek1Friday.TabIndex = 351;
            txtWeek1Friday.Text = "0.00";
            txtWeek1Friday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek1Friday);
    
            // Text Box: Week 1 - Saturday
            txtWeek1Saturday = new TextBox();
            txtWeek1Saturday.Location = new System.Drawing.Point(383, 124);
            txtWeek1Saturday.Name = "txtWeek1Saturday";
            txtWeek1Saturday.Size = new System.Drawing.Size(51, 20);
            txtWeek1Saturday.TabIndex = 352;
            txtWeek1Saturday.Text = "0.00";
            txtWeek1Saturday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek1Saturday);
    
            // Text Box: Week 1 - Sunday
            txtWeek1Sunday = new TextBox();
            txtWeek1Sunday.Location = new System.Drawing.Point(440, 124);
            txtWeek1Sunday.Name = "txtWeek1Sunday";
            txtWeek1Sunday.Size = new System.Drawing.Size(51, 20);
            txtWeek1Sunday.TabIndex = 353;
            txtWeek1Sunday.Text = "0.00";
            txtWeek1Sunday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek1Sunday);
    
            // Label: Week 2
            lblWeek2 = new Label();
            lblWeek2.AutoSize = true;
            lblWeek2.Location = new System.Drawing.Point(14, 153);
            lblWeek2.TabIndex = 362;
            lblWeek2.Text = "Week 2:";
            Controls.Add(lblWeek2);
    
            // Text Box: Week 2 - Monday
            txtWeek2Monday = new TextBox();
            txtWeek2Monday.Location = new System.Drawing.Point(98, 150);
            txtWeek2Monday.Size = new System.Drawing.Size(51, 20);
            txtWeek2Monday.TabIndex = 354;
            txtWeek2Monday.Text = "0.00";
            txtWeek2Monday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek2Monday);
    
            // Text Box: Week 2 - Tuesday
            txtWeek2Tuesday = new TextBox();
            txtWeek2Tuesday.Location = new System.Drawing.Point(155, 150);
            txtWeek2Tuesday.Size = new System.Drawing.Size(51, 20);
            txtWeek2Tuesday.TabIndex = 355;
            txtWeek2Tuesday.Text = "0.00";
            txtWeek2Tuesday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek2Tuesday);
    
            // Text Box: Week 2 - Wednesday
            txtWeek2Wednesday = new TextBox();
            txtWeek2Wednesday.Location = new System.Drawing.Point(212, 150);
            txtWeek2Wednesday.Size = new System.Drawing.Size(51, 20);
            txtWeek2Wednesday.TabIndex = 356;
            txtWeek2Wednesday.Text = "0.00";
            txtWeek2Wednesday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek2Wednesday);
    
            // Text Box: Week 2 - Thursday
            txtWeek2Thursday = new TextBox();
            txtWeek2Thursday.Location = new System.Drawing.Point(269, 150);
            txtWeek2Thursday.Size = new System.Drawing.Size(51, 20);
            txtWeek2Thursday.TabIndex = 357;
            txtWeek2Thursday.Text = "0.00";
            txtWeek2Thursday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek2Thursday);
    
            // Text Box: Week 2 - Friday
            txtWeek2Friday = new TextBox();
            txtWeek2Friday.Location = new System.Drawing.Point(326, 150);
            txtWeek2Friday.Size = new System.Drawing.Size(51, 20);
            txtWeek2Friday.TabIndex = 358;
            txtWeek2Friday.Text = "0.00";
            txtWeek2Friday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek2Friday);
    
            // Text Box: Week 2 - Saturday
            txtWeek2Saturday = new TextBox();
            txtWeek2Saturday.Location = new System.Drawing.Point(383, 150);
            txtWeek2Saturday.Size = new System.Drawing.Size(51, 20);
            txtWeek2Saturday.TabIndex = 359;
            txtWeek2Saturday.Text = "0.00";
            txtWeek2Saturday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek2Saturday);
    
            // Text Box: Week 2 - Sunday
            txtWeek2Sunday = new TextBox();
            txtWeek2Sunday.Location = new System.Drawing.Point(440, 150);
            txtWeek2Sunday.Size = new System.Drawing.Size(51, 20);
            txtWeek2Sunday.TabIndex = 360;
            txtWeek2Sunday.Text = "0.00";
            txtWeek2Sunday.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtWeek2Sunday);
    
            // Label: Line 2
            lblLine2 = new Label();
            lblLine2.AutoSize = true;
            lblLine2.Location = new System.Drawing.Point(13, 181);
            lblLine2.TabIndex = 335;
            lblLine2.Text = "---------------------------------------------------------------------------------------------------------------------------------------------------------------";
            Controls.Add(lblLine2);
    
            // Label: Time Sheet ID
            lblTimeSheetID = new Label();
            lblTimeSheetID.AutoSize = true;
            lblTimeSheetID.Location = new System.Drawing.Point(14, 211);
            lblTimeSheetID.TabIndex = 366;
            lblTimeSheetID.Text = "Time Sheet #:";
            Controls.Add(lblTimeSheetID);
    
            // Text Box: TimeSheetID
            txtTimeSheetID = new TextBox();
            txtTimeSheetID.Location = new System.Drawing.Point(98, 208);
            txtTimeSheetID.Size = new System.Drawing.Size(80, 20);
            txtTimeSheetID.TabIndex = 367;
            txtTimeSheetID.Text = "1001";
            Controls.Add(txtTimeSheetID);
    
            // Button: Update
            btnUpdate = new Button();
            btnUpdate.Location = new System.Drawing.Point(199, 205);
            btnUpdate.Size = new System.Drawing.Size(75, 23);
            btnUpdate.TabIndex = 337;
            btnUpdate.Text = "Update";
            btnUpdate.Click += new EventHandler(btnUpdateClick);
            Controls.Add(btnUpdate);
    
            // Button: Submit
            btnSubmit = new Button();
            btnSubmit.Location = new System.Drawing.Point(328, 205);
            btnSubmit.Size = new System.Drawing.Size(75, 23);
            btnSubmit.TabIndex = 338;
            btnSubmit.Text = "Submit";
            btnSubmit.Click += new EventHandler(btnSubmitClick);
            Controls.Add(btnSubmit);
    
            // Button: Close
            btnClose = new Button();
            btnClose.Location = new System.Drawing.Point(416, 205);
            btnClose.Size = new System.Drawing.Size(75, 23);
            btnClose.TabIndex = 339;
            btnClose.Text = "Close";
            btnClose.Click += new EventHandler(btnCloseClick);
            Controls.Add(btnClose);
    
            // Form: Time Sheet
            ClientSize = new System.Drawing.Size(510, 243);
            MaximizeBox = false;
            StartPosition = FormStartPosition.CenterScreen;
            Text = "Fun Department Store: Employee - New Time Sheet";
            Load += new EventHandler(TimeSheetLoad);
        }
    
        private void TimeSheetLoad(object sender, EventArgs e)
        {
            int iTimeSheetID = 1000;
    
            XmlDocument xdTimeSheets = new XmlDocument();
            string strTimeSheetsFile = @"C:\Fun Department Store - Payroll\TimeSheets.xml";
    
            if (File.Exists(strTimeSheetsFile))
            {
                xdTimeSheets.Load(strTimeSheetsFile);
    
                XmlElement xeTimeSheet = xdTimeSheets.DocumentElement;
                XmlNodeList xnlTimeSheets = xdTimeSheets.DocumentElement.SelectNodes("/TimeSheets/TimeSheet/TimeSheetID");
    
                foreach (XmlNode xnTimeSheet in xnlTimeSheets)
                {
                    iTimeSheetID = int.Parse(xnTimeSheet.InnerText);
                }
            }
    
            txtTimeSheetID.Text = (iTimeSheetID + 1).ToString();
    
            btnUpdate.Visible = false;
        }
    
        private void txtEmployeeNumberLeave(object sender, EventArgs e)
        {
            XmlDocument xdEmployees = new XmlDocument();
            string strEmployeesFile = @"C:\Fun Department Store - Payroll\Employees.xml";
    
            if (File.Exists(strEmployeesFile))
            {
                xdEmployees.Load(strEmployeesFile);
    
                XmlElement xeEmployee = xdEmployees.DocumentElement;
                XmlNodeList xnlEmployees = xdEmployees.DocumentElement.SelectNodes("/Employees/Employee/EmployeeNumber[.='" + txtEmployeeNumber.Text + "']");
    
                foreach (XmlNode xnEmployee in xnlEmployees)
                {
                    txtEmployeeName.Text = xnEmployee.NextSibling.InnerText + " " + xnEmployee.NextSibling.NextSibling.InnerText;
                }
    
                txtWeek1Monday.Text = "0.00";
                txtWeek1Tuesday.Text = "0.00";
                txtWeek1Wednesday.Text = "0.00";
                txtWeek1Thursday.Text = "0.00";
                txtWeek1Friday.Text = "0.00";
                txtWeek1Saturday.Text = "0.00";
                txtWeek1Sunday.Text = "0.00";
                txtWeek2Monday.Text = "0.00";
                txtWeek2Tuesday.Text = "0.00";
                txtWeek2Wednesday.Text = "0.00";
                txtWeek2Thursday.Text = "0.00";
                txtWeek2Friday.Text = "0.00";
                txtWeek2Saturday.Text = "0.00";
                txtWeek2Sunday.Text = "0.00";
            }
        }
    
        private void dtpStartDateCloseUp(object sender, EventArgs e)
        {
            XmlDocument xdTimeSheets = new XmlDocument();
            string strTimeSheetsFile = @"C:\Fun Department Store - Payroll\TimeSheets.xml";
    
            DateTime dtStartDate = dtpStartDate.Value;
            txtEndDate.Text = dtStartDate.AddDays(13).ToShortDateString();
    
            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;
                            txtWeek1Monday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek1Tuesday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek1Wednesday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek1Thursday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek1Friday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek1Saturday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek1Sunday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
    
                            txtWeek2Monday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek2Tuesday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek2Wednesday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek2Thursday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek2Friday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek2Saturday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
                            txtWeek2Sunday.Text = double.Parse(xnTimeSheet.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.NextSibling.InnerText).ToString("F");
    
                            btnUpdate.Visible = true;
                            btnSubmit.Visible = false;
                        }
                    }
                }
            }
        }
    
        private void btnUpdateClick(object sender, EventArgs e)
        {
            XmlDocument xdTimeSheets = new XmlDocument();
            string strTimeSheetsFile = @"C:\Fun Department Store - Payroll\TimeSheets.xml";
    
            using (FileStream fsTimeSheets = new FileStream(strTimeSheetsFile, FileMode.Open, FileAccess.Read))
            {
                xdTimeSheets.Load(fsTimeSheets);
    
                XmlNodeList xnlTimeSheets = xdTimeSheets.GetElementsByTagName("TimeSheetID");
    
                foreach (XmlNode xnTimeSheet in xnlTimeSheets)
                {
                    if (xnTimeSheet.InnerText == txtTimeSheetID.Text)
                    {
                        xnTimeSheet.ParentNode.InnerXml = "<TimeSheetID>" + int.Parse(txtTimeSheetID.Text) + "</TimeSheetID>" +
                                                          "<EmployeeNumber>" + txtEmployeeNumber.Text + "</EmployeeNumber>" +
                                                          "<StartDate>" + dtpStartDate.Value.ToShortDateString() + "</StartDate>" +
                                                          "<Week1Monday>" + double.Parse(txtWeek1Monday.Text) + "</Week1Monday>" +
                                                          "<Week1Tuesday>" + double.Parse(txtWeek1Tuesday.Text) + "</Week1Tuesday>" +
                                                          "<Week1Wednesday>" + double.Parse(txtWeek1Wednesday.Text) + "</Week1Wednesday>" +
                                                          "<Week1Thursday>" + double.Parse(txtWeek1Thursday.Text) + "</Week1Thursday>" +
                                                          "<Week1Friday>" + double.Parse(txtWeek1Friday.Text) + "</Week1Friday>" +
                                                          "<Week1Saturday>" + double.Parse(txtWeek1Saturday.Text) + "</Week1Saturday>" +
                                                          "<Week1Sunday>" + double.Parse(txtWeek1Sunday.Text) + "</Week1Sunday>" +
                                                          "<Week2Monday>" + double.Parse(txtWeek2Monday.Text) + "</Week2Monday>" +
                                                          "<Week2Tuesday>" + double.Parse(txtWeek2Tuesday.Text) + "</Week2Tuesday>" +
                                                          "<Week2Wednesday>" + double.Parse(txtWeek2Wednesday.Text) + "</Week2Wednesday>" +
                                                          "<Week2Thursday>" + double.Parse(txtWeek2Thursday.Text) + "</Week2Thursday>" +
                                                          "<Week2Friday>" + double.Parse(txtWeek2Friday.Text) + "</Week2Friday>" +
                                                          "<Week2Saturday>" + double.Parse(txtWeek2Saturday.Text) + "</Week2Saturday>" +
                                                          "<Week2Sunday>" + double.Parse(txtWeek2Sunday.Text) + "</Week2Sunday>";
                        break;
                    }
                }
            }
    
            using (FileStream fsTimeSheets = new FileStream(strTimeSheetsFile, FileMode.Create, FileAccess.Write))
            {
                xdTimeSheets.Save(fsTimeSheets);
    
                MessageBox.Show("The employee's time sheet has been updated.",
                                "FunDS - Employees Records",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
    
            Close();
        }
    
        private void btnSubmitClick(object sender, EventArgs e)
        {
            XmlDocument xdTimeSheets = new XmlDocument();
            string strTimeSheetsFile = @"C:\Fun Department Store - Payroll\TimeSheets.xml";
    
            if (!File.Exists(strTimeSheetsFile))
            {
                xdTimeSheets.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                                     "<TimeSheets></TimeSheets>");
                xdTimeSheets.Save(strTimeSheetsFile);
            }
    
            xdTimeSheets.Load(strTimeSheetsFile);
    
            XmlElement xeTimeSheet = xdTimeSheets.CreateElement("TimeSheet");
            xeTimeSheet.InnerXml = "<TimeSheetID>" + int.Parse(txtTimeSheetID.Text) + "</TimeSheetID>" +
                                   "<EmployeeNumber>" + txtEmployeeNumber.Text + "</EmployeeNumber>" +
                                   "<StartDate>" + dtpStartDate.Value.ToShortDateString() + "</StartDate>" +
                                   "<Week1Monday>" + double.Parse(txtWeek1Monday.Text) + "</Week1Monday>" +
                                   "<Week1Tuesday>" + double.Parse(txtWeek1Tuesday.Text) + "</Week1Tuesday>" +
                                   "<Week1Wednesday>" + double.Parse(txtWeek1Wednesday.Text) + "</Week1Wednesday>" +
                                   "<Week1Thursday>" + double.Parse(txtWeek1Thursday.Text) + "</Week1Thursday>" +
                                   "<Week1Friday>" + double.Parse(txtWeek1Friday.Text) + "</Week1Friday>" +
                                   "<Week1Saturday>" + double.Parse(txtWeek1Saturday.Text) + "</Week1Saturday>" +
                                   "<Week1Sunday>" + double.Parse(txtWeek1Sunday.Text) + "</Week1Sunday>" +
                                   "<Week2Monday>" + double.Parse(txtWeek2Monday.Text) + "</Week2Monday>" +
                                   "<Week2Tuesday>" + double.Parse(txtWeek2Tuesday.Text) + "</Week2Tuesday>" +
                                   "<Week2Wednesday>" + double.Parse(txtWeek2Wednesday.Text) + "</Week2Wednesday>" +
                                   "<Week2Thursday>" + double.Parse(txtWeek2Thursday.Text) + "</Week2Thursday>" +
                                   "<Week2Friday>" + double.Parse(txtWeek2Friday.Text) + "</Week2Friday>" +
                                   "<Week2Saturday>" + double.Parse(txtWeek2Saturday.Text) + "</Week2Saturday>" +
                                   "<Week2Sunday>" + double.Parse(txtWeek2Sunday.Text) + "</Week2Sunday>";
    
            xdTimeSheets.DocumentElement.AppendChild(xeTimeSheet);
            xdTimeSheets.Save(strTimeSheetsFile);
    
            Close();
        }
    
        private void btnCloseClick(object sender, EventArgs e)
        {
            Close();
        }
    }
  2. On the main menu, click File -> New
  3. When asked whether you want to save, click Save (or Yes)
  4. Set the Save As Type to All Files
  5. Set the File Name to TimeSheet.cs and press Enter

Overtime and the Weekly Time Sheet

The easiest way to calculate the values of a time sheet is to simply add the time worked for each day to get the total time worked. If an employee worked some limited time, this is fine. Most companies pay overtime if an employee works beyond a certain amount of time. There are different techniques to apply or to calculate overtime, but there are two broad categories.

The time worked can be considered on a weekly basis. In this case, an employee typically works 5 days a week for 40 hours. Any period over 40 hours is considered overtime.

Practical LearningPractical Learning: Evaluating a Payroll

  1. In the empty document, type the following:
    using System;
    using System.IO;
    using System.Xml;
    using System.Drawing;
    using System.Windows.Forms;
    
    public class PayrollSummary1 : Form
    {
        private Label lblStartDate;
        private DateTimePicker dtpStartDate;
        private Label lblEmployeeNumber;
        private TextBox txtEmployeeNumber;
        private TextBox txtEmployeeName;
        private Button btnFind;
        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 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 lblDoubleLine2;
        
        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;
    
        public PayrollSummary1()
        {
            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.Size = new System.Drawing.Size(200, 20);
            txtEmployeeName.TabIndex = 376;
            Controls.Add(txtEmployeeName);
    
            // Button: Find
            btnFind = new Button();
            btnFind.Location = new System.Drawing.Point(384, 46);
            btnFind.Size = new System.Drawing.Size(75, 23);
            btnFind.TabIndex = 508;
            btnFind.Text = "Find";
            btnFind.Click += new EventHandler(btnFindClick);
            Controls.Add(btnFind);
    
            // Label: Hourly Salary
            lblHourlySalary = new Label();
            lblHourlySalary.AutoSize = true;
            lblHourlySalary.Location = new System.Drawing.Point(20, 75);
            lblHourlySalary.TabIndex = 353;
            lblHourlySalary.Text = "Hourly Salary:";
            Controls.Add(lblHourlySalary);
    
            // Text Box: Hourly Salary
            txtHourlySalary = new TextBox();
            txtHourlySalary.Location = new System.Drawing.Point(100, 72);
            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.Visible = false;
            lblTimeSheetID.AutoSize = true;
            lblTimeSheetID.Location = new System.Drawing.Point(209, 75);
            lblTimeSheetID.TabIndex = 494;
            lblTimeSheetID.Text = "Time Sheet #:";
            Controls.Add(lblTimeSheetID);
    
            // Text Box: Time Sheet ID
            txtTimeSheetID = new TextBox();
            txtTimeSheetID.Visible = false;
            txtTimeSheetID.Location = new System.Drawing.Point(290, 72);
            txtTimeSheetID.Size = new System.Drawing.Size(80, 20);
            txtTimeSheetID.TabIndex = 495;
            Controls.Add(txtTimeSheetID);
    
            // Label: Double Line 1
            lblDoubleLine1 = new Label();
            lblDoubleLine1.AutoSize = true;
            lblDoubleLine1.Location = new System.Drawing.Point(17, 98);
            lblDoubleLine1.TabIndex = 506;
            lblDoubleLine1.Text = "==========================================================================================";
            Controls.Add(lblDoubleLine1);
    
            // Label: Time Sheet Monday
            lblTimeSheetMonday = new Label();
            lblTimeSheetMonday.AutoSize = true;
            lblTimeSheetMonday.Location = new System.Drawing.Point(94, 119);
            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(151, 119);
            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(205, 119);
            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(269, 119);
            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(324, 119);
            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(381, 119);
            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(436, 119);
            lblTimeSheetSunday.TabIndex = 362;
            lblTimeSheetSunday.Text = "Sunday";
            Controls.Add(lblTimeSheetSunday);
    
            // Label: Totals
            lblTotals = new Label();
            lblTotals.AutoSize = true;
            lblTotals.Location = new System.Drawing.Point(509, 119);
            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(30, 141);
            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(97, 138);
            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(154, 138);
            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(211, 138);
            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(268, 138);
            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(325, 138);
            txtTSWk1Friday.Size = new System.Drawing.Size(51, 20);
            txtTSWk1Friday.TabIndex = 367;
            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(382, 138);
            txtTSWk1Saturday.Size = new System.Drawing.Size(51, 20);
            txtTSWk1Saturday.TabIndex = 368;
            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(439, 138);
            txtTSWk1Sunday.Size = new System.Drawing.Size(51, 20);
            txtTSWk1Sunday.TabIndex = 369;
            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, 138);
            txtTotalTimeWeek1.Size = new System.Drawing.Size(51, 20);
            txtTotalTimeWeek1.TabIndex = 496;
            txtTotalTimeWeek1.Text = "0.00";
            txtTotalTimeWeek1.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtTotalTimeWeek1);
    
            // Label: Line Week 1 - Summary
            lblLineWeek1Summary = new Label();
            lblLineWeek1Summary.AutoSize = true;
            lblLineWeek1Summary.Location = new System.Drawing.Point(17, 163);
            lblLineWeek1Summary.TabIndex = 370;
            lblLineWeek1Summary.Text = "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
            Controls.Add(lblLineWeek1Summary);
    
            // Label: Time Sheet Week 2
            lblTimeSheetWeek2 = new Label();
            lblTimeSheetWeek2.AutoSize = true;
            lblTimeSheetWeek2.Location = new System.Drawing.Point(30, 192);
            lblTimeSheetWeek2.TabIndex = 435;
            lblTimeSheetWeek2.Text = "Week 2:";
            Controls.Add(lblTimeSheetWeek2);
            // 
            // Text Box: Time Sheet Week 2 - Monday
            txtTSWk2Monday = new TextBox();
            txtTSWk2Monday.Location = new System.Drawing.Point(97, 187);
            txtTSWk2Monday.Size = new System.Drawing.Size(51, 20);
            txtTSWk2Monday.TabIndex = 436;
            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, 188);
            txtTSWk2Tuesday.Size = new System.Drawing.Size(51, 20);
            txtTSWk2Tuesday.TabIndex = 437;
            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, 189);
            txtTSWk2Wednesday.Size = new System.Drawing.Size(51, 20);
            txtTSWk2Wednesday.TabIndex = 438;
            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, 187);
            txtTSWk2Thursday.Size = new System.Drawing.Size(51, 20);
            txtTSWk2Thursday.TabIndex = 439;
            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, 187);
            txtTSWk2Friday.Size = new System.Drawing.Size(51, 20);
            txtTSWk2Friday.TabIndex = 440;
            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, 187);
            txtTSWk2Saturday.Size = new System.Drawing.Size(51, 20);
            txtTSWk2Saturday.TabIndex = 441;
            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, 187);
            txtTSWk2Sunday.Size = new System.Drawing.Size(51, 20);
            txtTSWk2Sunday.TabIndex = 442;
            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, 189);
            txtTotalTimeWeek2.Size = new System.Drawing.Size(51, 20);
            txtTotalTimeWeek2.TabIndex = 501;
            txtTotalTimeWeek2.Text = "0.00";
            txtTotalTimeWeek2.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtTotalTimeWeek2);
    
            // Label: DoubleLine2
            lblDoubleLine2 = new Label();
            lblDoubleLine2.AutoSize = true;
            lblDoubleLine2.Location = new System.Drawing.Point(17, 215);
            lblDoubleLine2.TabIndex = 434;
            lblDoubleLine2.Text = "==========================================================================================";
            Controls.Add(lblDoubleLine2);
    
            // Label: Time
            lblTime = new Label();
            lblTime.AutoSize = true;
            lblTime.Location = new System.Drawing.Point(265, 235);
            lblTime.TabIndex = 386;
            lblTime.Text = "Time";
            Controls.Add(lblTime);
    
            // Label: Pay
            lblPay = new Label();
            lblPay.AutoSize = true;
            lblPay.Location = new System.Drawing.Point(324, 235);
            lblPay.Size = new System.Drawing.Size(25, 13);
            lblPay.TabIndex = 387;
            lblPay.Text = "Pay";
            Controls.Add(lblPay);
    
            // Label: Regular
            lblRegular = new Label();
            lblRegular.AutoSize = true;
            lblRegular.Location = new System.Drawing.Point(187, 256);
            lblRegular.TabIndex = 388;
            lblRegular.Text = "Regular:";
            Controls.Add(lblRegular);
    
            // Text Box: Regular Time
            txtRegularTime = new TextBox();
            txtRegularTime.Location = new System.Drawing.Point(268, 253);
            txtRegularTime.Size = new System.Drawing.Size(51, 20);
            txtRegularTime.TabIndex = 389;
            txtRegularTime.Text = "0.00";
            txtRegularTime.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtRegularTime);
    
            // Text Box: RegularPay
            txtRegularPay = new TextBox();
            txtRegularPay.Location = new System.Drawing.Point(325, 253);
            txtRegularPay.Size = new System.Drawing.Size(51, 20);
            txtRegularPay.TabIndex = 390;
            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(187, 282);
            lblOvertime.TabIndex = 402;
            lblOvertime.Text = "Overtime:";
            Controls.Add(lblOvertime);
    
            // Text Box: Overtime
            txtOvertime = new TextBox();
            txtOvertime.Location = new System.Drawing.Point(268, 279);
            txtOvertime.Size = new System.Drawing.Size(51, 20);
            txtOvertime.TabIndex = 391;
            txtOvertime.Text = "0.00";
            txtOvertime.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtOvertime);
    
            // Text Box: Overtime Pay
            txtOvertimePay = new TextBox();
            txtOvertimePay.Location = new System.Drawing.Point(325, 279);
            txtOvertimePay.Size = new System.Drawing.Size(51, 20);
            txtOvertimePay.TabIndex = 392;
            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(189, 312);
            lblGrossSalary.TabIndex = 403;
            lblGrossSalary.Text = "Gross Salary:";
            Controls.Add(lblGrossSalary);
    
            // Text Box: Gross Salary
            txtGrossSalary = new TextBox();
            txtGrossSalary.Location = new System.Drawing.Point(268, 309);
            txtGrossSalary.Size = new System.Drawing.Size(79, 20);
            txtGrossSalary.TabIndex = 393;
            txtGrossSalary.Text = "0.00";
            txtGrossSalary.TextAlign = HorizontalAlignment.Right;
            Controls.Add(txtGrossSalary);
    
            // Button: Close
            btnClose = new Button();
            btnClose.Location = new System.Drawing.Point(465, 306);
            btnClose.Size = new System.Drawing.Size(75, 23);
            btnClose.TabIndex = 373;
            btnClose.Text = "Close";
            btnClose.Click += new EventHandler(btnCloseClick);
            Controls.Add(btnClose);
    
            // Label: Double Line 3
            lblDoubleLine3 = new Label();
            lblDoubleLine3.AutoSize = true;
            lblDoubleLine3.Location = new System.Drawing.Point(17, 341);
            lblDoubleLine3.TabIndex = 507;
            lblDoubleLine3.Text = "=========================================================================================";
            Controls.Add(lblDoubleLine3);
    
            // Form: Payroll Summary
            ClientSize = new System.Drawing.Size(582, 365);
            MaximizeBox = false;
            StartPosition = FormStartPosition.CenterScreen;
            Text = "Fun Department Store - Payroll Summary";
        }
    
        private void ResetForm()
        {
            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";
    
            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";
    
            txtRegularTime.Text = "0.00";
            txtOvertime.Text = "0.00";
            txtRegularPay.Text = "0.00";
            txtOvertimePay.Text = "0.00";
    
            txtGrossSalary.Text = "0.00";
        }
    
        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 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 btnFindClick(object sender, EventArgs e)
        {
            bool timeSheetFound = false;
            XmlDocument xdTimeSheets = new XmlDocument();
            string strTimeSheetsFile = @"C:\Fun Department Store - Payroll\TimeSheets.xml";
    
            double hourlySalary = 0.00;
            double totalTimeWeek1 = 0.00, totalTimeWeek2 = 0.00;
    
            double regularTimeWeek1 = 0.00;
            double regularPayWeek1 = 0.00, overtimeWeek1 = 0.00, overtimePayWeek1 = 0.00;
    
            double regularTimeWeek2 = 0.00;
            double regularPayWeek2 = 0.00, overtimeWeek2 = 0.00, overtimePayWeek2 = 0.00;
    
            double totalRegularTime = 0.00, totalOvertime = 0.00;
            double totalRegularPay = 0.00, overtimePay = 0.00, totalEarnings = 0.00;
    
            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())
                        {
                            timeSheetFound = true;
    
                            lblTimeSheetID.Visible = true;
                            txtTimeSheetID.Visible = true;
                            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");
    
                            totalTimeWeek1 = 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);
                            totalTimeWeek2 = 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);
    
                            try
                            {
                                hourlySalary = double.Parse(txtHourlySalary.Text);
                            }
                            catch (FormatException fe)
                            {
                                MessageBox.Show(fe.Message);
                            }
    
                            // The overtime is paid time and half
                            double overtimeSalary = hourlySalary * 1.50;
    
                            // If the employee worked under 40 hours, there is no overtime
                            if (totalTimeWeek1 < 40.00)
                            {
                                regularTimeWeek1 = totalTimeWeek1;
                                regularPayWeek1 = hourlySalary * regularTimeWeek1;
                                overtimeWeek1 = 0.00;
                                overtimePayWeek1 = 0.00;
                            } // If the employee worked over 40 hours, calculate the overtime
                            else if (totalTimeWeek1 >= 40.00)
                            {
                                regularTimeWeek1 = 40.00;
                                regularPayWeek1 = hourlySalary * 40.00;
                                overtimeWeek1 = totalTimeWeek1 - 40.00;
                                overtimePayWeek1 = overtimeWeek1 * overtimeSalary;
                            }
    
                            if (totalTimeWeek2 < 40.00)
                            {
                                regularTimeWeek2 = totalTimeWeek2;
                                regularPayWeek2 = hourlySalary * regularTimeWeek2;
                                overtimeWeek2 = 0.00;
                                overtimePayWeek2 = 0.00;
                            }
                            else if (totalTimeWeek2 >= 40.00)
                            {
                                regularTimeWeek2 = 40.00;
                                regularPayWeek2 = hourlySalary * 40.00;
                                overtimeWeek2 = totalTimeWeek2 - 40.00;
                                overtimePayWeek2 = overtimeWeek2 * overtimeSalary;
                            }
    
                            txtTotalTimeWeek1.Text = totalTimeWeek1.ToString("F");
                            txtTotalTimeWeek2.Text = totalTimeWeek2.ToString("F");
    
                            totalRegularTime = regularTimeWeek1 + regularTimeWeek2;
                            totalOvertime = overtimeWeek1 + overtimeWeek2;
                            totalRegularPay = regularPayWeek1 + regularPayWeek2;
                            overtimePay = overtimePayWeek1 + overtimePayWeek2;
                            totalEarnings = totalRegularPay + overtimePay;
    
                            txtRegularTime.Text = totalRegularTime.ToString("F");
                            txtOvertime.Text = totalOvertime.ToString("F");
                            txtRegularPay.Text = totalRegularPay.ToString("F");
                            txtOvertimePay.Text = overtimePay.ToString("F");
    
                            txtGrossSalary.Text = totalEarnings.ToString("F");
                        }
                    }
    
                    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);
                    }
                }
            }
        }
    
        private void btnCloseClick(object sender, EventArgs e)
        {
            Close();
        }
    }
  2. On the main menu, click File -> New
  3. When asked whether you want to save, click Save (or Yes)
  4. Set the Save As Type to All Files
  5. Set the File Name to PayrollEvaluation1.cs and press Enter
 
 
 

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 LearningPractical Learning: Evaluating a Payroll

  1. 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();
        }
    }
  2. On the main menu, click File -> New
  3. When asked whether you want to save, click Save (or Yes)
  4. Set the Save As Type to All Files
  5. Set the File Name to PayrollEvaluation2.cs and press Enter
  6. 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());
        }
    }
  7. On the main menu, click File -> New
  8. When asked whether you want to save, click Save (or Yes)
  9. Set the Save As Type to All Files
  10. Set the File Name to TimeSheetCalculations.cs and press Enter
  11. If you want to build the application, start the Command Prompt (Start -> (All) Programs -> Accessories -> Command Prompt)
  12. Type CD\ and press Enter
  13. Type CD TimeSheetCalculations and press Enter
  14. 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
  15. If you want to execute the application, type PayrollSystem and press Enter

    Fun Department Store - Payroll System

  16. If you want to test the application, click the Employees button to open its form
  17. Click the New Employee button:

    Fun Department Store - New Employee

  18. 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

    Fun Department Store - Employees

  19. Close the Employees
  20. Open the TimeSheet form:

    Fun Department Store - Employee Time Sheet

  21. Close the Employees form
  22. Click the Employees Time Sheet
 
 
  1. Create a few time sheet records as follows and click Submit every time you have completed a record:

    Employee # Start Date Wk 1 Mon Wk 1 Tue Wk 1 Wed Wk 1 Thu Wk 1 Fri Wk 1 Sat Wk 1 Sun Wk 2 Mon Wk 2 Tue Wk 2 Wed Wk 2 Thu Wk 2 Fri Wk 2 Sat Wk 2 Sun
    606384 06/01/2015 0 0 0 0 0 8 8 0 0 0 0 0 8 8
    952748 06/01/2015 8 8 8 8 8 0 0 8 8 8 8 8 0 0
    606384 06/15/2015 0 0 0 0 4 6 8 0 0 0 0 6 6 6
    283749 06/15/2015 8 8 8 8 0 8 8 6 6 8 6 0 7 0
  2. Close the Time Sheet form
  3. Click the Payroll System 1 button to open its form
  4. Set the Start Date as June 1, 2015
  5. Enter the Employee # as 952748
  6. Click Find:

    Fun Department Store - Payroll Evaluation

  7. Change the Start Date to June 15, 2015
  8. Change the Employee # as 283749
  9. Click Find:

    Fun Department Store - Payroll Evaluation

  10. Close the PayrollEvaluation1 form
  11. Open the PayrollEvaluation2 form
  12. Set the Start Date as June 1, 2015
  13. Enter the Employee # as 952748
  14. Click Find:

    Fun Department Store - Payroll Evaluation

  15. Change the Start Date to June 15, 2015
  16. Change the Employee # as 283749
  17. Click Find:

    Fun Department Store - Payroll Evaluation

  18. Close the forms
 
 

Home Copyright © 2014-2016, FunctionX