using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace JuSNS.Web.inc.Ajax.gift
{
    public partial class getinfo : JuSNS.UI.Page.UserPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["r"];
            string t = Request.QueryString["t"];
            string resultStr = string.Empty;
            JuSNS.Home.Gift gt = new JuSNS.Home.Gift();
            if (JuSNS.Common.Input.IsInteger(id))
            {
                if (t == "1")
                {
                    resultStr += "<div class=\"f_box1\"><div class=\"boxtitle chengse\">";
                    resultStr += "<div class=\"nl bold\">附言</div>";
                    resultStr += "<div class=\"nr\"><a href=\"javascript:void(0);\" onclick=\"closediv($('gift_idwindow_"+id+"'));\">关闭</a></div></div>";
                    resultStr += "<div class=\"content pstr padding10\" style=\"padding:10px 10px 20px 10px;\">";
                    IDataReader dr = gt.GiftUserInfo(Convert.ToInt32(id));
                    if (dr.Read())
                    {
                        resultStr += dr["content"].ToString();
                    }
                    dr.Close(); dr.Dispose();
                    resultStr += "</div></div>";
                    Response.Write(resultStr);
                    Response.End();
                }
                else
                {
                    IDataReader dr = gt.GiftInfo(Convert.ToInt32(id));
                    if (dr.Read())
                    {
                        resultStr += "<div class=\"pstr\"><img src=\"" + rooDir + "/template/images/gift/" + dr["picture"].ToString() + "\" /></div>";
                        resultStr += "<div class=\"cpstr padding10\"><strong>" + dr["gName"].ToString() + "</strong> <span class=\"c999\">(需要积分：" + dr["point"].ToString() + ")</span></div>";
                        resultStr += "<div class=\"cpstr padding10 reshow\">" + dr["content"].ToString() + "<input id=\"gIDhidden\" value=\"" + id + "\" type=\"hidden\" /></div>";
                    }
                    dr.Close(); dr.Dispose();
                    Response.Write(resultStr);
                    Response.End();
                }
            }
            else
            {
                Response.Write("错误的参数");
                Response.End();
            }

        }
    }
}
