/// <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(); }
/// <summary> /// 属性改变 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void repList_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "lbtnState")//修改状态 { HiddenField hidid = e.Item.FindControl("hidid") as HiddenField; Leadin.Model.Store model = bll.GetModel(int.Parse(hidid.Value)); if (model.StateInfo == 1) { model.StateInfo = 0; } else { model.StateInfo = 1; } bll.Update(model); } if (e.CommandName == "lbtnIndex")//修改是否首页显示 { HiddenField hidid = e.Item.FindControl("hidid") as HiddenField; Leadin.Model.Store model = bll.GetModel(int.Parse(hidid.Value)); if (model.IsIndex == 1) { model.IsIndex = 0; } else { model.IsIndex = 1; } bll.Update(model); } if (e.CommandName == "lbtnhot")//修改是否热门显示 { HiddenField hidid = e.Item.FindControl("hidid") as HiddenField; Leadin.Model.Store model = bll.GetModel(int.Parse(hidid.Value)); if (model.IsHot == 1) { model.IsHot = 0; } else { model.IsHot = 1; } bll.Update(model); } if (e.CommandName == "lbtnRec")//修改是否推荐显示 { HiddenField hidid = e.Item.FindControl("hidid") as HiddenField; Leadin.Model.Store model = bll.GetModel(int.Parse(hidid.Value)); if (model.IsRec == 1) { model.IsRec = 0; } else { model.IsRec = 1; } bll.Update(model); } BindList(); }