Пример #1
0
        private void SelectTag()
        {
            string returnStr = "未查到相关标签";
            string tag       = "";

            if (!string.IsNullOrEmpty(Request.QueryString["tag"]))
            {
                tag = InText.SafeStr(InText.SafeSql(Request.QueryString["tag"].ToString()));
            }
            if (tag.Trim() != "")
            {
                String    sql = "select * from t_tag where tag_name like '%" + tag + "%' ";
                DataTable dt  = artBll.SelectToDataTable(sql);
                if (dt.Rows.Count > 0)
                {
                    returnStr = "<ul>";
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        returnStr += "<li><a href='javascript:void(0)' onclick='SetTag(\"" + dt.Rows[i]["tag_name"].ToString() + "\")'>" + dt.Rows[i]["tag_name"].ToString() + "</a></li>";
                    }
                    returnStr += "</ul>";
                }
            }
            Response.Write(returnStr);
        }
Пример #2
0
 public string GetDaoyu(string daoyu, string content, int length)
 {
     daoyu   = daoyu.Trim();
     content = content.Trim();
     if (daoyu.Trim() != "" && daoyu.Trim() != "no")
     {
         if (daoyu.Length > length)
         {
             return(daoyu.Substring(0, length) + "...");
         }
         else
         {
             return(daoyu + "...");
         }
     }
     else
     {
         string returnStr = InText.SafeSqlContent(content);
         if (returnStr.Length > length)
         {
             return(returnStr.Substring(0, length));
         }
         else
         {
             return(content + "...");
         }
     }
 }
Пример #3
0
        //删除一张图片按钮
        protected void repList_Img_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string[] arg       = e.CommandArgument.ToString().Split('|');
                int      articleId = Convert.ToInt32(arg[0]);
                string   pic       = arg[1];

                bool isOk = DeleteOnePic(articleId);//执行删除操作

                if (isOk)
                {
                    string strPath = HttpRuntime.AppDomainAppPath.ToString() + @ConfigurationManager.AppSettings["Article_File"].ToString() + pic;       //删除原图
                    CommonMethod.FilePicDelete(strPath);
                    strPath = HttpRuntime.AppDomainAppPath.ToString() + @ConfigurationManager.AppSettings["Article_File"].ToString() + "100_100_" + pic; //删除缩略图
                    CommonMethod.FilePicDelete(strPath);

                    Response.Redirect(Request.Url.ToString());//刷新当前页
                }
                else
                {
                    InText.AlertAndRedirect("删除失败,请重试!", Request.Url.ToString());//刷新当前页
                }
            }
        }
Пример #4
0
        public string GetDaoyu(string daoyu, string content, int length)
        {
            daoyu   = InText.SafeStr(daoyu);
            content = InText.SafeStr(content);

            if (daoyu.Trim() != "" && daoyu.Trim() != "no")
            {
                //return GetPartContent(InText.SafeStr(daoyu), length) + "...";
                if (daoyu.Length > length)
                {
                    return(daoyu.Substring(0, length) + "...");
                }
                else
                {
                    return(daoyu + "...");
                }
            }
            else
            {
                //return GetPartContent(InText.SafeStr(content), length) + "...";
                if (content.Length > length)
                {
                    return(content.Substring(0, length) + "...");
                }
                else
                {
                    return(content + "...");
                }
            }
        }
Пример #5
0
        private int ValidCheckCode()
        {
            int result = 0;

            string checkcode = "";

            if (!string.IsNullOrEmpty(HttpContext.Current.Request["checkcode"]))
            {
                checkcode = InText.SafeSql(HttpContext.Current.Request["checkcode"]);
            }

            string returnStr = "";

            if (Session["rndcode"] != null)
            {
                if (Session["rndcode"].ToString().ToLower() != checkcode.ToLower())
                {
                    //验证码错误
                    result = 2;
                }
                else
                {
                    result = 1;
                }
            }
            else
            {
                //请更换验证码重试
                result = 3;
            }
            return(result);
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            adminId = new AdminMethod().CheckAdminLogin();//-----------------------------

            if (!string.IsNullOrEmpty(Request.QueryString["html"]))
            {
                html = InText.SafeStr(Request.QueryString["html"].ToString());
                this.txt_html.Value = html;
            }
            if (!string.IsNullOrEmpty(Request.QueryString["dateMin"]))
            {
                update_date_min = InText.SafeSql(InText.SafeStr(Request.QueryString["dateMin"].ToString()));
                this.txt_update_date_min.Value = update_date_min;
            }
            if (!string.IsNullOrEmpty(Request.QueryString["dateMax"]))
            {
                update_date_max = InText.SafeSql(InText.SafeStr(Request.QueryString["dateMax"].ToString()));
                this.txt_update_date_max.Value = update_date_max;
            }


            if (!IsPostBack)
            {
                BindList();
            }
        }
