Ejemplo n.º 1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            int tmId;
            int emId;

            try
            {
                tmId = int.Parse(txtSheetId.Text.Trim());
                emId = int.Parse(txtEmId.Text.Trim());
            }
            catch
            {
                MessageBox.Show("please input timesheetID/employeeID");
                return;
            }
            ctr.updateTimeSheet(tmId, txtEmId.Text.Trim(), txtWkHour.Text.Trim(), txtOvertimeHur.Text.Trim());

            if (userType.Equals("Salary"))
            {
                TimeSheetEvent = new TimeSheetIdentityEvent(tmId, txtWkHour.Text.Trim(), txtOvertimeHur.Text.Trim());
                IdentityUpdated(this, TimeSheetEvent);
                MessageBox.Show("update timesheet of salary for emloyee ID:" + userId + " successfully");
                this.Dispose();
            }
            refresh();
            bindingDateGridView();
        }
Ejemplo n.º 2
0
 public void getWorkTime(object sender, TimeSheetIdentityEvent e)
 {
     tSheetId     = e.TimeSheetId;
     whour        = e.WorkTime;
     ohour        = e.OverTime;
     txtTsid.Text = e.TimeSheetId.ToString();
 }
Ejemplo n.º 3
0
        //add
        private void button1_Click(object sender, EventArgs e)
        {
            int wkHour;
            int ovHour;

            try
            {
                wkHour = int.Parse(txtWkHour.Text.Trim());
                ovHour = int.Parse(txtOvertimeHur.Text.Trim());
            }
            catch
            {
                MessageBox.Show("please input correct time");
                return;
            }
            string emId = txtEmId.Text.Trim();
            string ws   = txtWkHour.Text.Trim();
            string os   = txtOvertimeHur.Text.Trim();
            int    tmId;

            try
            {
                tmId = ctr.addTimeSheet(emId, ws, os);
                MessageBox.Show("add successful");
            }
            catch
            {
                MessageBox.Show("add fail");
                return;
            }
            finally
            {
            }
            refresh();
            bindingDateGridView();
            // publish the timesheetId to salaryS
            if (userType.Equals("Salary"))
            {
                TimeSheetEvent = new TimeSheetIdentityEvent(tmId, ws, os);
                IdentityUpdated(this, TimeSheetEvent);
                MessageBox.Show("add timesheet of salary for emloyee ID:" + userId + " successfully");
                this.Dispose();
            }
        }