/// <summary> /// 绑定模版详情 /// </summary> void BindDetail(int id) { Leadin.Model.DesignTemplate model = bll.GetModel(id); txtContent.Text = model.DetailRemark; txtCycle.Text = model.Cycle; txtDesign.Text = model.DesignRemark; txtfileico1.Text = model.ImgUrl; txtKey.Text = model.StrKey; txtName.Text = model.Title; txtPrice.Text = model.Price; txtPrint.Text = model.PrintRemark; txtSortNum.Text = model.SortNum.ToString(); txtTools.Text = model.Tools; ddlType.SelectedValue = model.TypeId.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; }
/// <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.DesignTemplate 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.DesignTemplate 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.DesignTemplate 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.DesignTemplate model = bll.GetModel(int.Parse(hidid.Value)); if (model.IsRec == 1) { model.IsRec = 0; } else { model.IsRec = 1; } bll.Update(model); } BindRepList(); }