/// <summary>
 /// 新主题添加
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public long YNTInsert(YNT_YuyueNewThemEntity model)
 {
     try
     {
         return(MgrServices.ReservationService.YNTInsert(model));
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
        /// <summary>
        /// 获取已有主题的详细信息
        /// </summary>
        /// <param name="YNTID"></param>
        /// <returns></returns>
        public string GetYNTInfo(int YNTID)
        {
            YNT_YuyueNewThemEntity model = new YNT_YuyueNewThemEntity();
            YNT_YuyueNewThemEntity ds    = MgrServices.ReservationService.GetYNTInfoByID(YNTID);

            model._ynt_themname       = ds._ynt_themname;
            model._ynt_describe       = ds._ynt_describe;
            model._ynt_entrycondition = ds._ynt_entrycondition;
            string json = JsonConvert.SerializeObject(model);

            return(json);
        }
        public void ProcessRequest(HttpContext context)
        {
            string isTimeOut = Common.GetSessionValue("UserID", context);

            if (isTimeOut == null)
            {
                return;
            }
            context.Response.ContentType = "text/plain";
            //1是预约时间添加,2是新主题添加,3是已有主题添加,4是查询已有主题内容,5是根据主题id查询详细内容,6是分页列表-废弃,7是分页列表
            int    Type      = Convert.ToInt32(context.Request["type"]);
            string LoginName = CookieHelper.GetCookieValue("LoginNameCookie");

            switch (Type)
            {
            case 1:
                YT_YuYueTimeEntity ModleInfo = new YT_YuYueTimeEntity();
                ModleInfo._yt_createperson = LoginName;
                ModleInfo._yt_userid       = Convert.ToInt32(Common.GetRequest("Consultant"));
                ModleInfo._yt_bdate        = Convert.ToDateTime(Common.GetRequest("BDate"));
                ModleInfo._yt_edate        = Convert.ToDateTime(Common.GetRequest("EDate"));
                ModleInfo._yt_week         = Common.GetRequest("Week");
                if (ModleInfo._yt_week.Length > 0)
                {
                    ModleInfo._yt_week = ModleInfo._yt_week.Substring(0, ModleInfo._yt_week.Length - 1);
                }
                ModleInfo._yt_btime            = Common.GetRequest("BTime");
                ModleInfo._yt_etime            = Common.GetRequest("EndTime");
                ModleInfo._yt_conselingtype    = Convert.ToInt32(Common.GetRequest("ConselingType"));
                ModleInfo._yt_conselingaddress = Convert.ToInt32(Common.GetRequest("ConselingAddress"));
                ModleInfo._yt_createtime       = DateTime.Now;
                context.Response.Write(Insert(ModleInfo));
                break;

            case 2:
                YNT_YuyueNewThemEntity YNTmodel = new YNT_YuyueNewThemEntity();
                YNTmodel._ynt_createperson   = LoginName;
                YNTmodel._ynt_themname       = Common.GetRequest("Them");
                YNTmodel._ynt_describe       = Common.GetRequest("content");
                YNTmodel._ynt_entrycondition = Common.GetRequest("EntryCondition");
                YNTmodel._ynt_createtime     = DateTime.Now;
                YNTmodel._ynt_str2           = Common.GetRequest("YYID");//获取预约时间id
                context.Response.Write(YNTInsert(YNTmodel));
                break;

            case 3:
                YOT_YuyueOldThemEntity YOTmodel = new YOT_YuyueOldThemEntity();
                YOTmodel._ynt_id           = Convert.ToInt32(Common.GetRequest("Changethem"));
                YOTmodel._yot_str          = Common.GetRequest("CType");//咨询方式
                YOTmodel._yot_createperson = LoginName;
                YOTmodel._yot_createtime   = DateTime.Now;
                YOTmodel._yot_str2         = Common.GetRequest("YYID");//获取预约时间id
                context.Response.Write(YOTInsert(YOTmodel));
                break;

            case 4:
                context.Response.Write(InitYNTType());
                break;

            case 5:
                int YNTID = Convert.ToInt32(Common.GetRequest("YNTID"));
                context.Response.Write(GetYNTInfo(YNTID));
                break;

            case 6:
                int UserID        = 12;
                int StarPageIndex = 0;
                int EndPageIndex  = 10;
                InitGaugePages(UserID, StarPageIndex, EndPageIndex, context);
                break;

            case 7:
                int UserIDs        = 12;
                int StarPageIndexs = 0;
                int EndPageIndexs  = 10;
                GetList(UserIDs, StarPageIndexs, EndPageIndexs, context);
                break;
            }
        }