using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace HteamDd.Web.ashx
{
    /// <summary>
    /// Dd_suggest 的摘要说明
    /// </summary>
    public class Dd_suggest : IHttpHandler
    {
        HaTeam.Dd.Model.Dd_Suggest model = new HaTeam.Dd.Model.Dd_Suggest();
        HaTeam.Dd.BLL.Dd_Suggest bll = new HaTeam.Dd.BLL.Dd_Suggest();
        public void ProcessRequest(HttpContext context)
        {
            int _num = 0;
            try
            {
                model.User_ID = Convert.ToInt32(context.Request.Params["userID"].ToString());
                model.Suggest_Content = context.Request["url"].ToString();
                model.Suggest_Guid = Convert.ToString(Guid.NewGuid());
                model.Suggest_Datetime = DateTime.Now;
                model.Suggest_UpDatetime = DateTime.Now;
                model.Suggest_Verify = 0;
                model.Suggest_Lock = 0;
                model.Suggest_State = 0;
                model.Suggest_Delete = 0;
                model.Suggest_Count = 0;                     
                _num = bll.Add(model);
                if (_num != 0)
                {
                    _num = 1;
                }
            }
            catch
            {
                _num = -1;
            }
            context.Response.Write(_num);          
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}