private void Save() { YXShop.BLL.SystemInfo.ArticleChannel bll = new YXShop.BLL.SystemInfo.ArticleChannel(); YXShop.Model.SystemInfo.ArticleChannel model = new YXShop.Model.SystemInfo.ArticleChannel(); model.Description = this.txtDescription.Text; model.Name = this.txtName.Text; model.Shop = this.txtShop.SelectedValue; model.Type = this.ckbType.SelectedValue; model.ProjectName = this.txtProjectName.Text; model.ProjectUtil = this.txtProjectUtil.Text; model.Target = this.ckbTarget.SelectedValue; model.ExternalLink = this.txtAddress.Text.Trim().ToString(); model.MeteKey = this.txtMeteKey.Text; model.MeteDescription = this.txtMeteDescription.Text; model.DefaultTemplate = this.txtWebPagePath.Text; model.ListTemplate = this.txtListPageTemplate.Text; model.ContentTemplate = this.txtContentPageTemplate.Text; model.Power = ""; foreach (ListItem item in this.ckbPower.Items) { if (item.Selected) { model.Power = model.Power + item.Value + ","; } } if (this.txtId.Value.Equals("")) { this.txtId.Value = bll.GetMaxId(this.txtParentId.Value); } model.Id = txtId.Value; SOSOshop.Model.AdminInfo adminInfo = (SOSOshop.Model.AdminInfo)SOSOshop.BLL.AdministrorManager.Get(); if (adminInfo != null) { model.Users = adminInfo.AdminName; } if (bll.Exists(model.Id)) { bll.Update(model); } else { bll.Add(model); } model = null; bll = null; }
private void GetModel() { string id = ChangeHope.WebPage.PageRequest.GetQueryString("id"); YXShop.BLL.SystemInfo.ArticleChannel bll = new YXShop.BLL.SystemInfo.ArticleChannel(); YXShop.Model.SystemInfo.ArticleChannel model = bll.GetModel(id); if (model != null) { this.txtDescription.Text = model.Description; this.txtId.Value = model.Id; this.txtName.Text = model.Name; this.txtShop.SelectedValue = model.Shop; this.ckbType.SelectedValue = model.Type; if (model.Type == "2") { Page.RegisterStartupScript("ggg", "<script>changetype(2);</script>"); } this.txtProjectName.Text = model.ProjectName; this.txtProjectUtil.Text = model.ProjectUtil; this.ckbTarget.SelectedValue = model.Target; this.txtAddress.Text = model.ExternalLink; this.txtWebPagePath.Text = model.DefaultTemplate; this.txtListPageTemplate.Text = model.ListTemplate; this.txtContentPageTemplate.Text = model.ContentTemplate; //this.txtTemplate.Text = model.Template; this.txtMeteKey.Text = model.MeteKey; this.txtMeteDescription.Text = model.MeteDescription; this.txtWebPagePath.Text = model.DefaultTemplate; this.txtListPageTemplate.Text = model.ListTemplate; this.txtContentPageTemplate.Text = model.ContentTemplate; foreach (ListItem item in this.ckbPower.Items) { if (model.Power.IndexOf(item.Value + ",") >= 0) { item.Selected = true; } } } model = null; bll = null; }