示例#1
0
        /// <summary>
        /// 绑定门店城市
        /// </summary>
        void BindCity(int cid)
        {
            if (cid == 0)
            {
                ddlCity.Items.Add(new ListItem("请选择一级城市", "0"));
                ddlSubCity.Items.Add(new ListItem("请选择二级城市", "0"));
            }
            else
            {
                int parentId = bllcity.GetModel(cid).ParentId;

                DataSet ds = bllcity.GetList(0, "ParentId=0 and StateInfo=1", "SortNum desc,Id desc");

                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    ddlCity.Items.Add(new ListItem(item["Title"].ToString(), item["Id"].ToString()));
                }

                DataSet dssub = bllcity.GetList("StateInfo=1 and ParentId=" + parentId);
                ddlSubCity.Items.Clear();
                foreach (DataRow item in dssub.Tables[0].Rows)
                {
                    ddlSubCity.Items.Add(new ListItem(item["Title"].ToString(), item["Id"].ToString()));
                }

                ddlSubCity.SelectedValue = cid.ToString();
                ddlCity.SelectedValue    = parentId.ToString();
            }
        }
示例#2
0
        /// <summary>
        /// 绑定会员类别详细信息
        /// </summary>
        /// <param name="id"></param>
        void BindDetail(int id)
        {
            Leadin.Model.StoreCity model = blltype.GetModel(typeid);

            ddlType.SelectedValue = model.ParentId.ToString();
            txtRemark.Text        = model.Remark;
            txtSortNum.Text       = model.SortNum.ToString();
            txtTypeName.Text      = model.Title;
            ckState.Checked       = model.StateInfo == 1 ? true : false;
        }
示例#3
0
        /// <summary>
        /// 改变状态
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void repList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            //修改状态
            if (e.CommandName == "lbtnState")
            {
                Label lbid = e.Item.FindControl("lbid") as Label;

                Leadin.Model.StoreCity model = bll.GetModel(int.Parse(lbid.Text));

                if (model.StateInfo == 1)
                {
                    model.StateInfo = 0;
                }
                else
                {
                    model.StateInfo = 1;
                }

                bll.Update(model);
            }


            BindRepList();
        }
示例#4
0
        /// <summary>
        /// 绑定门店详细信息
        /// </summary>
        /// <param name="id"></param>
        void BindDetail(int id)
        {
            Leadin.Model.Store model = bll.GetModel(id);

            txtAddress.Text       = model.AddressInfo;
            txtBeginTime.Text     = model.BusinessTime;
            txtContent.Text       = model.Remark;
            txtfileico1.Text      = model.ImgUrl;
            txtName.Text          = model.Title;
            txtPayType.Text       = model.PayType;
            txtScope.Text         = model.Scope;
            txtSortNum.Text       = model.SortNum.ToString();
            ckHot.Checked         = model.IsHot == 1 ? true : false;
            ckIndex.Checked       = model.IsIndex == 1 ? true : false;
            ckRec.Checked         = model.IsRec == 1 ? true : false;
            ckState.Checked       = model.StateInfo == 1 ? true : false;
            ddlType.SelectedValue = model.StoreType.ToString();


            int parentId = bllcity.GetModel(model.City).ParentId;

            DataSet ds = bllcity.GetList(0, "ParentId=0 and StateInfo=1", "SortNum desc,Id desc");

            foreach (DataRow item in ds.Tables[0].Rows)
            {
                ddlCity.Items.Add(new ListItem(item["Title"].ToString(), item["Id"].ToString()));
            }

            DataSet dssub = bllcity.GetList("StateInfo=1 and ParentId=" + parentId);

            ddlSubCity.Items.Clear();
            foreach (DataRow item in dssub.Tables[0].Rows)
            {
                ddlSubCity.Items.Add(new ListItem(item["Title"].ToString(), item["Id"].ToString()));
            }

            ddlSubCity.SelectedValue = model.City.ToString();
            ddlCity.SelectedValue    = parentId.ToString();
        }
示例#5
0
 /// <summary>
 /// 获取城市名称
 /// </summary>
 /// <returns></returns>
 public string GetCityName(string id)
 {
     Leadin.Model.StoreCity model = bllStoreCity.GetModel(int.Parse(id));
     return(bllStoreCity.GetModel(model.ParentId).Title + model.Title);
 }