예제 #1
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("plugin_forum_board", DTEnums.ActionEnum.Edit.ToString()); //检查权限

            BLL.Forum_Group           bll     = new BLL.Forum_Group();
            BLL.Forum_BoardPermission bllBPer = new BLL.Forum_BoardPermission();

            int _board_id = Convert.ToInt32(Request.Form["board_id"]);

            List <Model.Forum_Group> listGroup = bll.GetModelList(" 1=1 ");

            Model.Forum_Group modelGroup = new Model.Forum_Group();

            modelGroup.Id   = 0;
            modelGroup.Name = "游客组";

            listGroup.Add(modelGroup);

            foreach (Model.Forum_Group item in listGroup)
            {
                Model.Forum_BoardPermission model = bllBPer.GetModel(" BoardId=" + _board_id + " and  GroupId=" + item.Id + " ");

                bool isNew = false;

                if (model == null)
                {
                    model = new Model.Forum_BoardPermission();
                    isNew = true;
                }
                model.BoardId           = _board_id;
                model.GroupId           = item.Id;
                model.VisitBoard        = DTRequest.GetFormIntValue("VisitBoard_" + item.Id, 0);
                model.VisitTopic        = DTRequest.GetFormIntValue("VisitTopic_" + item.Id, 0);
                model.PostTopic         = DTRequest.GetFormIntValue("PostTopic_" + item.Id, 0);
                model.PostReply         = DTRequest.GetFormIntValue("PostReply_" + item.Id, 0);
                model.UploadAttachment  = DTRequest.GetFormIntValue("UploadAttachment_" + item.Id, 0);
                model.ViewAttachment    = DTRequest.GetFormIntValue("ViewAttachment_" + item.Id, 0);
                model.UpdateMyselfTopic = DTRequest.GetFormIntValue("UpdateMyselfTopic_" + item.Id, 0);
                model.UpdateMyselfReply = DTRequest.GetFormIntValue("UpdateMyselfReply_" + item.Id, 0);
                model.DeleteMyselfTopic = DTRequest.GetFormIntValue("DeleteMyselfTopic_" + item.Id, 0);
                model.DeleteMyselfReply = DTRequest.GetFormIntValue("DeleteMyselfReply_" + item.Id, 0);

                if (isNew)
                {
                    bllBPer.Add(model);
                }
                else
                {
                    bllBPer.Update(model);
                }
            }

            //重新加载
            Global.GetBoardPermissionList(true);

            JscriptMsg("保存信息成功!", "board_list.aspx");
        }
예제 #2
0
        private void banreply(HttpContext context)
        {
            rids = rids.Replace("'", "");

            int ban = DTRequest.GetFormIntValue("Ban", 0);

            new BLL.Forum_Topic().SetBanReply(rids, ban, topic_id);

            JsonHelper.WriteJson(context, new
            {
                url = turl
            });
        }
예제 #3
0
        private void move(HttpContext context)
        {
            tids = tids.Replace("'", "");

            int tobid = DTRequest.GetFormIntValue("tobid", 0);

            new BLL.Forum_Topic().SetMove(tids, board_id, tobid);

            JsonHelper.WriteJson(context, new
            {
                url = turl
            });
        }
예제 #4
0
        private void close(HttpContext context)
        {
            tids = tids.Replace("'", "");

            int close = DTRequest.GetFormIntValue("close", 0);

            new BLL.Forum_Topic().UpdateField("id in (" + tids + ")", "[Close]=" + close);

            JsonHelper.WriteJson(context, new
            {
                url = turl
            });
        }
예제 #5
0
        private void digest(HttpContext context)
        {
            tids = tids.Replace("'", "");

            int digest = DTRequest.GetFormIntValue("digest", 0);

            new BLL.Forum_Topic().SetDigest(tids, digest);

            JsonHelper.WriteJson(context, new
            {
                url = turl
            });
        }
예제 #6
0
        private void top(HttpContext context)
        {
            tids = tids.Replace("'", "");

            int top = DTRequest.GetFormIntValue("top", 0);

            new BLL.Forum_Topic().UpdateField("id in (" + tids + ")", "[Top]=" + top);

            JsonHelper.WriteJson(context, new
            {
                url = turl
            });
        }