Пример #7
0
 private void Convert()
 {
     if (this.SelectedMode != null)
     {
         OutText = string.Join("\n", this.SelectedMode.Convert(InText.Split("\n").ToList()));
     }
 }
Пример #8
0
        //添加按钮
        protected void imgBtn_Click(object sender, ImageClickEventArgs e)
        {
            int       order      = 0;
            string    sql        = "select max(link_order) as maxOrder from t_friendlink";
            DataTable dtMaxOrder = artBll.SelectToDataTable(sql);

            if (dtMaxOrder.Rows.Count > 0)
            {
                order = Convert.ToInt32(dtMaxOrder.Rows[0]["maxOrder"]) + 1;
            }

            string name = InText.SafeSql(InText.SafeStr(this.txtAddLinkName.Value));
            string link = InText.SafeSql(InText.SafeStr(this.txtAddLink.Value));

            if (name.Trim() != "" && link.Trim() != "")
            {
                sql = string.Format("insert into t_friendlink (link_name,link,link_order,update_date) values ('{0}','{1}',{2},getdate())", name, link, order);

                if (artBll.ExecuteSQLNonquery(sql))
                {
                    this.CteateHTML(url + "index927_2.aspx", "/", "");        //重新生成首页
                    InText.AlertAndRedirect("添加成功!", Request.Url.ToString()); //刷新当前页
                }
            }
        }
Пример #9
0
        //更新/删除一条分类名称
        protected void repList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                if (e.CommandName == "Update")
                {
                    string id   = this.hidUpdateId.Value;   //分类ID
                    string name = this.hidUpdateName.Value; //分类名称
                    string link = this.hidUpdateLink.Value; //分类关键词

                    if (name.Trim() != "" && link.Trim() != "")
                    {
                        string sql = "update t_friendlink set link_name='" + name + "',link='" + link + "' where id=" + id;

                        if (artBll.ExecuteSQLNonquery(sql))
                        {
                            this.CteateHTML(url + "index927_2.aspx", "/", "");        //重新生成首页
                            InText.AlertAndRedirect("修改成功!", Request.Url.ToString()); //刷新当前页
                        }
                    }
                }
                if (e.CommandName == "Delete")
                {
                    string sql = "delete from t_friendlink where id=" + e.CommandArgument.ToString();

                    if (artBll.ExecuteSQLNonquery(sql))
                    {
                        this.CteateHTML(url + "index927_2.aspx", "/", "");        //重新生成首页
                        InText.AlertAndRedirect("删除成功!", Request.Url.ToString()); //刷新当前页
                    }
                }
            }
        }
Пример #10
0
        //保存按钮
        protected void btn_Update_Click(object sender, EventArgs e)
        {
            name   = InText.SafeSql(InText.SafeStr(this.txt_name.Value));
            pwd    = WebBasic.Encryption.Encrypt(InText.SafeSql(InText.SafeStr(this.txt_pwd.Value)));
            remark = InText.SafeSql(InText.SafeStr(this.txt_remark.Value));

            if (admin_id != 0)//执行修改
            {
                string sql  = string.Format("update t_admin set name='{0}',pwd='{1}',remark='{2}' where id={3}", name, pwd, remark, admin_id);
                bool   isOk = artBll.ExecuteSQLNonquery(sql);
                if (isOk)
                {
                    InText.AlertAndRedirect("修改成功", "/xzdd927/admin/admin_list.aspx");// Request.Url.AbsoluteUri
                }
            }
            else //执行添加
            {
                string sql  = string.Format("insert into t_admin (name,pwd,remark) values ('{0}','{1}','{2}')", name, pwd, remark);
                bool   isOk = artBll.ExecuteSQLNonquery(sql);
                if (isOk)
                {
                    InText.AlertAndRedirect("添加成功", "/xzdd927/admin/admin_list.aspx");// Request.Url.AbsoluteUri
                }
            }
        }
