Пример #1
0
        private void InitializeDeliverType(int deliverTypeId)
        {
            IList <DeliverTypeInfo> enableDeliverTypeList = new List <DeliverTypeInfo>();

            enableDeliverTypeList           = DeliverType.GetEnableDeliverTypeList();
            this.DropDeliverType.DataSource = enableDeliverTypeList;
            this.DropDeliverType.DataBind();
            int    typeId = 0;
            string intro  = "";

            foreach (DeliverTypeInfo info in enableDeliverTypeList)
            {
                if (deliverTypeId > 0)
                {
                    if (info.TypeId != deliverTypeId)
                    {
                        continue;
                    }
                    typeId = info.TypeId;
                    intro  = info.Intro;
                    break;
                }
                if (info.IsDefault)
                {
                    typeId = info.TypeId;
                    intro  = info.Intro;
                    break;
                }
            }
            this.DropDeliverType.SelectedValue = typeId.ToString();
            this.LblDeliverTypeIntro.Text      = intro;
        }