예제 #7
0
파일: manage.cs 프로젝트: hui3694/forcomp
        /// <summary>
        /// 重写虚方法,此方法在Init事件执行
        /// </summary>
        protected override void InitPage()
        {
            board_id = DTRequest.GetFormIntValue("board_id", 0);
            topic_id = DTRequest.GetFormIntValue("topic_id", 0);
            post_id  = DTRequest.GetFormIntValue("post_id", 0);

            tids = DTRequest.GetString("tids");
            rids = DTRequest.GetString("rids");

            action = DTRequest.GetQueryString("action");


            if (string.IsNullOrEmpty(tids))
            {
                tids = topic_id.ToString();
            }

            if (string.IsNullOrEmpty(rids))
            {
                rids = post_id.ToString();
            }

            Model.Forum_Topic modelTopic = new Model.Forum_Topic();

            if (topic_id != 0)
            {
                modelTopic = new BLL.Forum_Topic().GetModel(topic_id);

                if (modelTopic == null)
                {
                    modelTopic = new Model.Forum_Topic();
                }
            }

            if (action == "move")
            {
                drSubList = new BLL.Forum_Board().GetAllList(0).Select(" 1=1 ", "SortId asc");
            }

            if (action != "deletereply" && action != "banreply")
            {
                drTopicList = new BLL.Forum_Topic().GetList(" id in (" + tids + ") ").Tables[0].Select(" 1=1 ", "Id asc");
            }
            else
            {
                drPostList = new BLL.Forum_Post(modelTopic.PostSubTable).GetList(" id in (" + rids + ") ").Tables[0].Select(" 1=1 ", "Id asc");
            }

            turl = Request.UrlReferrer.ToString();
        }
예제 #8
0
        private void highlight(HttpContext context)
        {
            tids = tids.Replace("'", "");

            int    highlight_style_b = DTRequest.GetFormIntValue("highlight_style_b", 0);
            int    highlight_style_i = DTRequest.GetFormIntValue("highlight_style_i", 0);
            int    highlight_style_u = DTRequest.GetFormIntValue("highlight_style_u", 0);
            string color             = context.Request.Form["color"].Replace("'", "");

            bool bol = false;

            string val = "";

            if (highlight_style_b != 0)
            {
                bol = true;
            }

            if (highlight_style_i != 0)
            {
                bol = true;
            }

            if (highlight_style_u != 0)
            {
                bol = true;
            }

            if (!string.IsNullOrEmpty(color))
            {
                bol = true;
            }


            if (bol)
            {
                val = highlight_style_b + "," + highlight_style_i + "," + highlight_style_u + "," + color;
            }

            new BLL.Forum_Topic().UpdateField("id in (" + tids + ")", "[HighLight]='" + val + "'");

            JsonHelper.WriteJson(context, new
            {
                url = turl
            });
        }
예제 #9
0
        Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(); //系统配置信息

        public void ProcessRequest(HttpContext context)
        {
            //检查管理员是否登录
            if (!new ManagePage().IsAdminLogin())
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"尚未登录或已超时,请登录后操作!\"}");
                return;
            }
            //取得处事类型
            string action = DTRequest.GetQueryString("action");

            switch (action)
            {
            case "get_map":     //验证用户名
                string keywords  = DTRequest.GetFormStringValue("keywords", "");
                string areacode  = DTRequest.GetFormStringValue("areacode", "");
                int    page      = DTRequest.GetFormIntValue("page", 1);
                int    pageSize  = DTRequest.GetFormIntValue("pageSize", 1);
                string returnstr = getmap(areacode, keywords, page, pageSize);
                context.Response.ContentType = "text/plain";
                context.Response.Write(returnstr);
                break;

            case "navigation_validate":     //验证导航菜单别名是否重复
                navigation_validate(context);
                break;

            case "manager_validate":     //验证管理员用户名是否重复
                manager_validate(context);
                break;

            case "get_navigation_list":     //获取后台导航字符串
                get_navigation_list(context);
                break;

            case "getJsonImgData":    //获取图表数据
                int    id   = DTRequest.GetFormIntValue("id", 0);
                string Date = DTRequest.GetFormStringValue("Date");
                getJsonImgData(context, id, Date);
                break;
            }
        }