Пример #11
0
        private void SelectEmailExist()
        {
            string email = "";

            if (!string.IsNullOrEmpty(HttpContext.Current.Request["email"]))
            {
                email = InText.SafeSql(InText.SafeStr(HttpContext.Current.Request["email"]));
            }
            int result = userBll.SelectEmailExist(email);

            StringWriter sw = new StringWriter();

            Newtonsoft.Json.JsonWriter writer = new Newtonsoft.Json.JsonTextWriter(sw);

            if (result == 0)
            {
                writer.WriteStartObject();
                writer.WritePropertyName("status");
                writer.WriteValue("200");
                writer.WriteEndObject();
                writer.Flush();
            }
            else
            {
                writer.WriteStartObject();
                writer.WritePropertyName("status");
                writer.WriteValue("500");
                writer.WriteEndObject();
                writer.Flush();
            }
            string jsonText = sw.GetStringBuilder().ToString();

            Response.Write(jsonText);
        }
Пример #12
0
        private bool BindList()
        {
            bool ifOk = true;

            int pageIndex   = 1;
            int pageSize    = 30;//pager.PageSize;//每页显示20条信息
            int totalRecord = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["p"]) && MetarnetRegex.IsNumeric(Request.QueryString["p"]))
            {
                pageIndex = Convert.ToInt32(InText.SafeSql(InText.SafeStr(Request.QueryString["p"].ToString())));
            }

            string where = " where 1=1";

            if (html.Trim() != "")
            {
                where += " and html like '%" + html + "%'";
            }
            if (update_date_min != "")
            {
                where += " and  DateDiff( day,  '" + update_date_min + "',t_article_pic.update_date) >=0 ";
            }
            if (update_date_max != "")
            {
                where += " and  DateDiff( day,  '" + update_date_max + "',t_article_pic.update_date) <=0 ";
            }


            string strSql = " Select t_article_pic.id as pic_id,t_article.title,t_article.html,t_article_pic.pic,t_article_pic.update_date   "
                            + " ,row_number() over(order by t_article_pic.id desc) as rowNumber "
                            + " FROM t_article_pic "
                            + " LEFT JOIN t_article ON t_article_pic.article_id=t_article.id ";
            DataTable dt = artBll.ExecutePager(strSql + where, pageSize, pageIndex, ref totalRecord);

            if (dt.Rows.Count > 0)
            {
                ifOk = true;

                pager.PageSize              = pageSize;
                pager.RecordCount           = totalRecord;
                this.repList_Img.DataSource = dt;
                this.repList_Img.DataBind();

                this.labInfoCount.Text = totalRecord.ToString();

                if (totalRecord <= pageSize)//只有一页,隐藏分页控件
                {
                    this.divFenye.Visible = false;
                }
            }
            else
            {
                this.divFenye.Visible = false;
                ifOk = false;
            }
            return(ifOk);
        }
