//private List<su_dinhkiemvanban> lstAttachment = new List<su_dinhkiemvanban>();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    bindingDDLs();
                    if (Session[VanBanTrongHoSoLogic.SESSION_SEC_ID] != null)
                    {
                        btAddApprover.Text = "Cập nhật";
                        ldhead.InnerText   = "CHI TIẾT VĂN BẢN TRONG HỒ SƠ";

                        sec = um.getVanBanTrongHoSo(Int32.Parse(Session[VanBanTrongHoSoLogic.SESSION_SEC_ID].ToString()));
                        if (sec != null)
                        {
                            ddlCoQuan.SelectedValue      = sec.Coquan;
                            ddlPhong.SelectedValue       = sec.MaPhong;
                            ddlMucLuc.SelectedValue      = sec.MucLucSo;
                            ddlNgonNgu.SelectedValue     = sec.NgonNgu;
                            txtHoSoSo.Text               = sec.HoSoSo;
                            txtKyHieu.Text               = sec.KyHieuVanBan;
                            txtGhiChu.Text               = sec.GhiChu;
                            txtButtich.Text              = sec.ButTich;
                            txtSoluongto.Text            = sec.SoLuongTo;
                            txtThoiGian.Text             = sec.ThoiGian;
                            txtKyhieuThongtin.Text       = sec.KiHieuThongTin;
                            txtToSo.Text                 = sec.ToSo;
                            txtTrichYeu.Text             = sec.TrichYeu;
                            txtTacgia.Text               = sec.TacGia;
                            ddlLoaivanban.SelectedValue  = sec.LoaiVanBan;
                            ddlMucDoTinCay.SelectedValue = sec.MucDoTinCay;
                            ddlDomat.SelectedValue       = sec.DoMat;
                            ddlTinhTrang.SelectedValue   = sec.TinhTrangVatLy;
                            // fileUrl = "http://" +  Request.Url.Host + ":" + Request.Url.Port + "/files/" + sec.FilePath;
                            //fileUrl = "files/" + sec.FilePath;
                            //fileName = sec.FilePath;
                            List <Su_Attachment> lstAttach = attachLogic.getAttachment(AttachmentLogic.ATTACHMENT_TYPE_VB, sec.ID);
                            rptDocs.DataSource = lstAttach;
                            rptDocs.DataBind();
                        }
                    }
                    else
                    {
                        ldhead.InnerText = "THÊM MỚI VĂN BẢN TRONG HỒ SƠ";
                        sec = new VanBanTrongHoSo();
                    }
                }
                catch (Exception ex)
                {
                    Logger.logmessage(classobject, "Page_Load", ex.Message + ex.StackTrace);  Response.Redirect("~/ThongBaoLoi.aspx", false);
                }
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bindingDDLs();
                if (Session[VanBanTrongHoSoLogic.SESSION_SEC_ID] != null)
                {
                    btAddApprover.Text = "Cập nhật";
                    ldhead.InnerText   = "CHỈNH SỬA VĂN BẢN TRONG HỒ SƠ";

                    sec = um.getVanBanTrongHoSo(Int32.Parse(Session[VanBanTrongHoSoLogic.SESSION_SEC_ID].ToString()));
                    if (sec != null)
                    {
                        ddlCoQuan.SelectedValue      = sec.Coquan;
                        ddlPhong.SelectedValue       = sec.MaPhong;
                        ddlMucLuc.SelectedValue      = sec.MucLucSo;
                        ddlNgonNgu.SelectedValue     = sec.NgonNgu;
                        txtHoSoSo.Text               = sec.HoSoSo;
                        txtKyHieu.Text               = sec.KyHieuVanBan;
                        txtGhiChu.Text               = sec.GhiChu;
                        txtButtich.Text              = sec.ButTich;
                        txtSoluongto.Text            = sec.SoLuongTo;
                        txtThoiGian.Text             = sec.ThoiGian;
                        txtKyhieuThongtin.Text       = sec.KiHieuThongTin;
                        txtToSo.Text                 = sec.ToSo;
                        txtTrichYeu.Text             = sec.TrichYeu;
                        txtTacgia.Text               = sec.TacGia;
                        ddlLoaivanban.SelectedValue  = sec.LoaiVanBan;
                        ddlMucDoTinCay.SelectedValue = sec.MucDoTinCay;
                        ddlDomat.SelectedValue       = sec.DoMat;
                        ddlTinhTrang.SelectedValue   = sec.TinhTrangVatLy;
                        fileUrl  = Request.Url.Host + "/files/" + sec.FilePath;
                        fileName = sec.FilePath;
                    }
                }
                else
                {
                    ldhead.InnerText = "THÊM MỚI VĂN BẢN TRONG HỒ SƠ";
                    sec = new VanBanTrongHoSo();
                }
            }
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    bindingDDLs();
                    if (Request.QueryString["hid"] != null)
                    {
                        hs                      = hsLogic.getHoSo(Int32.Parse(Request.QueryString["hid"].ToString()));
                        hidHoSo.Value           = Request.QueryString["hid"].ToString();
                        ddlCoQuan.SelectedValue = hs.Coquan;
                        txtMucLuc.Text          = hs.MucLucSo;
                        ddlPhong.SelectedValue  = hs.MaPhong;
                        txtHoSoSo.Text          = hs.HoSoSo;
                    }
                    if (Session[VanBanTrongHoSoLogic.SESSION_SEC_ID] != null)
                    {
                        btAddApprover.Text = "Cập nhật tiếp tục đính kèm";
                        ldhead.InnerText   = "CHỈNH SỬA VĂN BẢN TRONG HỒ SƠ";

                        sec = um.getVanBanTrongHoSo(Int32.Parse(Session[VanBanTrongHoSoLogic.SESSION_SEC_ID].ToString()));
                        if (sec != null)
                        {
                            hidHoSo.Value                = sec.Hoso_ID;
                            ddlCoQuan.SelectedValue      = sec.Coquan;
                            ddlPhong.SelectedValue       = sec.MaPhong;
                            txtMucLuc.Text               = hs.MucLucSo;
                            ddlNgonNgu.SelectedValue     = sec.NgonNgu;
                            txtHoSoSo.Text               = sec.HoSoSo;
                            txtKyHieu.Text               = sec.KyHieuVanBan;
                            txtGhiChu.Text               = sec.GhiChu;
                            txtButtich.Text              = sec.ButTich;
                            txtSoluongto.Text            = sec.SoLuongTo;
                            txtThoiGian.Text             = sec.ThoiGian;
                            txtKyhieuThongtin.Text       = sec.KiHieuThongTin;
                            txtToSo.Text                 = sec.ToSo;
                            txtTrichYeu.Text             = sec.TrichYeu;
                            txtTacgia.Text               = sec.TacGia;
                            ddlLoaivanban.SelectedValue  = sec.LoaiVanBan;
                            ddlMucDoTinCay.SelectedValue = sec.MucDoTinCay;
                            ddlDomat.SelectedValue       = sec.DoMat;
                            ddlTinhTrang.SelectedValue   = sec.TinhTrangVatLy;
                            List <Su_Attachment> lstAttach = attachLogic.getAttachment(AttachmentLogic.ATTACHMENT_TYPE_VB, sec.ID);
                            dgvAttachment.DataSource = lstAttach;
                            dgvAttachment.DataBind();
                            if (sec.ThoiHanBaoQuan != null && sec.ThoiHanBaoQuan.Length > 0)
                            {
                                ddlThoiHan.SelectedValue = sec.ThoiHanBaoQuan;
                            }
                        }
                        else
                        {
                            string mss = HtmlUtil.getErrorTag("Không tìm thấy văn bản.");
                            Logger.logmessage(classobject, "Page_Load", "Khong tim thay van ban: " + Session[VanBanTrongHoSoLogic.SESSION_SEC_ID].ToString());
                        }
                    }
                    else
                    {
                        ldhead.InnerText = "THÊM MỚI VĂN BẢN TRONG HỒ SƠ";
                        sec = new VanBanTrongHoSo();
                        if (Session[VanBanTrongHoSoLogic.SESSION_VANBAN_CACHE] != null)
                        {
                            VanBanTrongHoSo temp = (VanBanTrongHoSo)Session[VanBanTrongHoSoLogic.SESSION_VANBAN_CACHE];
                            if (temp != null)
                            {
                                txtKyhieuThongtin.Text = temp.KiHieuThongTin;
                                txtSoluongto.Text      = temp.SoLuongTo;
                                txtThoiGian.Text       = temp.ThoiGian;
                                if (temp.NgonNgu != null && temp.NgonNgu.Length > 0)
                                {
                                    ddlNgonNgu.SelectedValue = temp.NgonNgu;
                                }
                                txtToSo.Text     = temp.ToSo;
                                txtTrichYeu.Text = temp.TrichYeu;
                                if (temp.LoaiVanBan != null && temp.LoaiVanBan.Length > 0)
                                {
                                    ddlLoaivanban.SelectedValue = temp.LoaiVanBan;
                                }
                                if (temp.DoMat != null && temp.DoMat.Length > 0)
                                {
                                    ddlDomat.SelectedValue = temp.DoMat;
                                }
                                txtTacgia.Text  = temp.TacGia;
                                txtButtich.Text = temp.ButTich;
                                if (temp.MucDoTinCay != null && temp.MucDoTinCay.Length > 0)
                                {
                                    ddlMucDoTinCay.SelectedValue = temp.MucDoTinCay;
                                }
                                if (temp.ThoiHanBaoQuan != null && temp.ThoiHanBaoQuan.Length > 0)
                                {
                                    ddlThoiHan.SelectedValue = temp.ThoiHanBaoQuan;
                                }
                                txtGhiChu.Text = temp.GhiChu;
                                if (temp.TinhTrangVatLy != null && temp.TinhTrangVatLy.Length > 0)
                                {
                                    ddlTinhTrang.SelectedValue = temp.TinhTrangVatLy;
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Logger.logmessage(classobject, "Page_Load", ex.Message + ex.StackTrace); Response.Redirect("~/ThongBaoLoi.aspx", false);
                }
            }
        }