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();
    }
예제 #2
0
        public void BindNewList()
        {
            NewBLL newsBll = new NewBLL();

            lvNewList.DataSource   = newsBll.GetNewList(searchType.Value, searchTitle.Value);
            lvNewList.DataKeyNames = new[] { "id" };
            lvNewList.DataBind();
        }
예제 #3
0
        protected void lvNewList_ItemDeleting(object sender, ListViewDeleteEventArgs e)
        {
            NewBLL newsBll = new NewBLL();

            if (newsBll.RemoveNew(e.Keys["id"].ToString()) == 1)
            {
                lvNewList.EditIndex = -1;
                BindNewList();
                return;
            }
            JsHelper.Alert("删除失败");
        }
예제 #4
0
        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lvNewList_ItemUpdating(object sender, ListViewUpdateEventArgs e)
        {
            NewModel newModel = new NewModel();

            newModel.id    = e.Keys["id"].ToString();
            newModel.title = e.NewValues["title"].ToString();
            //newModel.hit = e.NewValues["hit"].ToString();
            //newModel.tipe = e.NewValues["tipe"].ToString();
            newModel.time = e.NewValues["time"].ToString();

            NewBLL newsBll = new NewBLL();

            if (newsBll.UpdateNew(newModel) == 1)
            {
                lvNewList.EditIndex = -1;
                BindNewList();
                return;
            }
            JsHelper.Alert("更新失败");
        }
예제 #5
0
 public CangKuController(NewBLL bll, NPdao host)
 {
     _bll  = bll;
     _host = host;
 }
    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;
        }
    }