예제 #10
0
        public void ProcessRequest(HttpContext context)
        {
            string action = DTRequest.GetFormString("action");

            LogHelper.WriteInfo("LINE19:" + action);
            switch (action)
            {
            case "get_holidays":
                OutPut(context, TourAPI.get_holidays());
                break;

            case "get_channel_article_news":
                OutPut(context, TourAPI.get_channel_article_news(1000));
                break;

            case "get_channel_article_news_top5":
                OutPut(context, TourAPI.get_channel_article_news(5));
                break;

            case "get_channel_article_news_detail":
                OutPut(context, TourAPI.get_channel_article_news_detail(
                           DTRequest.GetFormIntValue("id")));
                break;

            case "get_channel_article_goods":
                OutPut(context, TourAPI.get_channel_article_goods());
                break;

            case "get_channel_article_goods_detail":
                OutPut(context, TourAPI.get_channel_article_goods_detail(DTRequest.GetFormIntValue("id")));
                break;

            case "get_channel_article_content":
                OutPut(context, TourAPI.get_channel_article_content());
                break;

            case "get_channel_article_content_detail":
                OutPut(context, TourAPI.get_channel_article_content_detail(DTRequest.GetFormIntValue("id")));
                break;

            case "get_channel_article_food":
                OutPut(context, TourAPI.get_channel_article_food());
                break;

            case "get_channel_article_food_detail":
                OutPut(context, TourAPI.get_channel_article_food_detail(DTRequest.GetFormIntValue("id")));
                break;

            case "get_channel_article_guidance":
                OutPut(context, TourAPI.get_channel_article_guidance());
                break;

            case "get_channel_article_guidance_detail":
                OutPut(context, TourAPI.get_channel_article_guidance_detail(
                           DTRequest.GetFormIntValue("id")));
                break;

            case "getOpenId":
                OutPut(context, TourAPI.getOpenId(
                           DTRequest.GetFormString("code")));
                break;

            case "add_or_update_user":
                OutPut(context, TourAPI.add_or_update_user(
                           DTRequest.GetFormString("openid"),
                           DTRequest.GetFormString("unionid"),
                           DTRequest.GetFormString("photo"),
                           DTRequest.GetFormIntValue("sex"),
                           DTRequest.GetFormString("nickname"),
                           DTRequest.GetFormIntValue("age"),
                           DTRequest.GetFormString("phone"),
                           DTRequest.GetFormString("interest"),
                           DTRequest.GetFormFloat("latitude", -1),
                           DTRequest.GetFormFloat("longitude", -1),
                           DTRequest.GetFormFloat("accuracy", -1)));
                break;

            case "get_brand_list":
                OutPut(context, TourAPI.get_brand_list());
                break;

            case "get_brand_detail":
                OutPut(context, TourAPI.get_brand_detail(
                           DTRequest.GetFormIntValue("id")));
                break;

            case "getAppCard":
                OutPut(context, TourAPI.getAppCard(
                           DTRequest.GetFormString("card_id")));
                break;

            case "coupon_query_store":
                OutPut(context, TourAPI.coupon_query_store());
                break;

            case "coupon_query_coupon":
                OutPut(context, TourAPI.coupon_query_coupon(
                           DTRequest.GetFormString("poi_id")));
                break;

            case "coupon_query_user":
                OutPut(context, TourAPI.coupon_query_user(
                           DTRequest.GetFormString("unionid")));
                break;

            case "getUnionId":
                OutPut(context, TourAPI.getUnionId(
                           DTRequest.GetFormString("session_key"),
                           DTRequest.GetFormString("iv"),
                           DTRequest.GetFormString("encryptedData")));
                break;

            default:
                OutPut(context, "not implement action : " + action);
                break;
            }
        }
