Exemplo n.º 1
0
        private void btn_Luu_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn muốn thêm ngày nghỉ cho nhân viên " + oThongTinCNVC.txt_MaNV.Text, "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                oChamCong.LoaiNgayPhepID = Convert.ToInt16(cb_LoaiNgayPhep.SelectedValue);
                oChamCong.IsUngTruoc     = cb_UngNP.Checked;
                oChamCong.GhiChu         = rTB_GhiChu.Text;

                BreakDateByMonth(dtp_TuNGay.Value, dtp_DenNgay.Value);


                try
                {
                    oChamCong.Add(oThongTinCNVC.txt_MaNV.Text, lFrom, lTo, lWorkingDays);
                    MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    UIControls(true);
                    GetAndBindMonthCalendar();
                }
                catch (Exception)
                {
                    MessageBox.Show("Thêm không thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }