public void FillRePort(object sender, DirectEventArgs e)
    {
        int ID = int.Parse(hdfMaBC.Text);
        MauBaoCaoDongInfo content = new MauBaoCaoDongController().GetContent(ID);

        htmlEditor.Text = content.ReportContent;
    }
    public void Update_Click(object sender, DirectEventArgs e)
    {
        int ID = int.Parse(hdfMaBC.Text);
        MauBaoCaoDongInfo content = new MauBaoCaoDongController().GetContent(ID);

        DAL.MauBaoCaoDong bcd = new DAL.MauBaoCaoDong();
        //htmlEditor.Text = content.ReportContent;
        bcd.ReportContent = htmlEditor.Text;
        bcd.EditedDate    = DateTime.Now;
        bcd.EditedBy      = CurrentUser.ID;
        bcd.ID            = ID;
        new MauBaoCaoDongController().Update(bcd);
        Dialog.ShowNotification("Cập nhật mẫu báo cáo: " + "\n" + content.ReportName.ToString() + " thành công");
    }
 public void BindData()
 {
     try
     {
         int ID = int.Parse(hdfmaBC.Text);
         MauBaoCaoDongInfo content1 = new MauBaoCaoDongController().GetContent(ID);
         string            rs       = content1.ReportContent;
         //string content = GetContent("HopDongDaoTaoMoi.html");
         HoSoInfo hs = new HoSoController().getHoSoReportHopDong(hdfMaCB.Text);
         if (hs != null)
         {
             DateTime today = DateTime.Now;
             string   rs1   = rs.Replace(HO_TEN, string.IsNullOrEmpty(hs.HOTEN) ? "..." : hs.HOTEN.ToString()).
                              Replace(MA_CB, string.IsNullOrEmpty(hs.MACB) ? "..." : hs.MACB.ToString()).
                              Replace(QT, string.IsNullOrEmpty(hs.TENNUOC) ? "..." : hs.TENNUOC).
                              Replace(NGAY_SINH, hs.NGAYSINH == null ? "..." : hs.NGAYSINH.Value.ToString("dd/MM/yyyy")).
                              Replace(NOI_SINH, string.IsNullOrEmpty(hs.NOISINH) ? "..." : hs.NOISINH).
                              Replace(THOI_HAN_HD, hs.THOIHANHOPDONG.Value.ToString("dd/MM/yyyy")).
                              Replace(NGAY_BN, hs.NGAYBNCHUCVU == null ? "..." : hs.NGAYBNCHUCVU.Value.ToString("dd/MM/yyyy")).
                              //Replace(NGHE_NGHIEP, string.IsNullOrEmpty(hs.TENCHUCVU) ? "..." : hs.TENCHUCVU).
                              Replace(CMTND, string.IsNullOrEmpty(hs.SOCMND) ? "..." : hs.SOCMND).
                              Replace(PHONG_BAN, string.IsNullOrEmpty(hs.PHONGBAN) ? "..." : hs.PHONGBAN).
                              Replace(DIA_CHI, string.IsNullOrEmpty(hs.DIACHILH) ? "..." : hs.DIACHILH).
                              Replace(MASO_THUE, string.IsNullOrEmpty(hs.MASOTHUE) ? "..." : hs.MASOTHUE).
                              Replace(LamTaiViTri, string.IsNullOrEmpty(hs.TENCHUCVU)? "..." : hs.TENCHUCVU).
                              Replace(CHUC_VU_MOI, string.IsNullOrEmpty(hs.TENCHUCVUMOI) ? "..." : hs.TENCHUCVUMOI).
                              Replace(NGAY_CAP, hs.NGAYCAPCMND == null ? "..." : hs.NGAYCAPCMND.Value.ToString("dd/MM/yyyy")).
                              Replace(NOI_CAP, string.IsNullOrEmpty(hs.NOICAPCMNTT) ? "..." : hs.NOICAPCMNTT).
                              Replace(BD_HDONG, hs.NGAYBATDAUHOPDONG == null ? "..." : hs.NGAYBATDAUHOPDONG.Value.ToString("dd/MM/yyyy")).
                              Replace(KT_HDONG, hs.NGAYKETTHUCHOPDONG == null ? "..." : hs.NGAYKETTHUCHOPDONG.Value.ToString("dd/MM/yyyy")).
                              //Replace(BD_TV_HD, hs.NGAYTUYENDTIEN == null ? "..." : hs.NGAYKETTHUCHOPDONG.Value.ToString("dd/MM/yyyy")).
                              ////Replace(VT_MOI, " " + hs.TENCHUCVUMOI).
                              Replace(KT_TV_HD, string.IsNullOrEmpty(hs.NGAYTUYENDTIEN.ToString()) ? "..." : hs.NGAYTUYENDTIEN.Value.Day + "/" + hs.THOIHANHOPDONG + hs.NGAYTUYENDTIEN.Value.Month + "/" + hs.NGAYTUYENDTIEN.Value.Year).
                              Replace(DAY, today.Day.ToString()).Replace(MONTH, today.Month.ToString()).Replace(YEAR, today.Year.ToString()).
                              Replace(GIAMDOC, " " + new HoSoController().GetNameTGD()).
                              Replace(NGAY_HIEN_TAI, today.Day.ToString() + "/" + today.Month.ToString() + "/" + today.Year.ToString()).
                              Replace(LUONG_CO_BAN, hs.MUCLUONG.ToString() == "" ? "......" : hs.MUCLUONG.ToString());
             htmlEditor.Value = rs1;
         }
         else
         {
             htmlEditor.Value = rs;
         }
     }
     catch (Exception ex)
     {
         Dialog.ShowError(ex.Message);
     }
 }