예제 #11
0
        public void ProcessRequest(HttpContext context)
        {
            string action = DTRequest.GetFormString("action");

            switch (action)
            {
                #region  news related
            case "get_channel_article_news":
                OutPut(context, HospicalAPI.get_channel_article_news());
                break;

            case "get_channel_article_news_detail":
                OutPut(context, HospicalAPI.get_channel_article_news_detail(
                           DTRequest.GetFormIntValue("id")));
                break;

            case "get_channel_article_goods":
                OutPut(context, HospicalAPI.get_channel_article_goods());
                break;

            case "get_channel_article_goods_detail":
                OutPut(context, HospicalAPI.get_channel_article_goods_detail(
                           DTRequest.GetFormIntValue("id")));
                break;
                #endregion

                #region content related
            case "get_channel_article_content":
                OutPut(context, HospicalAPI.get_channel_article_content());
                break;

            case "get_channel_article_content_detail":
                OutPut(context, HospicalAPI.get_channel_article_content_detail(DTRequest.GetFormIntValue("id")));
                break;
                #endregion

                #region others
            case "getOpenId":
                OutPut(context, HospicalAPI.getOpenId(
                           DTRequest.GetFormString("code"),
                           DTRequest.GetFormString("source")));//不填source参数默认为罗托鲁瓦 kkl表示凯库拉
                break;

            case "add_or_update_user":
                OutPut(context, HospicalAPI.add_or_update_user(
                           DTRequest.GetFormString("openid"),
                           DTRequest.GetFormString("unionid"),
                           DTRequest.GetFormString("photo"),
                           DTRequest.GetFormIntValue("sex"),
                           DTRequest.GetFormString("nickname"),
                           DTRequest.GetFormIntValue("age"),
                           DTRequest.GetFormString("phone"),
                           DTRequest.GetFormString("interest"),
                           DTRequest.GetFormFloat("latitude", -1),
                           DTRequest.GetFormFloat("longitude", -1),
                           DTRequest.GetFormFloat("accuracy", -1)));
                break;

            case "getUnionId":
                OutPut(context, HospicalAPI.getUnionId(
                           DTRequest.GetFormString("session_key"),
                           DTRequest.GetFormString("iv"),
                           DTRequest.GetFormString("encryptedData")));
                break;


                #endregion

            default:
                OutPut(context, "not implement action : " + action);
                break;
            }
        }
예제 #12
0
        public void ProcessRequest(HttpContext context)
        {
            //取得处事类型
            string action = DTRequest.GetQueryString("action");

            modelUser = new Page.ForumPage().GetOnlineUser();

            //除了获取会员信息外,所有都需登陆
            if (action.ToLower() != "users")
            {
                if (modelUser == null)
                {
                    JsonHelper.WriteJson(context, new
                    {
                        error       = 1,
                        description = "超时了,请重新登陆!"
                    });

                    return;
                }
            }

            //公用
            turl     = DTRequest.GetString("turl");
            board_id = DTRequest.GetFormIntValue("board_id", 0);
            topic_id = DTRequest.GetFormIntValue("topic_id", 0);
            post_id  = DTRequest.GetFormIntValue("post_id", 0);
            vc       = DTRequest.GetString("vc");
            //发贴回贴编辑贴
            title          = DTRequest.GetString("title");
            message        = DTRequest.GetString("message");
            attachment_ids = DTRequest.GetString("attachment_ids");
            signature      = DTRequest.GetFormIntValue("signature", 0);
            autoUrl        = DTRequest.GetFormIntValue("AutoUrl", 0);
            //管理贴
            tids         = DTRequest.GetString("tids");
            rids         = DTRequest.GetString("rids");
            send_message = DTRequest.GetFormIntValue("send_message", 0);
            reason       = DTRequest.GetString("reason");

            user_ids = DTRequest.GetString("user_ids").Replace("'", "");

            switch (action)
            {
            //新主题
            case "create":
                create(context);
                break;

            //编主题
            case "update":
                update(context);
                break;

            //新回复
            case "reply":
                reply(context);
                break;

            //编回复
            case "editor":
                editor(context);
                break;

            //个人删除回复
            case "selfdelete":
                selfdelete(context);
                break;

            //个人删除主题
            case "selftopicdelete":
                selftopicdelete(context);
                break;

            //获取会员列表
            case "users":
                users(context);
                break;

            //金币兑换
            case "user_credit_convert":
                user_credit_convert(context);
                break;

            //主题置顶--------------分隔线-------------
            case "top":
                top(context);
                break;

            //精华设置
            case "digest":
                digest(context);
                break;

            //主题设置
            case "close":
                close(context);
                break;

            //主题高亮
            case "highlight":
                highlight(context);
                break;

            //主题屏蔽
            case "ban":
                ban(context);
                break;

            //删除主题
            case "delete":
                delete(context);
                break;

            //移动主题
            case "move":
                move(context);
                break;

            //主题分类
            case "type":
                type(context);
                break;

            //屏蔽回复
            case "banreply":
                banreply(context);
                break;

            //批删除回复
            case "deletereply":
                deletereply(context);
                break;
            }
        }
