Esempio n. 1
0
 /// <summary>
 /// 图文分页列表
 /// </summary>
 /// <param name="page_size">页面大小</param>
 /// <param name="page_index">当前页码</param>
 /// <param name="strwhere">查询条件</param>
 /// <param name="totalcount">总记录数</param>
 /// <returns>DateTable</returns>
 public DataTable get_link_list(int page_size, int page_index, string strwhere, out int totalcount)
 {
     DataTable dt = new DataTable();
     string _where = "is_lock=0";
     if (!string.IsNullOrEmpty(strwhere))
     {
         _where += " and " + strwhere;
     }
     dt = new BLL.link().GetList(page_size, page_index, _where, "sort_id asc,add_time desc", out totalcount).Tables[0];
     return dt;
 }
Esempio n. 2
0
 /// <summary>
 /// 友情链接列表
 /// </summary>
 /// <param name="top">显示条数</param>
 /// <param name="strwhere">查询条件</param>
 /// <returns>DataTable</returns>
 public DataTable get_link_list(int top, string strwhere)
 {
     DataTable dt = new DataTable();
     string _where = "is_lock=0";
     if (!string.IsNullOrEmpty(strwhere))
     {
         _where += " and " + strwhere;
     }
     dt = new BLL.link().GetList(top, _where).Tables[0];
     return dt;
 }
Esempio n. 3
0
        /// <summary>
        /// 图文分页列表
        /// </summary>
        /// <param name="page_size">页面大小</param>
        /// <param name="page_index">当前页码</param>
        /// <param name="strwhere">查询条件</param>
        /// <param name="totalcount">总记录数</param>
        /// <returns>DateTable</returns>
        public DataTable get_link_list(int page_size, int page_index, string strwhere, out int totalcount)
        {
            DataTable dt     = new DataTable();
            string    _where = "is_lock=0";

            if (!string.IsNullOrEmpty(strwhere))
            {
                _where += " and " + strwhere;
            }
            dt = new BLL.link().GetList(page_size, page_index, _where, "sort_id asc,add_time desc", out totalcount).Tables[0];
            return(dt);
        }
Esempio n. 4
0
        /// <summary>
        /// 友情链接列表
        /// </summary>
        /// <param name="top">显示条数</param>
        /// <param name="strwhere">查询条件</param>
        /// <returns>DataTable</returns>
        public DataTable get_link_list(int top, string strwhere)
        {
            DataTable dt     = new DataTable();
            string    _where = "is_lock=0";

            if (!string.IsNullOrEmpty(strwhere))
            {
                _where += " and " + strwhere;
            }
            dt = new BLL.link().GetList(top, _where).Tables[0];
            return(dt);
        }
Esempio n. 5
0
        private void link_add(HttpContext context)
        {
            StringBuilder strTxt = new StringBuilder();

            BLL.link   bll   = new BLL.link();
            Model.link model = new Model.link();

            string _site_path = DTRequest.GetQueryString("site");
            string _code      = DTRequest.GetFormString("txtCode");
            string _title     = DTRequest.GetFormString("txtTitle");
            string _user_name = DTRequest.GetFormString("txtUserName");
            string _user_tel  = DTRequest.GetFormString("txtUserTel");
            string _email     = DTRequest.GetFormString("txtEmail");
            string _site_url  = DTRequest.GetFormString("txtSiteUrl");
            string _img_url   = DTRequest.GetFormString("txtImgUrl");

            //检查站点目录
            if (string.IsNullOrEmpty(_site_path))
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,网站传输参数有误!\"}");
                return;
            }
            //校检验证码
            if (string.IsNullOrEmpty(_code))
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,请输入验证码!\"}");
                return;
            }
            if (context.Session[DTKeys.SESSION_CODE] == null)
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,系验证码已过期!\"}");
                return;
            }
            if (_code.ToLower() != (context.Session[DTKeys.SESSION_CODE].ToString()).ToLower())
            {
                context.Response.Write("{\"status\":0, \"msg\":\"验证码与系统的不一致!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_title))
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"对不起,请输入网站标题!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_site_url))
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"对不起,请输入网站网址!\"}");
                return;
            }
            model.site_path = Utils.DropHTML(_site_path);
            model.title     = Utils.DropHTML(_title);
            model.is_lock   = 1;
            model.is_red    = 0;
            model.user_name = Utils.DropHTML(_user_name);
            model.user_tel  = Utils.DropHTML(_user_tel);
            model.email     = Utils.DropHTML(_email);
            model.site_url  = Utils.DropHTML(_site_url);
            model.img_url   = Utils.DropHTML(_img_url);
            model.is_image  = 1;
            if (string.IsNullOrEmpty(model.img_url))
            {
                model.is_image = 0;
            }
            if (bll.Add(model) > 0)
            {
                context.Response.Write("{\"status\": 1, \"msg\": \"恭喜您,提交成功!\"}");
                return;
            }
            context.Response.Write("{\"status\": 0, \"msg\": \"对不起,保存过程中发生错误!\"}");
            return;
        }
