记录


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShopNum1.MultiBaseWebControl;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using ShopNum1.Factory;
using ShopNum1.BusinessLogic;
using ShopNum1.Common;

namespace WebControl
{
    [ParseChildren(true)]
    public class Getdrugstore : BaseWebControl
    {
        /// <summary>
        /// 品牌列表
        /// </summary>
        string skinFilename = "Getdrugstore.ascx"; // 指定默认皮肤样式

        Repeater RepeaterCity;
        Repeater RepeaterArea;
        HiddenField HiddenFiledCode2;
        public Getdrugstore()
        {
            if (SkinFilename == null)
                SkinFilename = skinFilename;
        }

        ShopNum1_City_Action cityaction = (ShopNum1_City_Action)LogicFactory.CreateShopNum1_City_Action();
        ShopNum1_ShopInfoList_Action shopinfo = (ShopNum1_ShopInfoList_Action)LogicFactory.CreateShopNum1_ShopInfoList_Action();
        protected override void InitializeSkin(System.Web.UI.Control skin)
        {

            RepeaterCity = (Repeater)skin.FindControl("RepeaterCity");
            RepeaterCity.ItemDataBound += new RepeaterItemEventHandler(RepeaterCity_ItemDataBound);

            if (!Page.IsPostBack) { }
            BindData();
        }

        void RepeaterCity_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                RepeaterArea = (Repeater)e.Item.FindControl("RepeaterArea");
                HiddenFiledCode2 = (HiddenField)e.Item.FindControl("HiddenFiledCode2");
                DataTable datatable2 = shopinfo.GetAreaPharmacyName(HiddenFiledCode2.Value);
                if (null != datatable2 && datatable2.Rows.Count > 0)
                {
                    RepeaterArea.DataSource = datatable2.DefaultView;
                    RepeaterArea.DataBind();
                }
            }
        }


        private void BindData()
        {
            //得到省份
            DataTable dataTable1 = cityaction.GetCityName();
            RepeaterCity.DataSource = dataTable1.DefaultView;
            RepeaterCity.DataBind();
        }

        /// <summary>
        /// 页面显示数目
        /// </summary>
        public string ShowCount { get; set; }
    }
}



cookie与session的区别
http://wenwen.soso.com/z/q131294137.htm

posted @ 2013-07-08 08:10  等一个晴天  阅读(183)  评论(0编辑  收藏  举报