예제 #13
0
        public void ProcessRequest(HttpContext context)
        {
            string action = DTRequest.GetFormString("action");

            LogHelper.WriteInfo("LINE20:" + action);
            switch (action)
            {
            case "updateUser":    //更新个人信息
                OutPut(context, SchoolAPI.updateUser(
                           DTRequest.GetFormString("userId"),
                           DTRequest.GetFormString("nickName"),
                           DTRequest.GetFormString("mobile"),
                           DTRequest.GetFormString("xueli"),
                           DTRequest.GetFormString("zhuanye"),
                           DTRequest.GetFormString("age")));
                break;

            case "getOpenId":
                OutPut(context, SchoolAPI.getOpenId(
                           DTRequest.GetFormString("code")));
                break;

            case "register":
                OutPut(context, SchoolAPI.register(
                           DTRequest.GetFormString("openId"),
                           DTRequest.GetFormString("nickName"),
                           DTRequest.GetFormString("avatarUrl"),
                           DTRequest.GetFormString("sex")));
                break;

            case "search":
                OutPut(context, SchoolAPI.search(
                           DTRequest.GetFormString("name"),
                           DTRequest.GetFormString("english")));
                break;

            case "getSchool":
                OutPut(context, SchoolAPI.getSchool());
                break;

            case "getRecord":
                OutPut(context, SchoolAPI.getRecord(
                           DTRequest.GetFormString("userId")));
                break;

            case "schoolSearch":
                OutPut(context, SchoolAPI.schoolSearch(
                           DTRequest.GetFormString("name"),
                           DTRequest.GetFormString("english")));
                break;

            case "getResult":
                OutPut(context, SchoolAPI.getResult(
                           DTRequest.GetFormString("recordId")));
                break;

            case "getSchoolById":
                OutPut(context, SchoolAPI.getSchoolById(
                           DTRequest.GetFormString("schoolId")));
                break;

            case "getSchoolDetail":
                OutPut(context, SchoolAPI.getSchoolDetail(
                           DTRequest.GetFormString("schoolId")));
                break;

            case "getPicker":
                OutPut(context, SchoolAPI.getPicker());
                break;

            case "insertBachelorData":    //高中
                OutPut(context, SchoolAPI.insertBachelorData(
                           DTRequest.GetFormString("userId"),
                           DTRequest.GetFormString("targetCountry"),
                           DTRequest.GetFormFloat("GPA", 0),
                           DTRequest.GetFormString("GPAType"),
                           DTRequest.GetFormIntValue("language"),
                           DTRequest.GetFormString("languageType"),
                           DTRequest.GetFormIntValue("standardization"),
                           DTRequest.GetFormString("standardizationType"),
                           DTRequest.GetFormString("toSchool"),
                           DTRequest.GetFormString("inclination"),
                           DTRequest.GetFormString("graduation"),
                           DTRequest.GetFormString("rank"),
                           DTRequest.GetFormString("recommend"),
                           DTRequest.GetFormString("prize"),
                           DTRequest.GetFormString("summer"),
                           DTRequest.GetFormString("volunteer")));
                break;

            case "insertMasterData":    //大学
                OutPut(context, SchoolAPI.insertMasterData(
                           DTRequest.GetFormString("userId"),
                           DTRequest.GetFormString("targetCountry"),
                           DTRequest.GetFormString("school"),
                           DTRequest.GetFormString("major1"),
                           DTRequest.GetFormString("major2"),
                           DTRequest.GetFormFloat("GPA", 0),
                           DTRequest.GetFormString("GPAType"),
                           DTRequest.GetFormIntValue("language"),
                           DTRequest.GetFormString("languageType"),
                           DTRequest.GetFormIntValue("standardization"),
                           DTRequest.GetFormString("standardizationType"),
                           DTRequest.GetFormString("toSchool"),
                           DTRequest.GetFormString("experience"),
                           DTRequest.GetFormString("paper"),
                           DTRequest.GetFormString("recommendation"),
                           DTRequest.GetFormString("overseas"),
                           DTRequest.GetFormString("practice")));
                break;

            default:
                OutPut(context, "not implement action : " + action);
                break;
            }
        }