Exemple #1
0
        /// <summary>
        /// 获取模板详细信息
        /// </summary>
        /// <param name="context"></param>
        public void GetModel(HttpContext context)
        {
            string   temp_code = HttpContext.Current.Request.Form["temp_code"];
            TempsBll bll       = new TempsBll();

            Model.temp t = bll.GetModel(temp_code);
            context.Response.Write("{\"status\":\"0\",\"cover\":\"" + t.cover + "\",\"des\":\"" + t.des + "\",\"authorName\":\"" + t.authorName + "\",\"author\":\"" + t.author + "\",\"MouseClick\":\"" + t.MouseClick + "\",\"Money\":\"" + t.Money + "\"}");
            return;
        }
Exemple #2
0
        /// <summary>
        /// 添加点击次数
        /// </summary>
        /// <param name="context"></param>
        public void AddMouseClick(HttpContext context)
        {
            string   temp_code = HttpContext.Current.Request.Form["temp_code"];
            TempsBll bll       = new TempsBll();

            bll.AddNum(temp_code);
            context.Response.Write("{\"status\":\"0\"}");
            return;
        }
Exemple #3
0
 /// <summary>
 /// 用模板
 /// </summary>
 /// <param name="context"></param>
 public void UseTemp(HttpContext context)
 {
     if (HttpContext.Current.Session["userID"] != null)
     {
         string   temp_code = HttpContext.Current.Request.Form["temp_code"];
         string   userId    = HttpContext.Current.Session["userID"].ToString();
         TempsBll bll       = new TempsBll();
         string   msg       = bll.CopeTemp(temp_code, userId);
         context.Response.Write("{\"status\":\"" + msg + "\"}");
     }
     else
     {
         context.Response.Write("{\"status\":\"-1\"}");
         return;
     }
 }
Exemple #4
0
        /// <summary>
        /// 获取模板
        /// </summary>
        /// <param name="context"></param>
        public void GetTemp(HttpContext context)
        {
            string    H           = HttpContext.Current.Request.Form["H"];
            string    C           = HttpContext.Current.Request.Form["C"];
            string    orderByFree = HttpContext.Current.Request.Form["orderByFree"];
            string    OrderByNew  = HttpContext.Current.Request.Form["OrderByNew"];
            string    PageInt     = HttpContext.Current.Request.Form["PageInt"];
            string    CountRow    = HttpContext.Current.Request.Form["CountRow"];
            string    SerachStr   = HttpContext.Current.Request.Form["SerachStr"];
            TempsBll  BLL         = new TempsBll();
            DataTable dt          = BLL.GetTable(int.Parse(H), int.Parse(C), int.Parse(orderByFree), int.Parse(OrderByNew), int.Parse(PageInt), int.Parse(CountRow), f.MyEncodeInputString(SerachStr));

            if (dt == null)
            {
                context.Response.Write("{\"status\":\"-1\"}");
                return;
            }
            string json = f.ToJson(dt);

            json = json.Replace("\"", "\\\"");
            context.Response.Write("{\"status\":\"" + json + "\"}");
        }
Exemple #5
0
        /// <summary>
        /// 预览场景
        /// </summary>
        /// <param name="context"></param>
        public void preview(HttpContext context)
        {
            string   id  = HttpContext.Current.Request["id"];
            sceneBll bll = new sceneBll();

            Model.scene sm = bll.GetModel(id);//场景信息
            if (sm.author != null)
            {
                List <Model.scene_pag> mplist = bll.GetPageListBySceneCode(id);//场景页面
                StringBuilder          pStr   = new StringBuilder();
                foreach (Model.scene_pag m in mplist)
                {
                    pStr.Append(@"{'id': " + m.scene_pag_id + @", 
                    'sceneId': '" + id + @"',
                    'num': '" + m.num + @"',
                    'name': '" + m.pageName + @"',
                    'properties': null,
                    'elements': " + (m.content_text == "" ? "[]" : m.content_text) + @" , 
                    'scene': null},");
                }
                string msg = @"{
                'success': true, 
                'code': '200', 
                'msg': '操作成功', 
                'obj': { 
                    'id': '" + id + @"', 
                    'name': '" + sm.scene_name + @"', 
                    'createUser': '******', 
                    'type':'" + sm.scene_custom_id + @"', 
                    'pageMode': '" + sm.movietype + @"', 
                    'cover': '" + sm.cover + @"', 
                    'bgAudio':'" + sm.musicUrl + @"',
                    'code': '" + id + @"', 
                    'description': '" + sm.des + @"', 
                    'updateTime': '" + sm.addtime + @"', 
                    'createTime': '" + sm.addtime + @"', 
                    'publishTime': '" + sm.addtime + @"',
                    'property':{'triggerLoop':true,'eqAdType':1,'hideEqAd':false}
                }, 
                'map': null, 
                'list': [
                    " + pStr.ToString().Trim(',') + @"
                ]
                }";
                context.Response.Write(MentStr(msg));
            }
            else
            {
                TempsBll   tbll   = new TempsBll();
                Model.temp tmodel = tbll.GetModelTemp(id);//模板信息

                if (tmodel.author == null)
                {
                    string msg = @" {
                            'success': false,
                            'code': '403',
                            'msg': '预览失败',
                            'obj': null,
                            'map': null,
                            'list': null
                        }";
                    context.Response.Write(MentStr(msg));
                }
                else
                {
                    /////////////////////////////////////////////////////////
                    List <Model.temp_pag> mplist = tbll.GetPageListByTempCode(id);//场景页面
                    StringBuilder         pStr   = new StringBuilder();
                    foreach (Model.temp_pag m in mplist)
                    {
                        pStr.Append(@"{'id': " + m.pag_id + @", 
                                'sceneId': '" + id + @"',
                                'num': '" + m.num + @"',
                                'name': '" + m.pageName + @"',
                                'properties': null,
                                'elements': " + (m.content_text == "" ? "[]" : m.content_text) + @" , 
                                'scene': null},");
                    }
                    string msg = @"{
                            'success': true, 
                            'code': '200', 
                            'msg': '操作成功', 
                            'obj': { 
                                'id': '" + id + @"', 
                                'name': '" + tmodel.temp_name + @"', 
                                'createUser': '******', 
                                'type':'" + tmodel.scene_custom_id + @"', 
                                'pageMode': '" + tmodel.movietype + @"', 
                                'cover': '" + tmodel.cover + @"', 
                                'bgAudio':'" + tmodel.musicUrl + @"',
                                'code': '" + id + @"', 
                                'description': '" + tmodel.des + @"', 
                                'updateTime': '" + tmodel.addtime + @"', 
                                'createTime': '" + tmodel.addtime + @"', 
                                'publishTime': '" + tmodel.addtime + @"',
                                'property':{'triggerLoop':true,'eqAdType':1,'hideEqAd':false}
                            }, 
                            'map': null, 
                            'list': [
                                " + pStr.ToString().Trim(',') + @"
                            ]
                            }";
                    context.Response.Write(MentStr(msg));
                    /////////////////////////////////////////////////////////
                }
            }
        }