Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsCallback)
            {
                return;
            }
            if (Request.Cookies["UserCode"] == null || Request.Cookies["UserPassword"] == null)
            {
                Request.Cookies.Add(new HttpCookie("UserCode"));
                Request.Cookies.Add(new HttpCookie("UserPassword"));
            }
            String UserCode     = Request.Cookies["UserCode"].Value;
            String UserPassword = Request.Cookies["UserPassword"].Value;

            if (UserPassword == null || UserPassword == "")
            {
                //未登陆
                BUTTON_UserName.Value = "未登陆";
                LABEL_Rank.Text       = "";
            }
            else
            {
                UsersModel model = userBLL.ToModel(userBLL.LoginByUserCodePasswordReturnModel(UserCode, UserPassword))[0];
                //已经登录
                BUTTON_UserName.Value = model.UName;
                //LABEL_Rank.Text = "排名---1";
            }
            if (IsPostBack)
            {
                return;
            }
            List <ActionInfoModel> OldactionInfoModels = actionInfoBLL.ToModel(actionInfoBLL.SelectALL());
            List <ActionInfoModel> NewactionInfoModels = new List <ActionInfoModel>();

            foreach (ActionInfoModel model in OldactionInfoModels)
            {
                model.AName = (model.AName + "-----------开始时间:" + model.ABeginTime + "-----------结束时间:" + model.AEndTime).Replace("00:00:00", "");
                NewactionInfoModels.Add(model);
            }
            DROPDOWNLIST_ActionSelect.DataSource     = NewactionInfoModels;
            DROPDOWNLIST_ActionSelect.DataValueField = "AID";
            DROPDOWNLIST_ActionSelect.DataTextField  = "AName";
            DROPDOWNLIST_ActionSelect.DataBind();
            int AID = Convert.ToInt32(NotNullRequest("AID", 0));

            if (AID != 0)
            {
                DROPDOWNLIST_ActionSelect.SelectedValue = AID.ToString();
            }
            ReRoteUsersInfoRepeaterSourceByPage();
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            List <ActionInfoModel> OldactionInfoModels = actionInfoBLL.ToModel(actionInfoBLL.SelectALL());
            List <ActionInfoModel> NewactionInfoModels = new List <ActionInfoModel>();

            foreach (ActionInfoModel model in OldactionInfoModels)
            {
                model.AName = (model.AName + "-----------开始时间:" + model.ABeginTime + "-----------结束时间:" + model.AEndTime).Replace("00:00:00", "");
                NewactionInfoModels.Add(model);
            }
            DROPDOWNLIST_ActionSelect.DataSource     = NewactionInfoModels;
            DROPDOWNLIST_ActionSelect.DataValueField = "AID";
            DROPDOWNLIST_ActionSelect.DataTextField  = "AName";
            DROPDOWNLIST_ActionSelect.DataBind();
        }