Пример #13
0
        //重新生成PC静态页
        protected void btnUpdateHtml_Click(object sender, EventArgs e)
        {
            string sql = @"Select t_article.id as articleId,t_article.title,t_article.title1,t_article.source,t_article.keyword,t_article.daoyu,t_article.content,t_article.type,t_article.update_date,t_article.declare_mark,t_article.pic as artPic,t_article.html,t_article.remark,t_article.last_id,t_article.next_id,
                            t_article1.html AS last_html,t_article1.title AS last_title,t_article2.html AS next_html,t_article2.title AS next_title,
                            t_article_type.id as type_id,t_article_type.type_name,t_article.tag,t_article.tag_id,t_article.search_keyword
                            FROM (((t_article  
                            LEFT JOIN t_article_type ON (t_article.type=t_article_type.id) )
                            LEFT JOIN t_article t_article1 ON (t_article.last_id=t_article1.id) )
                            LEFT JOIN t_article t_article2 ON (t_article.next_id=t_article2.id)) ";

            DataTable dt = artBll.SelectToDataTable(sql);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int    article_id      = Convert.ToInt32(dt.Rows[i]["articleId"]);
                    string title           = dt.Rows[i]["title"].ToString();
                    string title1          = dt.Rows[i]["title1"].ToString();
                    string source          = dt.Rows[i]["source"].ToString();
                    int    articleType     = Convert.ToInt32(dt.Rows[i]["type_id"]);
                    string articleTypeName = dt.Rows[i]["type_name"].ToString();
                    string content         = dt.Rows[i]["content"].ToString();
                    string keyword         = dt.Rows[i]["keyword"].ToString();
                    string search_keyword  = dt.Rows[i]["search_keyword"].ToString();
                    string artPic          = dt.Rows[i]["artPic"].ToString();
                    string article_html    = dt.Rows[i]["html"].ToString();
                    string tagStr          = dt.Rows[i]["tag"].ToString();
                    string tagIdHtml       = dt.Rows[i]["tag_id"].ToString();
                    string update_date     = Convert.ToDateTime(dt.Rows[i]["update_date"]).ToString("yyyy年M月d日");
                    string tag_id          = dt.Rows[i]["tag_id"].ToString();

                    last_title = "上一篇:" + dt.Rows[i]["last_title"].ToString();
                    last_html  = dt.Rows[i]["last_html"].ToString();
                    next_title = "下一篇:" + dt.Rows[i]["next_title"].ToString();
                    next_html  = dt.Rows[i]["next_html"].ToString();

                    if (tagIdHtml.Trim() != "")
                    {
                        string[] tagArray = tagIdHtml.Split(',');
                        for (int j = 0; j < tagArray.Length; j++)
                        {
                            if (tagArray[j].Trim() != "" && tagArray[j].Trim() != ",")
                            {
                                tagIdHtml = tagArray[j].Trim();
                                break;
                            }
                        }
                    }

                    //GetLastNext(article_id, articleType);
                    //生成静态页
                    CommonMethod.CreateArticleHtml(article_id, title, title1, source, articleType, articleTypeName, content, keyword, artPic, article_html, tagStr, tag_id, tagIdHtml, update_date, last_html, last_title, next_html, next_title, search_keyword);
                }
            }
            InText.AlertAndRedirect("生成成功!", Request.Url.ToString());//刷新当前页
        }
Пример #14
0
        //生成二维码按钮
        protected void imgBtnSubmit_Click(object sender, ImageClickEventArgs e)
        {
            string content = InText.SafeStr(this.textContent.Value);//
            int    size    = Convert.ToInt32(this.ddlSize.SelectedValue);

            size = size * 3;

            if (content.Trim() != "")
            {
                create_two(content, size);
            }
        }
Пример #15
0
 protected void Button_First_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(ListBox1.SelectedValue))
     {
         ListItem li = new ListItem(ListBox1.SelectedItem.Text, ListBox1.SelectedValue);
         ListBox1.Items.Remove(li);
         ListBox1.Items.Insert(0, li);
     }
     else
     {
         InText.Alert("请选择要排序的友链!");
     }
 }
Пример #16
0
        //删除幻灯图片按钮
        protected void btn_delImg_huandeng1_Click(object sender, EventArgs e)
        {
            if (artPic_huandeng1.Trim() != "")
            {
                string sql  = "update t_article set huandeng1_pic='' where id=" + articleId;
                bool   isOk = artBll.ExecuteSQLNonquery(sql);
                if (isOk)
                {
                    string strPath = HttpRuntime.AppDomainAppPath.ToString() + @ConfigurationManager.AppSettings["Article_File"].ToString() + artPic_huandeng1;//删除原图
                    CommonMethod.FilePicDelete(strPath);

                    InText.AlertAndRedirect("删除成功", Request.Url.AbsoluteUri);
                }
            }
        }
