82 lines
2.7 KiB
C#
82 lines
2.7 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Data.SqlClient;
|
|||
|
|
using System.Web;
|
|||
|
|
using System.Web.UI;
|
|||
|
|
using System.Web.UI.WebControls;
|
|||
|
|
|
|||
|
|
namespace Mtxfw.shop._Admin
|
|||
|
|
{
|
|||
|
|
public partial class admin_vip_gong_add2 : Mtxfw.Utility.AdminPage
|
|||
|
|
{
|
|||
|
|
public Mtxfw.DAL.Article daoArt = new Mtxfw.DAL.Article();
|
|||
|
|
public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
|||
|
|
public String TitName;
|
|||
|
|
protected override void OnLoad(EventArgs e)
|
|||
|
|
{
|
|||
|
|
base.OnLoad(e);
|
|||
|
|
|
|||
|
|
if (!IsPostBack)
|
|||
|
|
{
|
|||
|
|
Hidd_Url.Value = Request.UrlReferrer.ToString();
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (Request.QueryString["ID"] != null)
|
|||
|
|
{
|
|||
|
|
TitName = "回复信息";
|
|||
|
|
Mtxfw.Model.Article model = daoArt.GetModel(int.Parse(Request.QueryString["ID"]));
|
|||
|
|
string receiverid = "";
|
|||
|
|
SqlDataReader Dr = daoUser.GetUserName(model.senderid);
|
|||
|
|
if (Dr.Read())
|
|||
|
|
{
|
|||
|
|
receiverid = Dr["UserName"].ToString();
|
|||
|
|
}
|
|||
|
|
Dr.Close();
|
|||
|
|
Text_UserName.Text = receiverid;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else if (Request.QueryString["UserName"] != null)
|
|||
|
|
{
|
|||
|
|
TitName = "回复信息";
|
|||
|
|
Text_UserName.Text = Request.QueryString["UserName"].ToString();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Btn_Insert.Click += delegate(object s, EventArgs ex)
|
|||
|
|
{
|
|||
|
|
Mtxfw.Model.Article model = new Mtxfw.Model.Article();
|
|||
|
|
model.senderid = 3;
|
|||
|
|
int receiverid = 0;
|
|||
|
|
SqlDataReader Dr = daoUser.GetUserId(Text_UserName.Text);
|
|||
|
|
if (Dr.Read())
|
|||
|
|
{
|
|||
|
|
receiverid = int.Parse(Dr["Id"].ToString());
|
|||
|
|
}
|
|||
|
|
Dr.Close();
|
|||
|
|
model.receiverid = receiverid;
|
|||
|
|
model.Title = Text_Title.Text;
|
|||
|
|
model.ParentID = 8;
|
|||
|
|
model.CategoryId = "0";
|
|||
|
|
model.AddTime = DateTime.Now;
|
|||
|
|
model.Author = IdentityName;
|
|||
|
|
model.Content = Text_Content.Text;
|
|||
|
|
model.Paths = "";
|
|||
|
|
model.Seef = 1;
|
|||
|
|
model.wtype = 0;
|
|||
|
|
model.LinkID = 0;
|
|||
|
|
model.Content2 = "";
|
|||
|
|
model.KeyWords = "";
|
|||
|
|
model.Paths2 = "";
|
|||
|
|
model.media_id = "";
|
|||
|
|
model.thumb_media_id = "";
|
|||
|
|
daoArt.Add(model);
|
|||
|
|
Mtxfw.Utility.Tools.Message("发送成功!", Hidd_Url.Value);
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|