protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            newbll = new NewBLL();
            advbll = new AdvertismentBLL();
            commmpanySummarybll = new CompanySummaryBLL();
            demandBll           = new SupplyDemandBLL();
            resDAL = new ResourceDAL();

            //首次加载,初始化页面信息
            rnd = (new Random()).NextDouble();
        }
        if (Request.Form["action"] != null)
        {
            switch (Request.Form["action"])
            {
            case "submit":
                GALogin();
                break;

            default:
                break;
            }
        }
        LoadNews();
        LoadSupplyDemand();
        LoadCompanySummaryIntro();
        LoadResource();
        LoadPicture();
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            commmpanybll  = new CompanySummaryBLL();
            demandBll     = new SupplyDemandBLL();
            currModel     = new DetailModel();
            previousModel = new DetailModel();
            nextModel     = new DetailModel();
        }

        try
        {
            id = Request.QueryString["Id"] == null ? 0 : Convert.ToInt32(Request.QueryString["Id"]);
            if (id < 1)
            {
                throw new Exception("参数[Id]无效!");
            }
            type = Request.QueryString["Type"];

            switch (type)
            {
            case "News":
                parentTitle = "新闻中心";
                LoadNews();
                break;

            case "SupplyDemand":
                parentTitle = "供求信息";
                LoadSupplyDemand();
                break;

            case "CompanyIntro":
                parentTitle = "通航企业";
                LoadCompanyIntro();
                break;

            default:
                throw new Exception("参数[Type]无效!");
            }
            GetCurrent();
        }
        catch (Exception ex)
        {
            Response.Write("<script>alert('" + ex.Message + "')</script>");
            return;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //首次加载,初始化数据
            newbll       = new NewBLL();
            commmpanybll = new CompanySummaryBLL();
            demandBll    = new SupplyDemandBLL();
            htmlHelper   = new HtmlWorkShop();
            resourceDAL  = new ResourceDAL();
            predicate    = PredicateBuilder.True <Resource>();
            predicate    = predicate.And(m => m.Status == 3).And(m => m.IsDeleted == 0);
        }

        try
        {
            type      = Request.QueryString["Type"];
            pageIndex = Convert.ToInt32(Request.QueryString["PageIndex"]);
            if (pageIndex < 1 || (pageIndex > totalPage && totalPage > 0))
            {
                throw new Exception("参数[PageIndex]无效!");
            }

            switch (type)
            {
            case "News":
                title = "新闻中心";
                LoadNews();
                break;

            case "SupplyDemand":
                title = "供求信息";
                LoadSupplyDemand();
                break;

            case "CompanyIntro":
                title = "通航企业";
                LoadCompanyIntro();
                break;

            case "File":
                title = "通航资料";
                LoadFile();
                break;

            case "Plan":
                title = "飞行计划";

                break;

            case "Weather":
                title = "气象";

                break;

            case "Information":
                title = "情报";

                break;

            case "Surveillance":
                title = "监视";

                break;

            default:
                throw new Exception("参数[Type]无效!");
            }
        }
        catch (Exception ex)
        {
            Response.Write("<script language='javascript'>alert('" + ex.Message + "');</script>");
            return;
        }
    }