示例#1
0
        public void AttendanceRuleGet(double ids)
        {
            try
            {
                AttendanceRule_Controller AttRule = new AttendanceRule_Controller();

                foreach (DataRow row in AttRule.AttendanceRuleSelect(ids).Rows)
                {
                    txtIDS.Text = row["IDS"].ToString();
                    cboDayOfTheWeek.SelectedIndex = Convert.ToInt16(row["DayOfTheWeek"].ToString());
                    cboShiftName.Text             = row["ShiftName"].ToString();

                    dtpPunchIn.Value     = Convert.ToDateTime(row["PunchInRule"].ToString());
                    dtpBreakOut.Value    = Convert.ToDateTime(row["BreakOutRule"].ToString());
                    dtpBreakIn.Value     = Convert.ToDateTime(row["BreakInRule"].ToString());
                    dtpPunchOut.Value    = Convert.ToDateTime(row["PunchOutRule"].ToString());
                    dtpOvertimeIn.Value  = Convert.ToDateTime(row["OTInRule"].ToString());
                    dtpOvertimeOut.Value = Convert.ToDateTime(row["OTOutRule"].ToString());

                    txtPenalty.Text = row["LatePerMinutePenalty"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
示例#2
0
        private void AttendanceRuleInserts()
        {
            try
            {
                AttendanceRule_Controller AttRuleNew = new AttendanceRule_Controller();
                //AttendanceLog_Controller AttRuleNew = new AttendanceLog_Controller();
                Double IDS = AttRuleNew.AttendanceRuleInsert(Convert.ToDouble(txtIDS.Text),
                                                             Convert.ToDateTime(dtpPunchIn.Value),
                                                             Convert.ToDateTime(dtpBreakOut.Value),
                                                             Convert.ToDateTime(dtpBreakIn.Value),
                                                             Convert.ToDateTime(dtpPunchOut.Value),
                                                             Convert.ToDateTime(dtpOvertimeIn.Value),
                                                             Convert.ToDateTime(dtpOvertimeOut.Value),
                                                             Convert.ToString(cboShiftName.Text),
                                                             Convert.ToInt16(cboDayOfTheWeek.SelectedIndex),
                                                             Convert.ToDecimal(txtPenalty.Text)
                                                             );

                MessageBox.Show("Save Successfull");
                AttendanceRuleGet(IDS);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
示例#3
0
        private void builEmployeeNoShift()
        {
            AttendanceRule_Controller Emp = new AttendanceRule_Controller();
            DataTable dt = Emp.EmployeeSelectAllNoShift();

            cboEmployeesNoShift.DataSource    = dt;
            cboEmployeesNoShift.DisplayMember = "FullName";
            cboEmployeesNoShift.ValueMember   = "IDS";
        }
示例#4
0
        private void ShiftNameCbo()
        {
            AttendanceRule_Controller ShiftcboGet = new AttendanceRule_Controller();
            DataTable dt = ShiftcboGet.ShiftNameSelect();

            cboShiftName.DataSource    = dt;
            cboShiftName.DisplayMember = "ShiftName";
            // cboShiftName.ValueMember = "IDS";
        }
示例#5
0
        private void EmployeesListByShift()
        {
            try
            {
                string ShiftName = dgvShiftList.SelectedRows[0].Cells["ShiftName"].Value.ToString();

                AttendanceRule_Controller attRule = new AttendanceRule_Controller();
                dgvEmployee.DataSource = attRule.EmployeeSelectByShift(ShiftName);
            }
            catch { }
        }
示例#6
0
 private void RemoveAllEmployeeFromShift()
 {
     try
     {
         string ShiftName = dgvEmployee.SelectedRows[0].Cells["ShiftName"].Value.ToString();
         AttendanceRule_Controller attRule = new AttendanceRule_Controller();
         double result = attRule.RemoveAllEmployeeFromShift(ShiftName);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
示例#7
0
 private void RemoveEmployeeFromShift()
 {
     try
     {
         double IDS = Convert.ToDouble(dgvEmployee.SelectedRows[0].Cells["IDS"].Value.ToString());
         AttendanceRule_Controller attRule = new AttendanceRule_Controller();
         double result = attRule.RemoveEmployeeFromShift(IDS);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
示例#8
0
 private void UpdateEmployeeByShift()
 {
     try
     {
         string ShiftName = dgvShiftList.SelectedRows[0].Cells["ShiftName"].Value.ToString();
         double IDS       = Convert.ToDouble(cboEmployeesNoShift.SelectedValue);
         AttendanceRule_Controller attRule = new AttendanceRule_Controller();
         double result = attRule.UpdateEmployeeByShift(ShiftName, IDS);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
示例#9
0
        private void AttendanceRuleListGet()
        {
            try
            {
                AttendanceRule_Controller attendanceRuleGet = new AttendanceRule_Controller();

                dgvShiftList.DataSource = attendanceRuleGet.AttendanceRuleSelectList();
                this.dgvShiftList.Columns[0].Visible = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }