using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.Model; using CY.BLL; using CY.Infrastructure.Common; using System.Data; using CY.BLL.Sys; namespace CY.WebForm.Pages.member { //吴辉 //添加/修改业绩案例 public partial class SuccessEXEdit : BasePage { Info_SortBLL bll_Info_SortBLL = null; Info_ContentBLL bll_Info_ContentBLL = null; Sys_DictionaryBLL bll_Sys_DictionaryBLL = null; //初始化 public SuccessEXEdit() { bll_Info_SortBLL = new Info_SortBLL(); bll_Info_ContentBLL = new Info_ContentBLL(); bll_Sys_DictionaryBLL = new Sys_DictionaryBLL(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitData(); } } //页面加载 public void InitData() { this.selSortId.Items.Clear(); this.selSortId.Items.Insert(0, new ListItem("业绩案例", bll_Sys_DictionaryBLL.GetKeyIdByKeyid(8, "网站资讯类型").ToString2())); Info_Content m_Info_Content = new Info_Content(); if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0) m_Info_Content = bll_Info_ContentBLL.SelectModelBySortId(Request["Keyid"].ToInt32()); this.txtTitle.Value = m_Info_Content.Title.ToString2(); this.selSortId.Value = m_Info_Content.SortID.ToString2(); this.txtInfoContent.Text = m_Info_Content.InfoContent.ToString2(); this.txtOrderNum.Value = m_Info_Content.OrderNum.ToString2(); } //提交事件 protected void btn_Submit_form(object sender, EventArgs e) { Info_Content m_Info_Content = new Info_Content(); if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0) m_Info_Content = bll_Info_ContentBLL.SelectModelBySortId(Request["Keyid"].ToInt32()); m_Info_Content.Title = this.txtTitle.Value.ToString2(); m_Info_Content.Title_Bold = false; m_Info_Content.Title_Color = ""; m_Info_Content.SortID = this.selSortId.Value.ToInt32(); m_Info_Content.Keyword = this.txtTitle.Value.ToString2(); m_Info_Content.MeteDesc = this.txtTitle.Value.ToString2(); m_Info_Content.FromSource = ""; m_Info_Content.Author = ""; m_Info_Content.WebLink = ""; m_Info_Content.IsRecommendation = false; m_Info_Content.IsTop = false; m_Info_Content.InfoContent = this.txtInfoContent.Text.ToString2(); m_Info_Content.OrderNum = this.txtOrderNum.Value.ToInt32(); m_Info_Content.UpTime = DateTime.Now; if (Request["Keyid"] != null && Request["Keyid"].ToInt32() > 0) { if (bll_Info_ContentBLL.UpdateModel(m_Info_Content)) JavaScript.MessageBox("更新成功", this, true, true); else JavaScript.MessageBox("更新失败", this); } else { m_Info_Content.MemberId = CurrentUser.MemberId; m_Info_Content.Star = 0; m_Info_Content.Hits = 0; m_Info_Content.GoodNum = 0; m_Info_Content.MediumNum = 0; m_Info_Content.BadNum = 0; m_Info_Content.CreatTime = DateTime.Now; m_Info_Content.TypeId = bll_Sys_DictionaryBLL.GetKeyIdByKeyid(8, "网站资讯类型").ToInt32(); if (bll_Info_ContentBLL.InsertModel(m_Info_Content)) JavaScript.MessageBox("新增成功", this, true, true); else JavaScript.MessageBox("新增失败", this); } } } }