Esempio n. 6
0
        private void link_add(HttpContext context)
        {
            StringBuilder strTxt = new StringBuilder();
            BLL.link bll = new BLL.link();
            Model.link model = new Model.link();

            string _code = DTRequest.GetFormString("txtCode");
            string _title =DTRequest.GetFormString("txtTitle");
            string _user_name = DTRequest.GetFormString("txtUserName");
            string _user_tel =DTRequest.GetFormString("txtUserTel");
            string _email = DTRequest.GetFormString("txtEmail");
            string _site_url = DTRequest.GetFormString("txtSiteUrl");
            string _img_url = DTRequest.GetFormString("txtImgUrl");

            //校检验证码
            if (string.IsNullOrEmpty(_code))
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,请输入验证码!\"}");
                return;
            }
            if (context.Session[DTKeys.SESSION_CODE] == null)
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,系验证码已过期!\"}");
                return;
            }
            if (_code.ToLower() != (context.Session[DTKeys.SESSION_CODE].ToString()).ToLower())
            {
                context.Response.Write("{\"status\":0, \"msg\":\"验证码与系统的不一致!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_title))
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"对不起,请输入网站标题!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_site_url))
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"对不起,请输入网站网址!\"}");
                return;
            }

            model.title = Utils.DropHTML(_title);
            model.is_lock = 1;
            model.is_red = 0;
            model.user_name = Utils.DropHTML(_user_name);
            model.user_tel = Utils.DropHTML(_user_tel);
            model.email = Utils.DropHTML(_email);
            model.site_url = Utils.DropHTML(_site_url);
            model.img_url = Utils.DropHTML(_img_url);
            model.is_image = 1;
            if (string.IsNullOrEmpty(model.img_url))
            {
                model.is_image = 0;
            }
            if (bll.Add(model) > 0)
            {
                context.Response.Write("{\"status\": 1, \"msg\": \"恭喜您,提交成功!\"}");
                return;
            }
            context.Response.Write("{\"status\": 0, \"msg\": \"对不起,保存过程中发生错误!\"}");
            return;
        }
Esempio n. 7
0
        private void link_add(HttpContext context)
        {
            StringBuilder strTxt = new StringBuilder();

            BLL.link   bll   = new BLL.link();
            Model.link model = new Model.link();

            string _code      = DTRequest.GetFormString("txtCode");
            string _title     = DTRequest.GetFormString("txtTitle");
            string _user_name = DTRequest.GetFormString("txtUserName");
            string _user_tel  = DTRequest.GetFormString("txtUserTel");
            string _email     = DTRequest.GetFormString("txtEmail");
            string _site_url  = DTRequest.GetFormString("txtSiteUrl");
            string _img_url   = DTRequest.GetFormString("txtImgUrl");

            //校检验证码
            if (string.IsNullOrEmpty(_code))
            {
                context.Response.Write("{msg:0, msgbox:\"对不起,请输入验证码!\"}");
                return;
            }
            if (context.Session[DTKeys.SESSION_CODE] == null)
            {
                context.Response.Write("{msg:0, msgbox:\"对不起,系统找不到生成的验证码!\"}");
                return;
            }
            if (_code.ToLower() != (context.Session[DTKeys.SESSION_CODE].ToString()).ToLower())
            {
                context.Response.Write("{msg:0, msgbox:\"您输入的验证码与系统的不一致!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_title))
            {
                context.Response.Write("{msg: 0, msgbox: \"对不起,请输入网站标题!\"}");
                return;
            }
            if (string.IsNullOrEmpty(_site_url))
            {
                context.Response.Write("{msg: 0, msgbox: \"对不起,请输入网站网址!\"}");
                return;
            }

            model.title     = _title;
            model.is_lock   = 1;
            model.is_red    = 0;
            model.user_name = _user_name;
            model.user_tel  = _user_tel;
            model.email     = _email;
            model.site_url  = _site_url;
            model.img_url   = _img_url;
            model.is_image  = 1;
            if (string.IsNullOrEmpty(model.img_url))
            {
                model.is_image = 0;
            }
            if (bll.Add(model) > 0)
            {
                context.Response.Write("{msg: 1, msgbox: \"恭喜您,提交成功啦!\"}");
                return;
            }
            context.Response.Write("{msg: 0, msgbox: \"对不起,保存过程中发生错误!\"}");
            return;
        }