Пример #17
0
        //添加分类按钮
        protected void imgBtn_Click(object sender, ImageClickEventArgs e)
        {
            string type_name    = InText.SafeSql(InText.SafeStr(this.txtAddType.Value));
            string type_keyword = InText.SafeSql(InText.SafeStr(this.txtAddTypeKeyword.Value));

            if (type_name.Trim() != "")
            {
                string sql = string.Format("insert into t_article_type (type_name,type_keyword,remark) values ('{0}','{1}','')", type_name, type_keyword);

                if (artBll.ExecuteSQLNonquery(sql))
                {
                    InText.AlertAndRedirect("添加成功!", Request.Url.ToString());//刷新当前页
                }
            }
        }
Пример #18
0
 //删除一个编辑人员按钮
 protected void repList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         int  admin_id = Convert.ToInt32(e.CommandArgument);
         bool isOk     = DeleteOneAdmin(admin_id);//执行删除操作
         if (isOk)
         {
             InText.AlertAndRedirect("删除成功!", Request.Url.ToString());//刷新当前页
         }
         else
         {
             InText.AlertAndRedirect("删除失败,请重试!", Request.Url.ToString());//刷新当前页
         }
     }
 }
Пример #19
0
        //生成sitemap
        protected void btnSitemap_Click(object sender, EventArgs e)
        {
            string    site = "http://www.up927.com" + "\r\n";
            string    sql  = "";
            DataTable dt   = new DataTable();

            sql = "select id from t_article_type ";
            dt  = artBll.SelectToDataTable(sql);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    site += "http://www.up927.com/list.aspx?at=" + dt.Rows[i]["id"].ToString() + "\r\n";
                }
            }

            sql = "select top 20 id from t_tag where article_num<>0 order by article_num desc ";
            dt  = artBll.SelectToDataTable(sql);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    site += "http://www.up927.com/list.aspx?tag=" + dt.Rows[i]["id"].ToString() + "\r\n";
                }
            }

            sql = "select html from t_article order by update_date DESC ";
            dt  = artBll.SelectToDataTable(sql);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    site += "http://www.up927.com" + dt.Rows[i]["html"].ToString() + "\r\n";
                }
            }
            FileStream   fs = new FileStream(HttpContext.Current.Server.MapPath("/sitemap.txt"), FileMode.Create);
            StreamWriter sw = new StreamWriter(fs, Encoding.GetEncoding("UTF-8"));

            //开始写入
            sw.Write(site);
            //清空缓冲区
            sw.Flush();
            //关闭流
            sw.Close();
            fs.Close();
            InText.AlertAndRedirect("生成成功!", Request.Url.ToString());//刷新当前页
        }
Пример #20
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string sql = "";
            int    i   = 0;

            foreach (ListItem li in ListBox1.Items)  //循环遍历
            {
                i++;
                sql = " update t_friendlink set link_order=" + i.ToString() + " where id=" + li.Value;
                artBll.ExecuteSQLNonquery(sql);
            }

            this.CteateHTML(url + "index927_2.aspx", "/", "");//重新生成首页

            this.BindList();
            InText.Alert("保存成功!");
        }
Пример #21
0
        private void TestJSONP()
        {
            string cb = "";

            if (!string.IsNullOrEmpty(Request.QueryString["cb"]))
            {
                cb = InText.SafeStr(Request.QueryString["cb"].ToString());
            }

            StringWriter sw     = new StringWriter();
            JsonWriter   writer = new JsonTextWriter(sw);

            //writer.writest

            writer.WriteStartArray();

            writer.WriteStartObject();
            writer.WritePropertyName("name");
            writer.WriteValue("王晓明");
            writer.WritePropertyName("age");
            writer.WriteValue("95");
            writer.WriteEndObject();
            writer.Flush();

            writer.WriteStartObject();
            writer.WritePropertyName("name");
            writer.WriteValue("王晓明1");
            writer.WritePropertyName("age");
            writer.WriteValue("951");
            writer.WriteEndObject();
            writer.Flush();

            writer.WriteEndArray();

            string jsonText = sw.GetStringBuilder().ToString();
            //string aaa = "[{\"name\":\"王晓明\",\"age\":\"95\"},{\"name\":\"王晓明1\",\"age\":\"951\"}]";
            string retrunStr = "{\"man\":" + jsonText + "}";

            if (cb.Trim() != "")
            {
                retrunStr = cb + "(" + retrunStr + ")";
            }
            Response.Write(retrunStr);
        }
Пример #22
0
        //删除图片按钮
        protected void btn_delImg_Click(object sender, EventArgs e)
        {
            if (tag_pic.Trim() == "")
            {
                tag_pic = this.hid_artPic.Value;
            }
            if (tag_pic.Trim() != "")
            {
                string sql  = "update t_tag set tag_pic='' where id=" + tag_id;
                bool   isOk = artBll.ExecuteSQLNonquery(sql);
                if (isOk)
                {
                    string strPath = HttpRuntime.AppDomainAppPath.ToString() + @ConfigurationManager.AppSettings["Tag_File"].ToString() + tag_pic;//删除原图
                    CommonMethod.FilePicDelete(strPath);

                    InText.AlertAndRedirect("删除成功", Request.Url.AbsoluteUri);
                }
            }
        }
Пример #23
0
 protected void Button_Before_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(ListBox1.SelectedValue))
     {
         if (ListBox1.SelectedIndex > 0)
         {
             ListItem li = new ListItem(ListBox1.SelectedItem.Text, ListBox1.SelectedValue);
             ListBox1.Items[ListBox1.SelectedIndex].Text      = ListBox1.Items[ListBox1.SelectedIndex - 1].Text;
             ListBox1.Items[ListBox1.SelectedIndex].Value     = ListBox1.Items[ListBox1.SelectedIndex - 1].Value;
             ListBox1.Items[ListBox1.SelectedIndex - 1].Text  = li.Text;
             ListBox1.Items[ListBox1.SelectedIndex - 1].Value = li.Value;
             ListBox1.SelectedValue = li.Value;
         }
     }
     else
     {
         InText.Alert("请选择要排序的友链!");
     }
 }
Пример #24
0
        //重新生成wap静态页
        protected void btnUpdateWapHtml_Click(object sender, EventArgs e)
        {
            string    sql = "select t_article.*,t_article_type.type_name,t_article_type.id as articleType from t_article left join t_article_type on (t_article.type=t_article_type.id)  ";
            DataTable dt  = artBll.SelectToDataTable(sql);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int    articleId       = Convert.ToInt32(dt.Rows[i]["id"]);
                    string title           = dt.Rows[i]["title"].ToString();
                    string title1          = dt.Rows[i]["title1"].ToString();
                    string source          = dt.Rows[i]["source"].ToString();
                    int    articleType     = Convert.ToInt32(dt.Rows[i]["articleType"]);
                    string articleTypeName = dt.Rows[i]["type_name"].ToString();
                    string content         = dt.Rows[i]["content"].ToString();
                    string keyword         = dt.Rows[i]["keyword"].ToString();
                    string search_keyword  = dt.Rows[i]["search_keyword"].ToString();
                    string artPic          = dt.Rows[i]["pic"].ToString();
                    string article_html    = dt.Rows[i]["html"].ToString();
                    string tagStr          = dt.Rows[i]["tag"].ToString();
                    string tag_id          = dt.Rows[i]["tag_id"].ToString();
                    string tagIdHtml       = "";
                    if (tag_id.Trim() != "")
                    {
                        string[] arrayTag_id = tag_id.Split(',');
                        for (int j = 0; j < arrayTag_id.Length; j++)
                        {
                            if (arrayTag_id[j].Trim() != "," && arrayTag_id[j].Trim() != "")
                            {
                                tagIdHtml = arrayTag_id[j];
                                break;
                            }
                        }
                    }

                    //生成wap版静态页
                    CommonMethod.CreateArticleHtml_Wap(articleId, title, title1, source, articleType, articleTypeName, content, keyword, artPic, article_html, tagStr, tag_id, tagIdHtml, search_keyword);
                }
            }
            InText.AlertAndRedirect("生成成功!", Request.Url.ToString());//刷新当前页
        }
Пример #25
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                //查询信息


                GetInfoDelegate clDel = new GetInfoDelegate(this.GetInfo);

                AsyncCallback callBackClose = new AsyncCallback(GetReturn);
                clDel.BeginInvoke(callBackClose, null);// 异步调用方法,查询信息
            }
            catch (Exception ex)
            {
            }
            finally
            {
                InText.AlertAndRedirect("执行成功!", Request.Url.AbsoluteUri);
            }
        }
Пример #26
0
        //上传按钮
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            //http://localhost:5750/Upload.svc

            ServiceReference1.UploadClient      client  = new MyProject02.ServiceReference1.UploadClient();
            ServiceReference1.FileUploadMessage message = new ServiceReference1.FileUploadMessage();
            message.FileName = FileUpload1.FileName;
            message.SavePath = @"D:\kkk\";
            message.FileData = FileUpload1.FileContent;

            ServiceReference1.IUpload channel = client.ChannelFactory.CreateChannel();

            ServiceReference1.UploadResultMessage resultMessage = new MyProject02.ServiceReference1.UploadResultMessage();
            resultMessage = channel.UploadFile(message);

            if (resultMessage.UploadResult == "1")
            {
                InText.Alert("上传成功!");
            }
        }
Пример #27
0
        //更新/删除一条分类名称
        protected void repList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                if (e.CommandName == "Update")
                {
                    string type_id      = this.hidUpdateId.Value;          //分类ID
                    string type_name    = this.hidUpdateTypeName.Value;    //分类名称
                    string type_keyword = this.hidUpdateTypeKeyword.Value; //分类关键词

                    if (type_id != "" && type_name != "")
                    {
                        string sql = "update t_article_type set type_name='" + type_name + "',type_keyword='" + type_keyword + "' where id=" + type_id;

                        if (artBll.ExecuteSQLNonquery(sql))
                        {
                            InText.AlertAndRedirect("修改成功!", Request.Url.ToString());//刷新当前页
                        }
                    }
                }
                if (e.CommandName == "Delete")
                {
                    string sql         = "select count(*) from t_article where type=" + e.CommandArgument.ToString();
                    int    totalRecord = Utils.CheckInt(artBll.ExecuteScalar(sql));
                    if (totalRecord > 0)
                    {
                        InText.AlertAndRedirect("该分类下有文章,请先修改文章分类或删除文章!", Request.Url.ToString());//刷新当前页
                    }
                    else
                    {
                        sql = "delete from t_article_type where id=" + e.CommandArgument.ToString();

                        if (artBll.ExecuteSQLNonquery(sql))
                        {
                            InText.AlertAndRedirect("删除成功!", Request.Url.ToString());//刷新当前页
                        }
                    }
                }
            }
        }
Пример #28
0
        private bool BindList()
        {
            bool ifOk = true;

            int pageIndex   = 1;
            int pageSize    = 100;//pager.PageSize;//每页显示20条信息
            int totalRecord = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["p"]) && MetarnetRegex.IsNumeric(Request.QueryString["p"]))
            {
                pageIndex = Convert.ToInt32(InText.SafeSql(InText.SafeStr(Request.QueryString["p"].ToString())));
            }

            string    strSql = " Select id,tag_name,tag_keyword,article_num  " + " ,row_number() over(order by t_tag.article_num desc ) as rowNumber " + " FROM t_tag where t_tag.article_num>0 ";
            DataTable dt     = artBll.ExecutePager(strSql, pageSize, pageIndex, ref totalRecord);

            if (dt.Rows.Count > 0)
            {
                ifOk = true;

                pager.PageSize          = pageSize;
                pager.RecordCount       = totalRecord;
                this.repList.DataSource = dt;
                this.repList.DataBind();

                //this.labInfoCount.Text = totalRecord.ToString();

                if (totalRecord <= pageSize)//只有一页,隐藏分页控件
                {
                    this.divFenye.Visible = false;
                }
            }
            else
            {
                this.divFenye.Visible = false;
                ifOk = false;
            }
            return(ifOk);
        }
Пример #29
0
 public string GetDaoyu(string daoyu, string content, int length)
 {
     //if (daoyu.Trim() != "")
     //{
     //    return GetPartContent(InText.SafeStr(daoyu), length) + "...";
     //}
     //else
     //{
     //    return GetPartContent(InText.SafeStr(content), length) + "...";
     //}
     if (daoyu.Trim() != "" && daoyu.Trim() != "no")
     {
         //return GetPartContent(InText.SafeStr(daoyu), length) + "...";
         if (daoyu.Length > length)
         {
             return(daoyu.Substring(0, length) + "...");
         }
         else
         {
             return(daoyu + "...");
         }
     }
     else
     {
         //return GetPartContent(InText.SafeStr(content), length) + "...";
         string returnStr = InText.SafeSqlContent(content);
         if (returnStr.Length > length)
         {
             return(returnStr.Substring(0, length));
         }
         else
         {
             return(content + "...");
         }
     }
 }
Пример #30
0
    private void InstanceSavePanels()
    {
        int NumSaveGameLabels;
        int NumSaveGames;
        int NumSaveLabelsPerPage = 4;
        int NumSavePages;

        string[] SaveGameFileList = SaveManager.GetSaveGameFileList();
        int      FileCursorIndex;
        int      SaveGameLabelSpawned;

        NumSaveGames = SaveGameFileList.Length;
        //If we are in save mode we need NumSaveGames + a new one for saving it.
        NumSaveGameLabels    = IsSaveMode ?  NumSaveGames + 1 : NumSaveGames;
        NumSavePages         = (NumSaveGameLabels + NumSaveLabelsPerPage - 1) / NumSaveLabelsPerPage;
        FileCursorIndex      = 0;
        CurrentPage          = 0;
        SavePanels           = new List <GameObject>();
        SaveGameLabelSpawned = NumSaveGameLabels;
        Debug.Log("IsSaveMode: " + IsSaveMode + " NumSaveGames: " + NumSaveGames);
        Debug.Log("Required labels: " + NumSaveGameLabels);
        Debug.Log("Required pages: " + NumSavePages);

        //Spawn the necessary panels...
        for (int i = 0; i < NumSavePages; i++)
        {
            GameObject Parent = Instantiate(Resources.Load("Prefabs/SaveGamePage")) as GameObject;
            Parent.name = "SavePage" + i;
            if (i != CurrentPage)
            {
                Parent.SetActive(false);
            }
            Parent.transform.SetParent(ContentSavePanel.transform, false);
            SavePanels.Add(Parent);
            for (int ChildIndex = 0; ChildIndex < NumSaveLabelsPerPage; ChildIndex++)
            {
                //We're done.
                if (SaveGameLabelSpawned <= 0)
                {
                    break;
                }
                GameObject Child = Instantiate(Resources.Load("Prefabs/SaveGameInputField")) as GameObject;
                Child.name = "SaveLabel" + ChildIndex;
                InputField ChildInputField = Child.GetComponent <InputField>();
                string     InText;
                Debug.Log("FileCursorIndex: " + FileCursorIndex);
                if (FileCursorIndex < NumSaveGames)
                {
                    InText = SaveGameFileList[FileCursorIndex];
                    //Remove the extension.
                    InText = InText.Substring(0, SaveGameFileList[FileCursorIndex].LastIndexOf("."));
                }
                else
                {
                    InText = "";
                }
                ChildInputField.text = InText;
                //If we are in load mode we cannot edit on the input...
                //If we are in save mode and the input represents a saved
                //game we can only overwrite it.
                if (!IsSaveMode)
                {
                    RegisterInputFieldClickEvent(Child, InText);
                    ChildInputField.readOnly = true;
                }
                else
                {
                    if (InText.Length == 0)
                    {
                        ChildInputField.onEndEdit.AddListener(delegate {
                            OnInputFieldValueSubmit(ChildInputField);
                        });
                    }
                    else
                    {
                        RegisterInputFieldClickEvent(Child, InText,
                                                     (delegate { OnOverWriteSaveGame(InText); }));
                        ChildInputField.readOnly = true;
                    }
                }
                Child.transform.SetParent(Parent.transform, false);
                FileCursorIndex++;
                SaveGameLabelSpawned--;
            }
        }
        //Insert order in list may or may be not respected
        //to be sure we sort them.
        SavePanels = SavePanels.OrderBy(Panel => Panel.name).ToList();
        foreach (GameObject Panel in SavePanels)
        {
            Debug.Log("Panel: " + Panel.name);
        }
        Debug.Log("NumSaveGamePanel Spawned: " + SavePanels.Count());
    }