using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//必须引入命名空间
using DotNet.FrameWork.Utils;
using DotNet.FrameWork.Common.Web;
using DotNet.FrameWork.Page;
using DotNet.FrameWork.Data;
using GetCommand;

namespace HteamDd.Web.Admin
{
    public partial class Admin_suggest_view :BaseAdminUI
    {
        HaTeam.Dd.BLL.Dd_Suggest bll = new HaTeam.Dd.BLL.Dd_Suggest();
        HaTeam.Dd.Model.Dd_Suggest model = new HaTeam.Dd.Model.Dd_Suggest();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Fetch.Get("action") != null && Fetch.Get("suggest_id") != null)
                {
                    if (Fetch.Get("action").ToString() == "edit")
                    {
                        ShowInfo(int.Parse(Request.QueryString["suggest_id"].ToString()));
                    }
                }
            }
       }
        public void ShowInfo(int id)
        {
            model = bll.GetModel(id);
            txtName.Text = GetNameByID().ToString();
            txtMail.Text = GetEmailByID().ToString();
            txtContent.Text = model.Suggest_Content;
        }
        /// <summary>
        /// 根据用户ID获得用户博客名
        /// </summary>
        /// <returns></returns>
        public string GetNameByID()
        {
            string str = "select user_blogname from dd_user where user_id =" + int.Parse(Fetch.Get("user_id"));
            string name = Convert.ToString(DbHelperSQL.GetSingle(str));
            return name;
        }
        public string GetEmailByID()
        {
            string str = "select user_email from dd_user where user_id =" + int.Parse(Fetch.Get("user_id"));
            string name = Convert.ToString(DbHelperSQL.GetSingle(str));
            return name;
        }
    }
}