using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Mtxfw.VipSite { public partial class Admin_Member_EditArticle : Mtxfw.Utility.MemberBase { public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(""); public Mtxfw.DAL.Article daoArt = new Mtxfw.DAL.Article(); public String strTitle = "",strBody = ""; public int gtype = 0; protected override void OnLoad(EventArgs e) { base.OnLoad(e); string hostname = Request.Url.Host; if (!IsPostBack) { if (IFStores != 1) { Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx"); } Data_Bind(); } Btn_Update.Click += delegate(object s, EventArgs ex) { Int32 ID = int.Parse(Request.QueryString["ID"]); Mtxfw.Model.Article model = daoArt.GetModel(ID); model.Title = Text_Title.Text; model.CategoryId = "0"; model.AddTime = DateTime.Now; model.Content = Hidd_myEditor.Value; daoArt.Update(model); Model.User_CZ_log logmodel = new Model.User_CZ_log(); logmodel.MemberId = Card; logmodel.AddTime = DateTime.Now; logmodel.IP = Mtxfw.Utility.Common.GetIP; logmodel.Body = "修改" + model.Title + ""; logmodel.UType = 0; logmodel.gtype = gtype; new DAL.User_CZ_log().Add(logmodel); ClientScript.RegisterStartupScript(this.GetType(), "", ""); }; } protected void Data_Bind() { Hidd_Url.Value = Request.UrlReferrer.ToString(); if (Request.QueryString["ID"] != null) { Mtxfw.Model.Article model = daoArt.GetModel(int.Parse(Request.QueryString["ID"])); if (model != null) { Text_Title.Text = model.Title; strTitle = model.Title; Page.Title = strTitle + " - " + GetWebName; strBody = model.Content; } } } } }