Exemple #1
0
        private void btn_Them_Click(object sender, EventArgs e)
        {
            if (CheckInputData())
            {
                #region Quyet Dinh Info
                oQuyetDinh = new Business.HDQD.QuyetDinh();
                oQuyetDinh.Ma_Quyet_Dinh  = thongTinQuyetDinh1.txt_MaQD.Text;
                oQuyetDinh.Ten_Quyet_Dinh = thongTinQuyetDinh1.txt_TenQD.Text;
                try
                {
                    oQuyetDinh.Loai_QuyetDinh_ID = Convert.ToInt32(thongTinQuyetDinh1.comB_Loai.SelectedValue.ToString());
                }
                catch
                {
                    oQuyetDinh.Loai_QuyetDinh_ID = null;
                }

                //oQuyetDinh.Loai_QuyetDinh_ID = 7;
                oQuyetDinh.Ngay_Ky       = thongTinQuyetDinh1.dTP_NgayKy.Value;
                oQuyetDinh.Ngay_Hieu_Luc = thongTinQuyetDinh1.dTP_NgayHieuLuc.Value;
                oQuyetDinh.Ngay_Het_Han  = null;
                oQuyetDinh.MoTa          = thongTinQuyetDinh1.rTB_MoTa.Text;
                #endregion

                try
                {
                    if (MessageBox.Show("Bạn thực sự muốn nhập quyết định thôi việc cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (oQuyetDinh.Update_CNVC_DungHopDong(strMaNV, strMaHD))
                        {
                            MessageBox.Show("Nhập thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("Thao tác nhập thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Thao tác nhập thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Vui lòng nhập đầy đủ thông tin.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemple #2
0
        public DoiThongTinDV()
        {
            InitializeComponent();
            oDonVi     = new DonVi();
            oChucVu    = new ChucVu();
            oQuyetDinh = new Business.HDQD.QuyetDinh();
            dtDonVi    = oDonVi.GetActiveDonVi();
            dtChucVu   = oChucVu.GetList();
            oFTP       = new Business.FTP();
            oFile      = new Business.HDQD.QD_File();
            dtFile     = new DataTable();
            Paths      = new List <KeyValuePair <string, bool?> >();

            TLPTenColCount    = tableLP_ThayDoiTen.ColumnCount;
            TLPCVColCount     = tableLP_ThayDoiCV.ColumnCount;
            TLPCapBacColCount = tableLP_ThayDoiCapBac.ColumnCount;
        }
Exemple #3
0
        public DoiThongTinDV()
        {
            InitializeComponent();
            oDonVi = new DonVi();
            oChucVu = new ChucVu();
            oQuyetDinh = new Business.HDQD.QuyetDinh();
            dtDonVi = oDonVi.GetActiveDonVi();
            dtChucVu = oChucVu.GetList();
            oFTP = new Business.FTP();
            oFile = new Business.HDQD.QD_File();
            dtFile = new DataTable();
            Paths = new List<KeyValuePair<string, bool?>>();

            TLPTenColCount = tableLP_ThayDoiTen.ColumnCount;
            TLPCVColCount = tableLP_ThayDoiCV.ColumnCount;
            TLPCapBacColCount = tableLP_ThayDoiCapBac.ColumnCount;
        }
Exemple #4
0
        public QDDungHopDong()
        {
            InitializeComponent();
            oHopDong = new Business.HDQD.CNVC_HopDong();
            oQuyetDinh = new Business.HDQD.QuyetDinh();
            dtDSHopDong = new DataTable();

            thongTinQuyetDinh1.dTP_NgayHetHan.Visible = false;
            thongTinQuyetDinh1.label7.Visible = false;

            #region Xử lý dữ liệu cho cbo Loại Quyết Định
            DataTable dt = new DataTable();
            dt.Columns.Add("loai_quyet_dinh_id", typeof(int));
            dt.Columns.Add("ten_loai_quyet_dinh", typeof(string));

            dt.Rows.Add(new object[2] { 14, "Thôi việc" });

            thongTinQuyetDinh1.comB_Loai.DataSource = dt;
            thongTinQuyetDinh1.comB_Loai.DisplayMember = "ten_loai_quyet_dinh";
            thongTinQuyetDinh1.comB_Loai.ValueMember = "loai_quyet_dinh_id";
            #endregion
        }
Exemple #5
0
        private void InitObject(bool p_loadcbo_loaiqd)
        {
            oChucdanh     = new ChucDanh();
            oChucvu       = new ChucVu();
            oDonvi        = new DonVi();
            oLoaiPC       = new Business.HDQD.LoaiPhuCap();
            oQuyetDinh    = new Business.HDQD.QuyetDinh();
            oLoaiQD       = new Business.HDQD.LoaiQuyetDinh();
            ucDinhNghiaCT = new DinhNghiaCT();

            dtPhuCap = new DataTable();
            dtLoaiPC = new DataTable();

            dtLoaiPC = oLoaiPC.GetList_Cbo();
            PreapreDataSource();
            PrepareDataTablePhuCap();

            if (p_loadcbo_loaiqd)
            {
                LoadCbo_Loai_QD();
            }
        }
Exemple #6
0
        public QDDungHopDong()
        {
            InitializeComponent();
            oHopDong    = new Business.HDQD.CNVC_HopDong();
            oQuyetDinh  = new Business.HDQD.QuyetDinh();
            dtDSHopDong = new DataTable();

            thongTinQuyetDinh1.dTP_NgayHetHan.Visible = false;
            thongTinQuyetDinh1.label7.Visible         = false;

            #region Xử lý dữ liệu cho cbo Loại Quyết Định
            DataTable dt = new DataTable();
            dt.Columns.Add("loai_quyet_dinh_id", typeof(int));
            dt.Columns.Add("ten_loai_quyet_dinh", typeof(string));

            dt.Rows.Add(new object[2] {
                14, "Thôi việc"
            });

            thongTinQuyetDinh1.comB_Loai.DataSource    = dt;
            thongTinQuyetDinh1.comB_Loai.DisplayMember = "ten_loai_quyet_dinh";
            thongTinQuyetDinh1.comB_Loai.ValueMember   = "loai_quyet_dinh_id";
            #endregion
        }
Exemple #7
0
        private void btn_Nhap_Click(object sender, EventArgs e)
        {
            if (thongTinQuyetDinh1.txt_MaQD.Text != "")
            {
                Business.HDQD.QuyetDinh quyetdinh = new Business.HDQD.QuyetDinh();
                quyetdinh.Ma_Quyet_Dinh     = thongTinQuyetDinh1.txt_MaQD.Text;
                quyetdinh.Ten_Quyet_Dinh    = thongTinQuyetDinh1.txt_TenQD.Text;
                quyetdinh.Loai_QuyetDinh_ID = Convert.ToInt16(thongTinQuyetDinh1.comB_Loai.SelectedValue);
                quyetdinh.Ngay_Ky           = thongTinQuyetDinh1.dTP_NgayKy.Value;
                quyetdinh.Ngay_Hieu_Luc     = thongTinQuyetDinh1.dTP_NgayHieuLuc.Value;
                if (thongTinQuyetDinh1.dTP_NgayHetHan.Checked == true)
                {
                    quyetdinh.Ngay_Het_Han = thongTinQuyetDinh1.dTP_NgayHetHan.Value;
                }
                else
                {
                    quyetdinh.Ngay_Het_Han = null;
                }
                quyetdinh.MoTa = thongTinQuyetDinh1.rTB_MoTa.Text;

                if (is_Tach_DV == true) // tach don vi
                {
                    #region Tách đơn vị
                    try
                    {
                        int      count           = dsDonVi_new.Count;
                        string[] ten_don_vi_moi  = new string[count];
                        string[] ten_dv_viet_tat = new string[count];
                        int[]    dv_cha_id       = new int[count];
                        string[] tu_ngay         = new string[count];
                        string[] ghi_chu         = new string[count];
                        string[] ma_nv           = new string[count];

                        for (int i = 0; i < dsDonVi_new.Count; i++)
                        {
                            DonVi dv = new DonVi();
                            dv = dsDonVi_new[i];

                            ten_don_vi_moi[i]  = dv.TenDonVi;
                            ten_dv_viet_tat[i] = dv.TenDVVietTat;
                            if (dv.DVChaID != null)
                            {
                                dv_cha_id[i] = dv.DVChaID.Value;
                            }
                            else
                            {
                                dv_cha_id[i] = 0;
                            }
                            tu_ngay[i] = dv.TuNgay.Value.ToString("d", CultureInfo.CreateSpecificCulture("vi-VN"));

                            ma_nv[i] = dsCNVC[i];
                        }

                        int[]    tu_don_vi = new int[1];
                        ComboBox cbo_DonVi = (ComboBox)tableLP_ComboTuDV.Controls[0];
                        if (cbo_DonVi.Text != "")
                        {
                            tu_don_vi[0] = Convert.ToInt16(cbo_DonVi.SelectedValue);
                        }
                        else
                        {
                            MessageBox.Show("Vui lòng chọn một đơn vị.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }

                        bool result = quyetdinh.MA_Tach_DonVi(tu_don_vi, ten_don_vi_moi, ten_dv_viet_tat, dv_cha_id, tu_ngay, ghi_chu, ma_nv);
                        if (result == true)
                        {
                            MessageBox.Show("Nhập quyết định tách đơn vị thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("Nhập quyết định tách đơn vị không thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Nhập quyết định tách đơn vị không thành công.\r\n" + ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    #endregion
                }
                else // gộp đơn vị
                {
                    #region Gộp đơn vị
                    try
                    {
                        int[] tu_don_vi_id = new int[tableLP_ComboTuDV.RowCount];
                        for (int i = 0; i < tableLP_ComboTuDV.RowCount; i++)
                        {
                            tu_don_vi_id[i] = Convert.ToInt16(((ComboBox)tableLP_ComboTuDV.Controls[i * 2]).SelectedValue);
                        }

                        DonVi dv = new DonVi();
                        dv = dsDonVi_new[0];

                        string ten_dv_moi      = dv.TenDonVi;
                        string ten_dv_viet_tat = dv.TenDVVietTat;
                        int?   dv_cha_id       = dv.DVChaID;
                        //if (comb_DVTrucThuoc.Text != "")
                        //    dv_cha_id = Convert.ToInt16(comb_DVTrucThuoc.SelectedValue);
                        string tu_ngay = dv.TuNgay.Value.ToString("d", CultureInfo.CreateSpecificCulture("vi-VN"));
                        string ghi_chu = dv.GhiChu;

                        bool result = quyetdinh.MA_Gop_DonVi(tu_don_vi_id, ten_dv_moi, ten_dv_viet_tat, dv_cha_id, tu_ngay, ghi_chu);
                        if (result == true)
                        {
                            MessageBox.Show("Nhập quyết định gộp đơn vị thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            MessageBox.Show("Nhập quyết định gộp đơn vị không thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Nhập quyết định gộp đơn vị không thành công.\r\n" + ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    #endregion
                }
            }
            else
            {
                MessageBox.Show("Vui lòng nhập đầy đủ thông tin.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #8
0
        private void btn_Them_Click(object sender, EventArgs e)
        {
            if (CheckInputData())
            {
                #region Quyet Dinh Info
                oQuyetDinh = new Business.HDQD.QuyetDinh();
                oQuyetDinh.Ma_Quyet_Dinh = thongTinQuyetDinh1.txt_MaQD.Text;
                oQuyetDinh.Ten_Quyet_Dinh = thongTinQuyetDinh1.txt_TenQD.Text;
                try
                {
                    oQuyetDinh.Loai_QuyetDinh_ID = Convert.ToInt32(thongTinQuyetDinh1.comB_Loai.SelectedValue.ToString());
                }
                catch
                {
                    oQuyetDinh.Loai_QuyetDinh_ID = null;
                }

                //oQuyetDinh.Loai_QuyetDinh_ID = 7;
                oQuyetDinh.Ngay_Ky = thongTinQuyetDinh1.dTP_NgayKy.Value;
                oQuyetDinh.Ngay_Hieu_Luc = thongTinQuyetDinh1.dTP_NgayHieuLuc.Value;
                oQuyetDinh.Ngay_Het_Han = null;
                oQuyetDinh.MoTa = thongTinQuyetDinh1.rTB_MoTa.Text;
                #endregion

                try
                {
                    if (MessageBox.Show("Bạn thực sự muốn nhập quyết định thôi việc cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (oQuyetDinh.Update_CNVC_DungHopDong(strMaNV, strMaHD))
                        {
                            MessageBox.Show("Nhập thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                            MessageBox.Show("Thao tác nhập thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Thao tác nhập thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
                MessageBox.Show("Vui lòng nhập đầy đủ thông tin.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }
Exemple #9
0
        private void btn_Them_Click(object sender, EventArgs e)
        {
            if (CheckInputData())
            {
                #region Declare Variables
                oQuyetDinh = new Business.HDQD.QuyetDinh();
                bool Tham_Nien_Nang_Bac = false;
                bool Tham_Nien_Nha_Giao = false;
                bool Define_Cong_Thuc = false;
                //string Cong_Thuc = "";
                double? Phan_Tram_Cong_Thuc;
                bool Khong_Tinh_Luong = false;

                List<string> ma_nv = new List<string>();
                List<bool> ins_qtr_ctac = new List<bool>();
                List<int> don_vi_id = new List<int>();
                List<int> chuc_vu_id = new List<int>();
                List<int> chuc_danh_id = new List<int>();
                List<bool> co_phu_cap = new List<bool>();
                List<int> loai_pc_id = new List<int>();
                List<double> value_khoan = new List<double>();
                List<double> value_heso = new List<double>();
                List<double> value_phantram = new List<double>();
                List<double> phan_tram = new List<double>();
                List<DateTime> tu_ngay = new List<DateTime>();
                List<DateTime> den_ngay = new List<DateTime>();
                List<string> ghi_chu = new List<string>();

                #endregion

                #region Quyet Dinh Info
                oQuyetDinh.Ma_Quyet_Dinh = thongTinQuyetDinh1.txt_MaQD.Text;
                oQuyetDinh.Ten_Quyet_Dinh = thongTinQuyetDinh1.txt_TenQD.Text;
                try
                {
                    oQuyetDinh.Loai_QuyetDinh_ID = Convert.ToInt32(thongTinQuyetDinh1.comB_Loai.SelectedValue.ToString());
                }
                catch 
                {
                    oQuyetDinh.Loai_QuyetDinh_ID = null;
                }
                    
                //oQuyetDinh.Loai_QuyetDinh_ID = 7;
                oQuyetDinh.Ngay_Ky = thongTinQuyetDinh1.dTP_NgayKy.Value;
                oQuyetDinh.Ngay_Hieu_Luc = thongTinQuyetDinh1.dTP_NgayHieuLuc.Value;
                if (thongTinQuyetDinh1.dTP_NgayHetHan.Checked)
                    oQuyetDinh.Ngay_Het_Han = thongTinQuyetDinh1.dTP_NgayHetHan.Value;
                else
                    oQuyetDinh.Ngay_Het_Han = null;
                oQuyetDinh.MoTa = thongTinQuyetDinh1.rTB_MoTa.Text;
                #endregion

                Tham_Nien_Nang_Bac = cb_Tham_Nien_NB.Checked;
                Tham_Nien_Nha_Giao = cb_Tham_Nien_NG.Checked;

                #region Công thức tính lương Info
                if (rb_TinhLuong.Checked && rb_CT_Moi.Checked)
                {
                    Define_Cong_Thuc = true;
                    //Cong_Thuc = txt_CongThucLuong.Text;
                    Phan_Tram_Cong_Thuc = Convert.ToDouble(nup_Value_PhanTramLuong.Value);
                }
                else
                {
                    Define_Cong_Thuc = false;
                    chuoi_cong_thuc = null;
                    chuoi_cong_thuc_text = null;
                    Phan_Tram_Cong_Thuc = null;
                }

                if (rb_KhongTinhLuong.Checked)
                    Khong_Tinh_Luong = true;
                else
                    Khong_Tinh_Luong = false;
                #endregion

                foreach (DataRow dr in dtPhuCap.Rows)
                {
                    ma_nv.Add(dr["ma_nv"].ToString());

                    #region Quá trình ctác Info
                    ins_qtr_ctac.Add(Convert.ToBoolean(dr["ins_qtr_ctac"].ToString()));
                    if (dr["don_vi_id"].ToString() == "")
                        don_vi_id.Add(-1);
                    else
                        don_vi_id.Add(Convert.ToInt32(dr["don_vi_id"].ToString()));

                    if (dr["chuc_vu_id"].ToString() == "")
                        chuc_vu_id.Add(-1);
                    else
                        chuc_vu_id.Add(Convert.ToInt32(dr["chuc_vu_id"].ToString()));

                    if (dr["chuc_danh_id"].ToString() == "")
                        chuc_danh_id.Add(-1);
                    else
                        chuc_danh_id.Add(Convert.ToInt32(dr["chuc_danh_id"].ToString()));
                    #endregion

                    #region Phu Cap Info
                    bool m_co_pc = Convert.ToBoolean(dr["co_phu_cap"].ToString());
                    co_phu_cap.Add(m_co_pc);
                    if (m_co_pc)
                    {
                        int loaipc_id = Convert.ToInt16(dr["loai_pc_id"].ToString());
                        loai_pc_id.Add(loaipc_id);

                        int cach_tinh = Convert.ToInt16((from c in dtLoaiPC.AsEnumerable()
                                                         where c.Field<int>("id") == loaipc_id
                                                         select c.Field<int>("cach_tinh")).ElementAt(0).ToString());

                        switch (cach_tinh)
                        {
                            case 1:
                                if (dr["value_khoan"].ToString() == "")
                                    value_khoan.Add(-1);
                                else
                                    value_khoan.Add(Convert.ToDouble(dr["value_khoan"].ToString()));

                                value_heso.Add(-1);
                                value_phantram.Add(-1);
                                break;
                            case 2:
                                value_khoan.Add(-1);

                                if (dr["value_he_so"].ToString() == "")
                                    value_heso.Add(-1);
                                else
                                    value_heso.Add(Convert.ToDouble(dr["value_he_so"].ToString()));

                                value_phantram.Add(-1);
                                break;
                            case 3:
                                value_khoan.Add(-1);

                                if (dr["value_he_so"].ToString() == "")
                                    value_heso.Add(-1);
                                else
                                    value_heso.Add(Convert.ToDouble(dr["value_he_so"].ToString()));

                                value_phantram.Add(-1);
                                break;
                            case 4:
                                value_khoan.Add(-1);
                                value_heso.Add(-1);

                                if (dr["value_phan_tram"].ToString() == "")
                                    value_phantram.Add(-1);
                                else
                                    value_phantram.Add(Convert.ToDouble(dr["value_phan_tram"].ToString()));
                                break;
                            default:
                                break;
                        }
                        phan_tram.Add(Convert.ToDouble(dr["phan_tram_huong"].ToString()));
                        tu_ngay.Add(Convert.ToDateTime(dr["tu_ngay"].ToString()).Date);

                        if (dr["den_ngay"].ToString() == "")
                            den_ngay.Add(Convert.ToDateTime("01/01/1901").Date);
                        else
                            den_ngay.Add(Convert.ToDateTime(dr["den_ngay"].ToString()).Date);

                        ghi_chu.Add(dr["ghi_chu"].ToString());
                    }
                    else
                    {
                        loai_pc_id.Add(-1);
                        value_khoan.Add(-1);
                        value_heso.Add(-1);
                        value_phantram.Add(-1);
                        phan_tram.Add(-1);
                        tu_ngay.Add(Convert.ToDateTime("01/01/1901").Date);
                        den_ngay.Add(Convert.ToDateTime("01/01/1901").Date);
                        ghi_chu.Add("");
                    }
                    #endregion
                }

                if (IsUpdate == false)
                {
                    try
                    {
                        if (MessageBox.Show("Bạn thực sự muốn thêm quyết định cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (oQuyetDinh.Add_QuyetDinhChung(Tham_Nien_Nang_Bac, Tham_Nien_Nha_Giao, Define_Cong_Thuc, chuoi_cong_thuc_text, chuoi_cong_thuc,
                                                                Phan_Tram_Cong_Thuc, Khong_Tinh_Luong,
                                                                ma_nv.ToArray(), ins_qtr_ctac.ToArray(), don_vi_id.ToArray(), chuc_vu_id.ToArray(), chuc_danh_id.ToArray(),
                                                                co_phu_cap.ToArray(), loai_pc_id.ToArray(), value_khoan.ToArray(), value_heso.ToArray(),
                                                                value_phantram.ToArray(), phan_tram.ToArray(), tu_ngay.ToArray(), den_ngay.ToArray(), ghi_chu.ToArray()))
                            {
                                MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                                MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    try
                    {
                        if (MessageBox.Show("Bạn thực sự muốn cập nhật quyết định cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (oQuyetDinh.Update_QuyetDinhChung(m_ma_qd_old, Tham_Nien_Nang_Bac, Tham_Nien_Nha_Giao, Define_Cong_Thuc, chuoi_cong_thuc_text, chuoi_cong_thuc,
                                                                Phan_Tram_Cong_Thuc, Khong_Tinh_Luong,
                                                                ma_nv.ToArray(), ins_qtr_ctac.ToArray(), don_vi_id.ToArray(), chuc_vu_id.ToArray(), chuc_danh_id.ToArray(),
                                                                co_phu_cap.ToArray(), loai_pc_id.ToArray(), value_khoan.ToArray(), value_heso.ToArray(),
                                                                value_phantram.ToArray(), phan_tram.ToArray(), tu_ngay.ToArray(), den_ngay.ToArray(), ghi_chu.ToArray()))
                            {
                                MessageBox.Show("Cập nhật thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                                MessageBox.Show("Thao tác cập nhật thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Thao tác cập nhật thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            else
                MessageBox.Show("Vui lòng nhập đầy đủ thông tin.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }
Exemple #10
0
        private void InitObject(bool p_loadcbo_loaiqd)
        {
            oChucdanh = new ChucDanh();
            oChucvu = new ChucVu();
            oDonvi = new DonVi();
            oLoaiPC = new Business.HDQD.LoaiPhuCap();
            oQuyetDinh = new Business.HDQD.QuyetDinh();
            oLoaiQD = new Business.HDQD.LoaiQuyetDinh();
            ucDinhNghiaCT = new DinhNghiaCT();

            dtPhuCap = new DataTable();
            dtLoaiPC = new DataTable();

            dtLoaiPC = oLoaiPC.GetList_Cbo();
            PreapreDataSource();
            PrepareDataTablePhuCap();

            if (p_loadcbo_loaiqd)
            { LoadCbo_Loai_QD(); }

        }
Exemple #11
0
        private void btn_Nhap_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có muốn nhập quyết định này hay không ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (VerifyData())
                {
                    bool bUploadInfoSuccess = false;

                    Business.HDQD.QuyetDinh quyetdinh = new Business.HDQD.QuyetDinh();
                    quyetdinh.Ma_Quyet_Dinh = thongTinQuyetDinh1.txt_MaQD.Text;
                    quyetdinh.Ten_Quyet_Dinh = thongTinQuyetDinh1.txt_TenQD.Text;
                    quyetdinh.Loai_QuyetDinh_ID = Convert.ToInt16(thongTinQuyetDinh1.comB_Loai.SelectedValue);
                    quyetdinh.Ngay_Ky = thongTinQuyetDinh1.dTP_NgayKy.Value;
                    quyetdinh.Ngay_Hieu_Luc = thongTinQuyetDinh1.dTP_NgayHieuLuc.Value;
                    if (thongTinQuyetDinh1.dTP_NgayHetHan.Checked == true)
                        quyetdinh.Ngay_Het_Han = thongTinQuyetDinh1.dTP_NgayHetHan.Value;
                    else
                        quyetdinh.Ngay_Het_Han = null;
                    quyetdinh.MoTa = thongTinQuyetDinh1.rTB_MoTa.Text;

                    try
                    {
                        int count = dsDonVi_new.Count;
                        string[] ten_don_vi_moi = new string[count];
                        string[] ten_dv_viet_tat = new string[count];
                        int[] dv_cha_id = new int[count];
                        DateTime[] tu_ngay = new DateTime[count];
                        string[] ghi_chu = new string[count];

                        for (int i = 0; i < dsDonVi_new.Count; i++)
                        {
                            DonVi dv = new DonVi();
                            dv = dsDonVi_new[i];

                            ten_don_vi_moi[i] = dv.TenDonVi;
                            ten_dv_viet_tat[i] = dv.TenDVVietTat;
                            if (dv.DVChaID != null)
                                dv_cha_id[i] = dv.DVChaID.Value;
                            else
                                dv_cha_id[i] = 0;
                            tu_ngay[i] = dv.TuNgay.Value;
                        }

                        quyetdinh.Add_ThanhLapDV(ten_don_vi_moi, ten_dv_viet_tat, dv_cha_id, ghi_chu, tu_ngay);
                        MessageBox.Show("Thành lập đơn vị thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        EnableControls(true);
                        bUploadInfoSuccess = true;
                        
                        if (Paths != null && Paths.Count > 0 && bUploadInfoSuccess)
                        {
                            UploadFile();
                        }
                        else
                        {
                            CleanUIData();
                        }

                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Thành lập đơn vị không thành công.\r\n" + ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                    MessageBox.Show("Vui lòng nhập đầy đủ thông tin của quyết định.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            
        }
Exemple #12
0
 public DanhSachQuyetDinh()
 {
     InitializeComponent();
     oQuyetDinh = new Business.HDQD.QuyetDinh();
     oLoaiQuyetDinh = new Business.HDQD.LoaiQuyetDinh();
 }
Exemple #13
0
        /// <summary>
        /// Refresh Data Source cho dtg sau moi lan thao tac
        /// </summary>
        private void RefreshDataSource()
        {
            Business.HDQD.QuyetDinh quyetdinh = new Business.HDQD.QuyetDinh();    // khong dung chung oChucVu duoc ???
            dtDSQuyetDinh = quyetdinh.Search_QD();
            PrepareDataSource();

        }
Exemple #14
0
        private void btn_Nhap_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có muốn nhập quyết định này hay không ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (VerifyData())
                {
                    bool bUploadInfoSuccess = false;

                    Business.HDQD.QuyetDinh quyetdinh = new Business.HDQD.QuyetDinh();
                    quyetdinh.Ma_Quyet_Dinh     = thongTinQuyetDinh1.txt_MaQD.Text;
                    quyetdinh.Ten_Quyet_Dinh    = thongTinQuyetDinh1.txt_TenQD.Text;
                    quyetdinh.Loai_QuyetDinh_ID = Convert.ToInt16(thongTinQuyetDinh1.comB_Loai.SelectedValue);
                    quyetdinh.Ngay_Ky           = thongTinQuyetDinh1.dTP_NgayKy.Value;
                    quyetdinh.Ngay_Hieu_Luc     = thongTinQuyetDinh1.dTP_NgayHieuLuc.Value;
                    if (thongTinQuyetDinh1.dTP_NgayHetHan.Checked == true)
                    {
                        quyetdinh.Ngay_Het_Han = thongTinQuyetDinh1.dTP_NgayHetHan.Value;
                    }
                    else
                    {
                        quyetdinh.Ngay_Het_Han = null;
                    }
                    quyetdinh.MoTa = thongTinQuyetDinh1.rTB_MoTa.Text;

                    try
                    {
                        int        count           = dsDonVi_new.Count;
                        string[]   ten_don_vi_moi  = new string[count];
                        string[]   ten_dv_viet_tat = new string[count];
                        int[]      dv_cha_id       = new int[count];
                        DateTime[] tu_ngay         = new DateTime[count];
                        string[]   ghi_chu         = new string[count];

                        for (int i = 0; i < dsDonVi_new.Count; i++)
                        {
                            DonVi dv = new DonVi();
                            dv = dsDonVi_new[i];

                            ten_don_vi_moi[i]  = dv.TenDonVi;
                            ten_dv_viet_tat[i] = dv.TenDVVietTat;
                            if (dv.DVChaID != null)
                            {
                                dv_cha_id[i] = dv.DVChaID.Value;
                            }
                            else
                            {
                                dv_cha_id[i] = 0;
                            }
                            tu_ngay[i] = dv.TuNgay.Value;
                        }

                        quyetdinh.Add_ThanhLapDV(ten_don_vi_moi, ten_dv_viet_tat, dv_cha_id, ghi_chu, tu_ngay);
                        MessageBox.Show("Thành lập đơn vị thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        EnableControls(true);
                        bUploadInfoSuccess = true;

                        if (Paths != null && Paths.Count > 0 && bUploadInfoSuccess)
                        {
                            UploadFile();
                        }
                        else
                        {
                            CleanUIData();
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Thành lập đơn vị không thành công.\r\n" + ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    MessageBox.Show("Vui lòng nhập đầy đủ thông tin của quyết định.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Exemple #15
0
 /// <summary>
 /// Refresh Data Source cho dtg sau moi lan thao tac
 /// </summary>
 private void RefreshDataSource()
 {
     Business.HDQD.QuyetDinh quyetdinh = new Business.HDQD.QuyetDinh();    // khong dung chung oChucVu duoc ???
     dtDSQuyetDinh = quyetdinh.Search_QD();
     PrepareDataSource();
 }
Exemple #16
0
        private void btn_Them_Click(object sender, EventArgs e)
        {
            if (CheckInputData())
            {
                #region Declare Variables
                oQuyetDinh = new Business.HDQD.QuyetDinh();
                bool Tham_Nien_Nang_Bac = false;
                bool Tham_Nien_Nha_Giao = false;
                bool Define_Cong_Thuc   = false;
                //string Cong_Thuc = "";
                double?Phan_Tram_Cong_Thuc;
                bool   Khong_Tinh_Luong = false;

                List <string>   ma_nv          = new List <string>();
                List <bool>     ins_qtr_ctac   = new List <bool>();
                List <int>      don_vi_id      = new List <int>();
                List <int>      chuc_vu_id     = new List <int>();
                List <int>      chuc_danh_id   = new List <int>();
                List <bool>     co_phu_cap     = new List <bool>();
                List <int>      loai_pc_id     = new List <int>();
                List <double>   value_khoan    = new List <double>();
                List <double>   value_heso     = new List <double>();
                List <double>   value_phantram = new List <double>();
                List <double>   phan_tram      = new List <double>();
                List <DateTime> tu_ngay        = new List <DateTime>();
                List <DateTime> den_ngay       = new List <DateTime>();
                List <string>   ghi_chu        = new List <string>();

                #endregion

                #region Quyet Dinh Info
                oQuyetDinh.Ma_Quyet_Dinh  = thongTinQuyetDinh1.txt_MaQD.Text;
                oQuyetDinh.Ten_Quyet_Dinh = thongTinQuyetDinh1.txt_TenQD.Text;
                try
                {
                    oQuyetDinh.Loai_QuyetDinh_ID = Convert.ToInt32(thongTinQuyetDinh1.comB_Loai.SelectedValue.ToString());
                }
                catch
                {
                    oQuyetDinh.Loai_QuyetDinh_ID = null;
                }

                //oQuyetDinh.Loai_QuyetDinh_ID = 7;
                oQuyetDinh.Ngay_Ky       = thongTinQuyetDinh1.dTP_NgayKy.Value;
                oQuyetDinh.Ngay_Hieu_Luc = thongTinQuyetDinh1.dTP_NgayHieuLuc.Value;
                if (thongTinQuyetDinh1.dTP_NgayHetHan.Checked)
                {
                    oQuyetDinh.Ngay_Het_Han = thongTinQuyetDinh1.dTP_NgayHetHan.Value;
                }
                else
                {
                    oQuyetDinh.Ngay_Het_Han = null;
                }
                oQuyetDinh.MoTa = thongTinQuyetDinh1.rTB_MoTa.Text;
                #endregion

                Tham_Nien_Nang_Bac = cb_Tham_Nien_NB.Checked;
                Tham_Nien_Nha_Giao = cb_Tham_Nien_NG.Checked;

                #region Công thức tính lương Info
                if (rb_TinhLuong.Checked && rb_CT_Moi.Checked)
                {
                    Define_Cong_Thuc = true;
                    //Cong_Thuc = txt_CongThucLuong.Text;
                    Phan_Tram_Cong_Thuc = Convert.ToDouble(nup_Value_PhanTramLuong.Value);
                }
                else
                {
                    Define_Cong_Thuc     = false;
                    chuoi_cong_thuc      = null;
                    chuoi_cong_thuc_text = null;
                    Phan_Tram_Cong_Thuc  = null;
                }

                if (rb_KhongTinhLuong.Checked)
                {
                    Khong_Tinh_Luong = true;
                }
                else
                {
                    Khong_Tinh_Luong = false;
                }
                #endregion

                foreach (DataRow dr in dtPhuCap.Rows)
                {
                    ma_nv.Add(dr["ma_nv"].ToString());

                    #region Quá trình ctác Info
                    ins_qtr_ctac.Add(Convert.ToBoolean(dr["ins_qtr_ctac"].ToString()));
                    if (dr["don_vi_id"].ToString() == "")
                    {
                        don_vi_id.Add(-1);
                    }
                    else
                    {
                        don_vi_id.Add(Convert.ToInt32(dr["don_vi_id"].ToString()));
                    }

                    if (dr["chuc_vu_id"].ToString() == "")
                    {
                        chuc_vu_id.Add(-1);
                    }
                    else
                    {
                        chuc_vu_id.Add(Convert.ToInt32(dr["chuc_vu_id"].ToString()));
                    }

                    if (dr["chuc_danh_id"].ToString() == "")
                    {
                        chuc_danh_id.Add(-1);
                    }
                    else
                    {
                        chuc_danh_id.Add(Convert.ToInt32(dr["chuc_danh_id"].ToString()));
                    }
                    #endregion

                    #region Phu Cap Info
                    bool m_co_pc = Convert.ToBoolean(dr["co_phu_cap"].ToString());
                    co_phu_cap.Add(m_co_pc);
                    if (m_co_pc)
                    {
                        int loaipc_id = Convert.ToInt16(dr["loai_pc_id"].ToString());
                        loai_pc_id.Add(loaipc_id);

                        int cach_tinh = Convert.ToInt16((from c in dtLoaiPC.AsEnumerable()
                                                         where c.Field <int>("id") == loaipc_id
                                                         select c.Field <int>("cach_tinh")).ElementAt(0).ToString());

                        switch (cach_tinh)
                        {
                        case 1:
                            if (dr["value_khoan"].ToString() == "")
                            {
                                value_khoan.Add(-1);
                            }
                            else
                            {
                                value_khoan.Add(Convert.ToDouble(dr["value_khoan"].ToString()));
                            }

                            value_heso.Add(-1);
                            value_phantram.Add(-1);
                            break;

                        case 2:
                            value_khoan.Add(-1);

                            if (dr["value_he_so"].ToString() == "")
                            {
                                value_heso.Add(-1);
                            }
                            else
                            {
                                value_heso.Add(Convert.ToDouble(dr["value_he_so"].ToString()));
                            }

                            value_phantram.Add(-1);
                            break;

                        case 3:
                            value_khoan.Add(-1);

                            if (dr["value_he_so"].ToString() == "")
                            {
                                value_heso.Add(-1);
                            }
                            else
                            {
                                value_heso.Add(Convert.ToDouble(dr["value_he_so"].ToString()));
                            }

                            value_phantram.Add(-1);
                            break;

                        case 4:
                            value_khoan.Add(-1);
                            value_heso.Add(-1);

                            if (dr["value_phan_tram"].ToString() == "")
                            {
                                value_phantram.Add(-1);
                            }
                            else
                            {
                                value_phantram.Add(Convert.ToDouble(dr["value_phan_tram"].ToString()));
                            }
                            break;

                        default:
                            break;
                        }
                        phan_tram.Add(Convert.ToDouble(dr["phan_tram_huong"].ToString()));
                        tu_ngay.Add(Convert.ToDateTime(dr["tu_ngay"].ToString()).Date);

                        if (dr["den_ngay"].ToString() == "")
                        {
                            den_ngay.Add(Convert.ToDateTime("01/01/1901").Date);
                        }
                        else
                        {
                            den_ngay.Add(Convert.ToDateTime(dr["den_ngay"].ToString()).Date);
                        }

                        ghi_chu.Add(dr["ghi_chu"].ToString());
                    }
                    else
                    {
                        loai_pc_id.Add(-1);
                        value_khoan.Add(-1);
                        value_heso.Add(-1);
                        value_phantram.Add(-1);
                        phan_tram.Add(-1);
                        tu_ngay.Add(Convert.ToDateTime("01/01/1901").Date);
                        den_ngay.Add(Convert.ToDateTime("01/01/1901").Date);
                        ghi_chu.Add("");
                    }
                    #endregion
                }

                if (IsUpdate == false)
                {
                    try
                    {
                        if (MessageBox.Show("Bạn thực sự muốn thêm quyết định cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (oQuyetDinh.Add_QuyetDinhChung(Tham_Nien_Nang_Bac, Tham_Nien_Nha_Giao, Define_Cong_Thuc, chuoi_cong_thuc_text, chuoi_cong_thuc,
                                                              Phan_Tram_Cong_Thuc, Khong_Tinh_Luong,
                                                              ma_nv.ToArray(), ins_qtr_ctac.ToArray(), don_vi_id.ToArray(), chuc_vu_id.ToArray(), chuc_danh_id.ToArray(),
                                                              co_phu_cap.ToArray(), loai_pc_id.ToArray(), value_khoan.ToArray(), value_heso.ToArray(),
                                                              value_phantram.ToArray(), phan_tram.ToArray(), tu_ngay.ToArray(), den_ngay.ToArray(), ghi_chu.ToArray()))
                            {
                                MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                            {
                                MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    try
                    {
                        if (MessageBox.Show("Bạn thực sự muốn cập nhật quyết định cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (oQuyetDinh.Update_QuyetDinhChung(m_ma_qd_old, Tham_Nien_Nang_Bac, Tham_Nien_Nha_Giao, Define_Cong_Thuc, chuoi_cong_thuc_text, chuoi_cong_thuc,
                                                                 Phan_Tram_Cong_Thuc, Khong_Tinh_Luong,
                                                                 ma_nv.ToArray(), ins_qtr_ctac.ToArray(), don_vi_id.ToArray(), chuc_vu_id.ToArray(), chuc_danh_id.ToArray(),
                                                                 co_phu_cap.ToArray(), loai_pc_id.ToArray(), value_khoan.ToArray(), value_heso.ToArray(),
                                                                 value_phantram.ToArray(), phan_tram.ToArray(), tu_ngay.ToArray(), den_ngay.ToArray(), ghi_chu.ToArray()))
                            {
                                MessageBox.Show("Cập nhật thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                            {
                                MessageBox.Show("Thao tác cập nhật thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Thao tác cập nhật thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            else
            {
                MessageBox.Show("Vui lòng nhập đầy đủ thông tin.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemple #17
0
 public DanhSachQuyetDinh()
 {
     InitializeComponent();
     oQuyetDinh     = new Business.HDQD.QuyetDinh();
     oLoaiQuyetDinh = new Business.HDQD.LoaiQuyetDinh();
 }
Exemple #18
0
        private void btn_Nhap_Click(object sender, EventArgs e)
        {
            if (thongTinQuyetDinh1.txt_MaQD.Text != "")
            {
                Business.HDQD.QuyetDinh quyetdinh = new Business.HDQD.QuyetDinh();
                quyetdinh.Ma_Quyet_Dinh = thongTinQuyetDinh1.txt_MaQD.Text;
                quyetdinh.Ten_Quyet_Dinh = thongTinQuyetDinh1.txt_TenQD.Text;
                quyetdinh.Loai_QuyetDinh_ID = Convert.ToInt16(thongTinQuyetDinh1.comB_Loai.SelectedValue);
                quyetdinh.Ngay_Ky = thongTinQuyetDinh1.dTP_NgayKy.Value;
                quyetdinh.Ngay_Hieu_Luc = thongTinQuyetDinh1.dTP_NgayHieuLuc.Value;
                if (thongTinQuyetDinh1.dTP_NgayHetHan.Checked == true)
                    quyetdinh.Ngay_Het_Han = thongTinQuyetDinh1.dTP_NgayHetHan.Value;
                else
                    quyetdinh.Ngay_Het_Han = null;
                quyetdinh.MoTa = thongTinQuyetDinh1.rTB_MoTa.Text;

                if (is_Tach_DV == true) // tach don vi
                {
                    #region Tách đơn vị
                    try
                    {
                        int count = dsDonVi_new.Count;
                        string[] ten_don_vi_moi = new string[count];
                        string[] ten_dv_viet_tat = new string[count];
                        int[] dv_cha_id = new int[count];
                        string[] tu_ngay = new string[count];
                        string[] ghi_chu = new string[count];
                        string[] ma_nv = new string[count];

                        for (int i = 0; i < dsDonVi_new.Count; i++)
                        {
                            DonVi dv = new DonVi();
                            dv = dsDonVi_new[i];

                            ten_don_vi_moi[i] = dv.TenDonVi;
                            ten_dv_viet_tat[i] = dv.TenDVVietTat;
                            if (dv.DVChaID != null)
                                dv_cha_id[i] = dv.DVChaID.Value;
                            else
                                dv_cha_id[i] = 0;
                            tu_ngay[i] = dv.TuNgay.Value.ToString("d", CultureInfo.CreateSpecificCulture("vi-VN"));

                            ma_nv[i] = dsCNVC[i];

                        }

                        int[] tu_don_vi = new int[1];
                        ComboBox cbo_DonVi = (ComboBox)tableLP_ComboTuDV.Controls[0];
                        if (cbo_DonVi.Text != "")
                            tu_don_vi[0] = Convert.ToInt16(cbo_DonVi.SelectedValue);
                        else
                        {
                            MessageBox.Show("Vui lòng chọn một đơn vị.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }

                        bool result = quyetdinh.MA_Tach_DonVi(tu_don_vi, ten_don_vi_moi, ten_dv_viet_tat, dv_cha_id, tu_ngay, ghi_chu, ma_nv);
                        if (result == true)
                            MessageBox.Show("Nhập quyết định tách đơn vị thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        else
                            MessageBox.Show("Nhập quyết định tách đơn vị không thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Nhập quyết định tách đơn vị không thành công.\r\n" + ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    #endregion
                }
                else // gộp đơn vị
                {
                    #region Gộp đơn vị
                    try
                    {
                        int[] tu_don_vi_id = new int[tableLP_ComboTuDV.RowCount];
                        for (int i = 0; i < tableLP_ComboTuDV.RowCount; i++)
                        {
                            tu_don_vi_id[i] = Convert.ToInt16(((ComboBox)tableLP_ComboTuDV.Controls[i * 2]).SelectedValue);
                        }

                        DonVi dv = new DonVi();
                        dv = dsDonVi_new[0];

                        string ten_dv_moi = dv.TenDonVi;
                        string ten_dv_viet_tat = dv.TenDVVietTat;
                        int? dv_cha_id = dv.DVChaID;
                        //if (comb_DVTrucThuoc.Text != "")
                        //    dv_cha_id = Convert.ToInt16(comb_DVTrucThuoc.SelectedValue);
                        string tu_ngay = dv.TuNgay.Value.ToString("d", CultureInfo.CreateSpecificCulture("vi-VN"));
                        string ghi_chu = dv.GhiChu;

                        bool result = quyetdinh.MA_Gop_DonVi(tu_don_vi_id, ten_dv_moi, ten_dv_viet_tat, dv_cha_id, tu_ngay, ghi_chu);
                        if (result == true)
                            MessageBox.Show("Nhập quyết định gộp đơn vị thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        else
                            MessageBox.Show("Nhập quyết định gộp đơn vị không thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Nhập quyết định gộp đơn vị không thành công.\r\n" + ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    #endregion

                }
            }
            else
                MessageBox.Show("Vui lòng nhập đầy đủ thông tin.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }