Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                attachLogic = new AttachmentLogic();

                if (!IsPostBack)
                {
                    try
                    {
                        bindingDDLs();
                        bindingDDLCoQuan();
                        bindingDDLPhong();
                        //searchAll();
                    }
                    catch (Exception ex)
                    {
                        Logger.logmessage(classobject, "Page_Load", ex.Message + ex.StackTrace); Response.Redirect("~/ThongBaoLoi.aspx", false);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("PageLoad error: ", ex);
                Response.Redirect("~/ThongBaoLoi.aspx", false);
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                txtHop.Attributes.Add("OnKeyPress", "if (event.keyCode == 13) {" + ClientScript.GetPostBackEventReference(txtHop, String.Empty) + "}");
                logic                = new VanBanHoSoLogic();
                attachLogic          = new AttachmentLogic();
                lstCoQuan            = logic.getAllCoQuan();
                lstDoMat             = logic.getAllDoMat();
                lstLoaiVanBan        = logic.getAllLoaiVanBan();
                dgvApprover.PageSize = Constants.GRIDVIEW_PAGE_SIZE;
                if (!IsPostBack)
                {
                    string hoSoId  = Request["HoSoID"];
                    string phongId = Request["PhongID"];
                    string hop     = Request["Hop"];
                    hidPageIndex.Value = "1";

                    hidHoSoID.Value = hoSoId;
                    if (hoSoId != null && hoSoId.Trim().Length > 0)
                    {
                        Su_HoSo hoSoObj = logic.findHoSoById(hoSoId);
                        if (hoSoObj != null)
                        {
                            string         maP      = hoSoObj.MaPhong;
                            Su_PhongLuuTru phongObj = logic.findPhongByMaPhong(maP);
                            if (phongObj != null)
                            {
                                phongId = phongObj.MaPhong;
                            }
                            hop = hoSoObj.HopSo;
                        }
                    }
                    resetField(phongId, hop, hoSoId);
                    currentHS = hoSoId;
                }
                else
                {
                    Control postBackCtrl = GetPostBackControl(Page);
                    if (postBackCtrl != null && "txtHop".Equals(postBackCtrl.ID))
                    {
                        string phongId = ddlPhong.SelectedValue;
                        string hop     = txtHop.Text;
                        string hoSoId  = "";
                        resetField(phongId, hop, hoSoId);
                    }
                }
                Int32.TryParse(hidPageIndex.Value, out pageIndex);
                if (currentHS != null && currentHS.Trim().Length > 0)
                {
                    loadDataToGridView(currentHS);
                }
            }
            catch (Exception ex)
            {
                logger.Error("PageLoad error: ", ex);
                Response.Redirect("~/ThongBaoLoi.aspx", false);
            }
        }
Пример #3
0
 public ArticleController(IRepository repo, AttachmentLogic attachmentLogic)
 {
     _repo            = repo;
     _attachmentLogic = attachmentLogic;
 }