protected void Page_Load(object sender, EventArgs e) { userId = Int32.Parse(Session["UserID"].ToString()); zhuanTiId = Int32.Parse(Request.QueryString["ztid"]); catTypeList = UserCategoryAccess.GetCategoryTypeList(userId); itemTypeList = ItemAccess.GetItemListType(); if (!IsPostBack) { BindGrid(); this.CatTypeEmpIns.DataSource = catTypeList; this.CatTypeEmpIns.DataTextField = "CategoryTypeName"; this.CatTypeEmpIns.DataValueField = "CategoryTypeID"; this.CatTypeEmpIns.DataBind(); if (Request.Cookies["CatTypeID"] != null) { this.CatTypeEmpIns.SelectedValue = Request.Cookies["CatTypeID"].Value; } this.ItemTypeEmpIns.DataSource = itemTypeList; this.ItemTypeEmpIns.DataTextField = "ItemTypeName"; this.ItemTypeEmpIns.DataValueField = "ItemTypeValue"; this.ItemTypeEmpIns.DataBind(); if (Session["TodayDate"] != null) { string today = Session["TodayDate"].ToString(); this.ItemBuyDateEmpIns.Text = today; } } }
protected void Page_Load(object sender, EventArgs e) { userId = Int32.Parse(Session["UserID"].ToString()); catTypeList = UserCategoryAccess.GetCategoryTypeList(userId); itemTypeList = ItemAccess.GetItemListType(); cardList = CardAccess.GetCardList(userId); if (Request.QueryString["date"] != null && Request.QueryString["date"] != "") { if (!ValidHelper.CheckDate(Request.QueryString["date"])) { Session["TodayDate"] = DateTime.Now.ToString("yyyy-MM-dd"); } else { Session["TodayDate"] = Request.QueryString["date"]; } } today = Session["TodayDate"].ToString(); if (!IsPostBack) { BindGrid(); this.CatTypeEmpIns.DataSource = catTypeList; this.CatTypeEmpIns.DataTextField = "CategoryTypeName"; this.CatTypeEmpIns.DataValueField = "CategoryTypeID"; this.CatTypeEmpIns.DataBind(); if (Request.Cookies["CatTypeID"] != null) { this.CatTypeEmpIns.SelectedValue = Request.Cookies["CatTypeID"].Value; } this.ItemTypeEmpIns.DataSource = itemTypeList; this.ItemTypeEmpIns.DataTextField = "ItemTypeName"; this.ItemTypeEmpIns.DataValueField = "ItemTypeValue"; this.ItemTypeEmpIns.DataBind(); //钱包 this.CardEmpIns.DataSource = cardList; this.CardEmpIns.DataTextField = "CardName"; this.CardEmpIns.DataValueField = "CardID"; this.CardEmpIns.DataBind(); if (Request.Cookies["CardID"] != null) { this.CardEmpIns.SelectedValue = Request.Cookies["CardID"].Value; } } }