Beispiel #1
0
    //sự kiện sau khi ấn nút click trên thêm
    void ucChooseEmployee1_AfterClickAcceptButton(object sender, EventArgs e)
    {
        QuanLyThongTinBaoHiemController qlc = new QuanLyThongTinBaoHiemController();
        SelectedRowCollection           sm  = ucChooseEmployee1.SelectedRow;

        foreach (HOSO hs in sm.Select(item => new HoSoController().GetByMaCB(item.RecordID)))
        {
            txtMaCanBo.Text  = hs.MA_CB;
            txtSoCMND.Text   = hs.SO_CMND;
            dfNgaySinh.Value = hs.NGAY_SINH;
            txtGioiTinh.Text = hs.MA_GIOITINH == "F" ? "Nữ" : "Nam";
            txtHoTen.Text    = hs.HO_TEN;
            if (!string.IsNullOrEmpty(hs.MA_CHUCVU))
            {
                txtChucVu.Text = hs.DM_CHUCVU.TEN_CHUCVU;
            }
            if (!string.IsNullOrEmpty(hs.MA_NOICAP_CMND))
            {
                txtNoiCapCMND.Text = hs.DM_NOICAP_CMND.TEN_NOICAP_CMND;
            }
            txtDiaChi.Text = hs.DIA_CHI_LH;

            string   soquyetdinh, tenquyetdinh;
            DateTime?ngayky, Ngayhieuluc, Hethieuluc;
            decimal? luongbaohiem, phucapcv, phucaptnn, phucaptnvk, phucapkhac;
            new BaoHiemController().TTQuyetDinhLuongMoiNhat(int.Parse(hs.PR_KEY.ToString()), out soquyetdinh, out tenquyetdinh, out ngayky, out Ngayhieuluc, out Hethieuluc,
                                                            out luongbaohiem, out phucapcv, out phucaptnn, out phucaptnvk, out phucapkhac);

            nfLuongBaoHiem.Value = qlc.GetLuongDongBaoHiem(hs.PR_KEY);
            hdfPhuCap.Text       = phucapcv.ToString() + ";" + phucaptnn.ToString() + ";" + phucaptnvk.ToString() + ";" + phucapkhac.ToString();
            nfTongPhuCap.Value   = phucapcv + phucaptnn + phucaptnvk + phucapkhac;

            txtSoTheBHYT.Text = hs.SOTHE_BHYT;
            if (!string.IsNullOrEmpty(hs.SOTHE_BHXH))
            {
                cbbTrangThaiCapThe.SetValue("ChuaCapThe");
                hdfTrangThaiCapThe.SetValue("ChuaCapThe");
            }
            else
            {
                cbbTrangThaiCapThe.SetValue("DaCapThe");
                hdfTrangThaiCapThe.SetValue("DaCapThe");
            }
            ddfNoiDangKyKhamChuaBenh.Text = !string.IsNullOrEmpty(hs.MA_NOI_KCB) ? hs.DM_NOI_KCB.TEN_NOI_KCB : "";
            if (!util.IsDateNull(hs.NGAY_DONGBH))
            {
                cbbTuThangBHYT.Value = hs.NGAY_DONGBH.Value.Month;
                spinTuNamBHYT.Value  = hs.NGAY_DONGBH.Value.Year;
            }
            if (!util.IsDateNull(hs.NGAY_HETHAN_BHYT))
            {
                cbbDenThangBHYT.Value = hs.NGAY_HETHAN_BHYT.Value.Month;
                spinDenNamBHYT.Value  = hs.NGAY_HETHAN_BHYT.Value.Year;
            }
            if (!string.IsNullOrEmpty(hs.MA_NOICAP_BHXH))
            {
                txtNoiCapSoBHXH.Text = hs.DM_NOICAP_BHXH.TEN_NOICAP_BHXH;
            }

            if (!util.IsDateNull(hs.NGAY_DONGBH))
            {
                txtSoSoBHXH.Text = hs.SOTHE_BHXH;
            }

            cbbTrangthaiCapSo.SetValue(string.IsNullOrEmpty(hs.SOTHE_BHXH) ? "ChuaCapSo" : "DaCapSo");
            hdfTrangThaiCapSo.SetValue(string.IsNullOrEmpty(hs.SOTHE_BHXH) ? "ChuaCapSo" : "DaCapSo");
            if (!util.IsDateNull(hs.NGAYCAP_BHXH))
            {
                dfNgayCapSo.SelectedDate = (DateTime)hs.NGAYCAP_BHXH;
            }

            bool   bhxh, bhyt, bhtn;
            string tenloaihdong;

            qlc.GetHoSoHopDong(hs.PR_KEY, out bhxh, out bhyt, out bhtn, out tenloaihdong);
            txtLoaiHopDong.Text         = tenloaihdong;
            nfSoThangDongTruocThem.Text = "0";
            nfSoNamDongTruocThem.Text   = "0";

            chkBHXH.Checked = bhxh;
            chkBHYT.Checked = bhyt;
            chkBHTN.Checked = bhtn;
            if (bhxh == false)
            {
                RM.RegisterClientScriptBlock("rel1", "setDisableBHXH();");
            }
            else
            {
                RM.RegisterClientScriptBlock("rel2", "setEnableBHXH();");
            }
            if (bhyt == false)
            {
                RM.RegisterClientScriptBlock("rel3", "setDisableBHYT();");
            }
            else
            {
                RM.RegisterClientScriptBlock("rel4", "setEnableBHYT();");
            }
        }
    }