Esempio n. 1
0
 private void frmTimeSheet_Load(object sender, EventArgs e)
 {
     Refresh();
     timesheetDO = new TimeSheetDO();
     CurrentMonth = DateTime.Now.Month;
     CurrentYear = DateTime.Now.Year;
     cboMonth.SelectedText = CurrentMonth.ToString();
     cboYear.SelectedText = CurrentYear.ToString();
     PopulateDepartmentCombo();
 }
Esempio n. 2
0
 private void btnGenerate_Click(object sender, System.EventArgs e)
 {
     // Bộ phận đã có bảng chấm công hay chưa
     TimeSheetDO timeSheetDO = new TimeSheetDO();
     DataSet dsTimeSheet = timeSheetDO.GetDepartmentTimeSheet(CurrentMonth, CurrentYear, DepartmentID);
     if (dsTimeSheet.Tables[0].Rows.Count == 0)
     {
         string str = WorkingContext.LangManager.GetString("frmListSalary_btnSinh_THongBao");
         string str1 = WorkingContext.LangManager.GetString("frmListSalary_btnSinh_THongBao_title");
         //MessageBox.Show("Bộ phận này chưa có dữ liệu chấm công tháng. Bạn phải sinh bảng chấm công tháng trước khi sinh bảng lương.", "Sinh bảng lương tháng", MessageBoxButtons.OK, MessageBoxIcon.Error);
         MessageBox.Show(str, str1, MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     // Bộ phận đã có dữ liệu lương hay chưa
     if (dsSalary.Tables[0].Rows.Count > 0)
     {
         string str = WorkingContext.LangManager.GetString("frmListSalary_btnSinh_THongBao1");
         string str1 = WorkingContext.LangManager.GetString("frmListSalary_btnSinh_THongBao_title");
         //Xác nhận muốn sinh lại bảng lương tháng
         if (MessageBox.Show(str, str1, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
         {
             return;
         }
     }
     GenerateSalary();
     LoadSalaryData();
 }