예제 #1
0
파일: addadvs.cs 프로젝트: xiongeee/BBX
 private void AddAdInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         string TargetFID = Request["TargetFID"];
         if ((String.IsNullOrEmpty(TargetFID) || TargetFID == ",") && this.type.SelectedIndex < 10)
         {
             base.RegisterStartupScript("", "<script>alert('请您先选取相关的投放范围,再点击提交按钮');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
             return;
         }
         string text  = this.starttime.SelectedDate.ToString();
         string text2 = this.endtime.SelectedDate.ToString();
         if (text.IndexOf("1900") < 0 && text2.IndexOf("1900") < 0 && Convert.ToDateTime(this.starttime.SelectedDate.ToString()) >= Convert.ToDateTime(this.endtime.SelectedDate.ToString()))
         {
             base.RegisterStartupScript("", "<script>alert('生效时间应该早于结束时间');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
             return;
         }
         if (this.endtime.SelectedDate < DateTime.Now)
         {
             base.RegisterStartupScript("", "<script>alert('您选择的结束日期已过期,请重新选择一个大于今天的日期');showadhint(Form1.type.value);showparameters(Form1.parameters.value);</script>");
             return;
         }
         Advertisement.CreateAd(available.SelectedValue.ToInt(0), type.SelectedValue, this.displayorder.Text.ToInt(0), title.Text, TargetFID, GetParameters(), GetCode(), text, text2);
         XCache.Remove(CacheKeys.FORUM_ADVERTISEMENTS);
         base.RegisterStartupScript("PAGE", "window.location.href='advsgrid.aspx';");
     }
 }
예제 #2
0
파일: addidentify.cs 프로젝트: xiongeee/BBX
 private void AddIdentifyInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         if (String.IsNullOrEmpty(this.uploadfile.FileName.Trim()) || String.IsNullOrEmpty(this.uploadfilesmall.FileName.Trim()))
         {
             base.RegisterStartupScript("PAGE", "alert('没有选择鉴定图片');window.location.href='forum_addidentify.aspx';");
             return;
         }
         string text  = this.uploadfile.UpdateFile();
         string text2 = this.uploadfilesmall.UpdateFile();
         if (String.IsNullOrEmpty(text.Trim()))
         {
             base.RegisterStartupScript("PAGE", "alert('没有选择鉴定大图片');window.location.href='forum_addidentify.aspx';");
             return;
         }
         if (String.IsNullOrEmpty(text2.Trim()))
         {
             base.RegisterStartupScript("PAGE", "alert('没有选择鉴定小图片');window.location.href='forum_addidentify.aspx';");
             return;
         }
         if (TopicIdentify.Add(this.name.Text, text))
         {
             string[] array = text.Split('.');
             string   str   = string.Format("{0}_small.{1}", array[0], array[1]);
             Directory.Move(base.Server.MapPath("../../images/identify/") + text2, base.Server.MapPath("../../images/identify/") + str);
             XCache.Remove("/Forum/TopicIdentifys");
             XCache.Remove("/Forum/TopicIndentifysJsArray");
             AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件添加", this.name.Text);
             base.RegisterStartupScript("PAGE", "window.location.href='forum_identifymanage.aspx';");
             return;
         }
         base.RegisterStartupScript("PAGE", "alert('插入失败,可能名称与原有的相同');window.location.href='forum_identifymanage.aspx';");
     }
 }
예제 #3
0
        protected void SaveFriend_Click(object sender, EventArgs e)
        {
            int  num  = 0;
            bool flag = false;

            foreach (object current in this.DataGrid1.GetKeyIDArray())
            {
                int    displayorder = int.Parse(this.DataGrid1.GetControlValue(num, "displayorder"));
                string name         = this.DataGrid1.GetControlValue(num, "name").Trim();
                string url          = this.DataGrid1.GetControlValue(num, "url").Trim();
                string note         = this.DataGrid1.GetControlValue(num, "note").Trim();
                string logo         = this.DataGrid1.GetControlValue(num, "logo").Trim();

                var lnk = ForumLink.FindByID(int.Parse(current.ToString()));
                if (lnk != null)
                {
                    lnk.DisplayOrder = displayorder;
                    lnk.Name         = name;
                    lnk.Url          = url;
                    lnk.Note         = note;
                    lnk.Logo         = logo;
                    lnk.Save();

                    num++;
                }
            }
            AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量更新友情链接", "");
            XCache.Remove(CacheKeys.FORUM_FORUM_LINK_LIST);
            if (flag)
            {
                base.RegisterStartupScript("PAGE", "alert('某些信息不完整,未能更新!');window.location.href='global_forumlinksgrid.aspx';");
                return;
            }
            base.RegisterStartupScript("PAGE", "window.location.href='global_forumlinksgrid.aspx';");
        }
예제 #4
0
        //public static int CreateForums(ForumInfo forumInfo)
        //{
        //    string text;
        //    return CreateForums(forumInfo, out text, 0, "API", 0, "API", "");
        //}

        //public static void SetForumsPathList()
        //{
        //    var generalConfigInfo = GeneralConfigInfo.Current;
        //    SetForumsPathList(generalConfigInfo.Aspxrewrite == 1, generalConfigInfo.Extname);
        //}

        //public static void SetForumsPathList(bool isaspxrewrite, string extname)
        //{
        //    DataTable forumListForDataTable = Forums.GetForumListForDataTable();
        //    string getForumPath = BaseConfigs.GetForumPath;
        //    foreach (DataRow dataRow in forumListForDataTable.Rows)
        //    {
        //        //2014-2-11 rewritename不知道是什么,没有找到这个字段,先注释掉
        //        string text = "";
        //        if (dataRow["parentidlist"].ToString().Trim() == "0")
        //        {
        //            //text = "<a href=\"" + ((dataRow["rewritename"].ToString().Trim() == string.Empty) ? string.Empty : getForumPath) + Urls.ShowForumAspxRewrite(dataRow["fid"].ToInt(0), 0, dataRow["rewritename"].ToString()) + "\">" + dataRow["name"].ToString().Trim() + "</a>";
        //            text = "<a href=\"" + (string.Empty) + Urls.ShowForumAspxRewrite(dataRow["fid"].ToInt(0), 0, "") + "\">" + dataRow["name"].ToString().Trim() + "</a>";
        //        }
        //        else
        //        {
        //            string[] array = dataRow["parentidlist"].ToString().Trim().Split(',');
        //            for (int i = 0; i < array.Length; i++)
        //            {
        //                string text2 = array[i];
        //                if (text2.IsNullOrEmpty())
        //                {
        //                    DataRow[] array2 = forumListForDataTable.Select("[fid]=" + text2);
        //                    if (array2.Length > 0)
        //                    {
        //                        string text3 = text;
        //                        text = text3 + "<a href=\"" + (string.Empty) + Urls.ShowForumAspxRewrite(array2[0]["fid"].ToInt(0), 0, "") + "\">" + array2[0]["name"].ToString().Trim() + "</a>";
        //                    }
        //                }
        //            }
        //            //Urls.ShowForumAspxRewrite(dataRow["fid"].ToInt(0), 0, dataRow["rewritename"].ToString());
        //            Urls.ShowForumAspxRewrite(dataRow["fid"].ToInt(0), 0, "");
        //            string text4 = text;
        //            text = text4 + "<a href=\"" + ("") + Urls.ShowForumAspxRewrite(dataRow["fid"].ToInt(0), 0, "") + "\">" + dataRow["name"].ToString().Trim() + "</a>";
        //        }
        //        //foreach (var item in BBX.Entity.Forum.FindAllWithCache())
        //        //{
        //        //    if (item.ID == int.Parse(dataRow["fid"].ToString()))
        //        //    {
        //        //        item.Pathlist = text;
        //        //        //BBX.Data.Forums.UpdateForumInfo(item);
        //        //        item.Save();
        //        //    }
        //        //}
        //        var f = BBX.Entity.XForum.FindByID(int.Parse(dataRow["fid"].ToString()));
        //        if (f != null)
        //        {
        //            f.Pathlist = text;
        //            f.Save();
        //        }
        //    }
        //}

        //public static void SetForumslayer()
        //{
        //    foreach (var item in Forums.GetForumList())
        //    {
        //        Int16 num = 0;
        //        string text = "";
        //        int parentid = item.ParentID;
        //        if (parentid == 0)
        //        {
        //            var forumInfo = Forums.GetForumInfo(item.Fid);
        //            if (forumInfo.Layer != num)
        //            {
        //                forumInfo.Layer = num;
        //                forumInfo.Parentidlist = "0";
        //                UpdateForumInfo(forumInfo);
        //            }
        //        }
        //        else
        //        {
        //            int num2;
        //            while (true)
        //            {
        //                num2 = parentid;
        //                parentid = Forums.GetForumInfo(parentid).ParentID;
        //                num++;
        //                if (parentid == 0)
        //                {
        //                    break;
        //                }
        //                text = num2 + "," + text;
        //            }
        //            text = (num2 + "," + text).TrimEnd(',');
        //            var forumInfo2 = Forums.GetForumInfo(item.Fid);
        //            if (forumInfo2.Layer != num || forumInfo2.Parentidlist != text)
        //            {
        //                forumInfo2.Layer = num;
        //                forumInfo2.Parentidlist = text;
        //                UpdateForumInfo(forumInfo2);
        //            }
        //        }
        //    }
        //}

        public static bool MovingForumsPos(Int32 currentfid, Int32 targetfid, bool isaschildnode)
        {
            string extname = GeneralConfigInfo.Current.Extname;
            //BBX.Data.Forums.MovingForumsPos(currentfid, targetfid, isaschildnode, extname);
            var src = XForum.FindByID(currentfid);
            var tar = XForum.FindByID(targetfid);

            if (!isaschildnode)
            {
                // 仅仅移动顺序
                src.DisplayOrder = tar.DisplayOrder - 1;

                src.Save();
            }
            else
            {
                // 作为子版块,仅更新部分数据,其它数据在一段时间后将会得以自动更新,这里不再处理
                src.ParentID = tar.ID;
                src.Save();
            }

            //SetForumslayer();
            SetForumsSubForumCountAndDispalyorder();
            //SetForumsPathList();
            XCache.Remove(CacheKeys.FORUM_UI_FORUM_LIST_BOX_OPTIONS);
            XCache.Remove(CacheKeys.FORUM_FORUM_LIST);
            return(true);
        }
예제 #5
0
        protected void savetopic_Click(object sender, EventArgs e)
        {
            XmlDocumentExtender xmlDocumentExtender = new XmlDocumentExtender();

            if (!File.Exists(this.configPath))
            {
                return;
            }
            xmlDocumentExtender.Load(this.configPath);
            string topicPath  = "/Aggregationinfo/Aggregationpage/Website/Forum/Topiclist/Topic";
            string topicPath2 = "/Aggregationinfo/Aggregationdata/Websiteaggregationdata/Topiclist/Topic";

            if (this.fid != "")
            {
                topicPath  = "/Aggregationinfo/Forum/Topiclist/Topic";
                topicPath2 = "/Aggregationinfo/Data/Topiclist/Topic";
            }
            this.ModifyNode(xmlDocumentExtender, topicPath);
            this.ModifyNode(xmlDocumentExtender, topicPath2);
            xmlDocumentExtender.Save(this.configPath);
            if (String.IsNullOrEmpty(this.fid))
            {
                AggregationFacade.BaseAggregation.ClearAllDataBind();
                base.Response.Redirect("aggregation_editforumaggset.aspx");
                return;
            }
            XCache.Remove("/Aggregation/TopicByForumId_" + this.fid);
            base.Response.Redirect("aggregation_editforumaggset.aspx?fid=" + this.fid);
        }
예제 #6
0
        private void UpdateAnnounceInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                //Announcements.UpdateAnnouncement(new AnnouncementInfo
                //{
                //    Id = DNTRequest.GetInt("id", 0),
                //    Poster = this.poster.Text.Trim(),
                //    Title = this.title.Text.Trim(),
                //    Displayorder = this.displayorder.Text.ToInt(),
                //    Starttime = this.starttime.Text.ToDateTime(),
                //    Endtime = this.endtime.Text.ToDateTime(),
                //    Message = Request["announcemessage_hidden"].Trim()
                //});

                var entity = Announcement.FindByID(DNTRequest.GetInt("id", 0));
                entity.Poster       = poster.Text.Trim();
                entity.Title        = title.Text.Trim();
                entity.Message      = Request["announcemessage_hidden"].Trim();
                entity.StartTime    = this.starttime.Text.ToDateTime();
                entity.EndTime      = this.endtime.Text.ToDateTime();
                entity.DisplayOrder = Int32.Parse(displayorder.Text);
                entity.Save();

                XCache.Remove(CacheKeys.FORUM_ANNOUNCEMENT_LIST);
                XCache.Remove(CacheKeys.FORUM_SIMPLIFIED_ANNOUNCEMENT_LIST);
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "更新公告", "更新公告,标题为:" + this.title.Text);
                base.RegisterStartupScript("PAGE", "window.location.href='global_announcegrid.aspx';");
            }
        }
예제 #7
0
        private void DelRec_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                if (Request["delid"] != "")
                {
                    //ForumLinks.DeleteForumLink(Request["delid"]);
                    //var ids = TypeConverter.StringToIntArray(Request["delid"]);
                    var ids = Request["delid"].SplitAsInt(",");
                    //var link = ForumLink.FindByID(WebHelper.RequestInt("delid"));
                    //if (link != null) link.Delete();
                    var links = ForumLink.FindAllByIds(ids);
                    if (links != null && links.Count > 0)
                    {
                        links.Delete();
                    }

                    AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "删除友情链接", "删除友情链接,ID为: " + Request["delid"].Replace("0 ", ""));
                    XCache.Remove(CacheKeys.FORUM_FORUM_LINK_LIST);
                    base.Response.Redirect("global_forumlinksgrid.aspx");
                    return;
                }
                base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='global_forumlinksgrid.aspx';</script>");
            }
        }
예제 #8
0
파일: forumsgrid.cs 프로젝트: xiongeee/BBX
        private void SaveForum_Click(object sender, EventArgs e)
        {
            int  num  = -1;
            bool flag = false;

            foreach (object current in this.DataGrid1.GetKeyIDArray())
            {
                int    fid  = int.Parse(current.ToString());
                string text = this.DataGrid1.GetControlValue(num, "name").Trim();
                //string text2 = this.DataGrid1.GetControlValue(num, "subforumcount").Trim();
                string text3 = this.DataGrid1.GetControlValue(num, "displayorder").Trim();
                if (String.IsNullOrEmpty(text) || !Utils.IsNumeric(text3))
                {
                    flag = true;
                }
                else
                {
                    var forumInfo = Forums.GetForumInfo(fid);
                    forumInfo.Name = text;
                    //forumInfo.SubforumCount = int.Parse(text2);
                    forumInfo.DisplayOrder = int.Parse(text3);
                    AdminForums.UpdateForumInfo(forumInfo);
                    num++;
                }
            }
            XCache.Remove(CacheKeys.FORUM_UI_FORUM_LIST_BOX_OPTIONS);
            XCache.Remove(CacheKeys.FORUM_FORUM_LIST);
            if (flag)
            {
                base.RegisterStartupScript("PAGE", "alert('某些记录取值不正确,未能被更新!');window.location.href='forum_forumsgrid.aspx';");
                return;
            }
            base.RegisterStartupScript("PAGE", "window.location.href='forum_forumsgrid.aspx';");
        }
예제 #9
0
 private void SaveInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         var config = GeneralConfigInfo.Current;
         config.Seotitle       = this.seotitle.Text;
         config.Seokeywords    = this.seokeywords.Text;
         config.Seodescription = this.seodescription.Text;
         config.Seohead        = this.seohead.Text;
         config.Archiverstatus = (int)Convert.ToInt16(this.archiverstatus.SelectedValue);
         config.Sitemapstatus  = (int)Convert.ToInt16(this.sitemapstatus.SelectedValue);
         config.Sitemapttl     = this.sitemapttl.Text.ToInt();
         config.Aspxrewrite    = (int)Convert.ToInt16(this.aspxrewrite.SelectedValue);
         if (this.extname.Text.IsNullOrWhiteSpace())
         {
             base.RegisterStartupScript("", "<script>alert('您未输入相应的伪静态url扩展名!');</script>");
             return;
         }
         config.Extname = this.extname.Text.Trim();
         //if (config.Aspxrewrite == 1)
         //{
         //    AdminForums.SetForumsPathList(true, config.Extname);
         //}
         //else
         //{
         //    AdminForums.SetForumsPathList(false, config.Extname);
         //}
         XCache.Remove(CacheKeys.FORUM_FORUM_LIST);
         config.Iisurlrewrite = iisurlrewrite.SelectedValue.ToInt();
         config.Save();;
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "搜索引擎优化设置", "");
         base.RegisterStartupScript("PAGE", "window.location.href='global_searchengine.aspx';");
     }
 }
예제 #10
0
        protected void savetopic_Click(object sender, EventArgs e)
        {
            XmlDocumentExtender xmlDocumentExtender = new XmlDocumentExtender();

            xmlDocumentExtender.Load(this.configPath);
            XmlNodeList             xmlNodeList             = xmlDocumentExtender.SelectNodes("/Aggregationinfo/Forum/Hottopiclist/Topic");
            XmlNodeInnerTextVisitor xmlNodeInnerTextVisitor = new XmlNodeInnerTextVisitor();

            foreach (XmlNode node in xmlNodeList)
            {
                xmlNodeInnerTextVisitor.SetNode(node);
                if (xmlNodeInnerTextVisitor["tid"] == this.topicid.Value)
                {
                    xmlNodeInnerTextVisitor["tid"]   = this.topicid.Value;
                    xmlNodeInnerTextVisitor["title"] = this.title.Text;
                    break;
                }
            }
            xmlNodeList = xmlDocumentExtender.SelectNodes("/Aggregationinfo/Data/Hottopiclist/Topic");
            foreach (XmlNode node2 in xmlNodeList)
            {
                xmlNodeInnerTextVisitor.SetNode(node2);
                if (xmlNodeInnerTextVisitor["tid"] == this.topicid.Value)
                {
                    xmlNodeInnerTextVisitor["tid"]   = this.topicid.Value;
                    xmlNodeInnerTextVisitor["title"] = this.title.Text;
                    break;
                }
            }
            xmlDocumentExtender.Save(this.configPath);
            XCache.Remove("/Aggregation/Hottopiclist");
            base.Response.Redirect("aggregation_edithottopic.aspx");
        }
예제 #11
0
 public static void SetAvailableForMedal(int available, string medailIdList)
 {
     if (Utils.IsNumericList(medailIdList))
     {
         BBX.Data.Medals.SetAvailableForMedal(available, medailIdList);
         XCache.Remove(CacheKeys.FORUM_UI_MEDALS_LIST);
     }
 }
예제 #12
0
파일: BanWords.cs 프로젝트: xiongeee/BBX
 public static int CreateBanWord(string adminUserName, string find, string replacement)
 {
     if (find != replacement)
     {
         XCache.Remove(CacheKeys.FORUM_BAN_WORD_LIST);
         return(Discuz.Data.BanWords.CreateBanWord(adminUserName, find.Trim('|'), replacement));
     }
     return(0);
 }
예제 #13
0
        private static void ResetCacheObjectAboutSmilies()
        {
            var cache = XCache.Current;

            XCache.Remove(CacheKeys.FORUM_UI_SMILIES_LIST);
            XCache.Remove("/Forum/UI/SmiliesListFirstPage");
            XCache.Remove(CacheKeys.FORUM_UI_SMILIES_LIST_WITH_INFO);
            //XCache.Remove("/Forum/UI/SmiliesTypeList");
        }
예제 #14
0
 private void UpdateAvatarCache_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         XCache.Remove(CacheKeys.FORUM_COMMON_AVATAR_LIST);
         this.url.UpdateFile();
         base.RegisterStartupScript("PAGE", "window.location.href='global_avatargrid.aspx';");
     }
 }
예제 #15
0
파일: Identifys.cs 프로젝트: xiongeee/BBX
 public static void DeleteIdentify(string idlist)
 {
     if (Utils.IsNumericList(idlist))
     {
         BBX.Data.Identifys.DeleteIdentify(idlist);
         XCache.Remove("/Forum/TopicIdentifys");
         XCache.Remove("/Forum/TopicIndentifysJsArray");
     }
 }
예제 #16
0
 public static void ResetPostTables()
 {
     if (GeneralConfigInfo.Current.Webgarden > 1 && Environment.Version.Major < 4)
     {
         Utils.RestartIISProcess();
         return;
     }
     XCache.Remove("/Forum/PostTables");
     XCache.Remove("/Forum/PostTableId");
 }
예제 #17
0
파일: BanWords.cs 프로젝트: xiongeee/BBX
 public static int DeleteBanWords(string idList)
 {
     if (Utils.IsNumericList(idList))
     {
         int result = Discuz.Data.BanWords.DeleteBanWords(idList);
         XCache.Remove(CacheKeys.FORUM_BAN_WORD_LIST);
         return(result);
     }
     return(0);
 }
예제 #18
0
        public DataSet LoadDataTable()
        {
            string @string = Request["path"];

            XCache.Remove("/Forum/" + @string + "/TemplateVariable");
            DataSet   dataSet = new DataSet();
            DataTable table   = ForumPageTemplate.GetTemplateVarList(BaseConfigs.GetForumPath, @string).Copy();

            dataSet.Tables.Add(table);
            return(dataSet);
        }
예제 #19
0
        /// <summary>执行SQL语句,返回受影响的行数</summary>
        /// <param name="sql">SQL语句</param>
        /// <param name="tableNames">受影响的表的表名</param>
        /// <returns></returns>
        public Int32 Execute(String sql, params String[] tableNames)
        {
            CheckBeforeUseDatabase();

            // 移除所有和受影响表有关的缓存
            if (EnableCache)
            {
                XCache.Remove(tableNames);
            }
            Interlocked.Increment(ref _ExecuteTimes);
            return(Session.Execute(sql));
        }
예제 #20
0
        /// <summary>执行插入语句并返回新增行的自动编号</summary>
        /// <param name="sql"></param>
        /// <param name="type">命令类型,默认SQL文本</param>
        /// <param name="ps">命令参数</param>
        /// <param name="tableNames">受影响的表的表名</param>
        /// <returns>新增行的自动编号</returns>
        public Int64 InsertAndGetIdentity(String sql, CommandType type, DbParameter[] ps, params String[] tableNames)
        {
            CheckBeforeUseDatabase();

            // 移除所有和受影响表有关的缓存
            if (EnableCache)
            {
                XCache.Remove(tableNames);
            }
            Interlocked.Increment(ref _ExecuteTimes);
            return(Session.InsertAndGetIdentity(sql, type, ps));
        }
예제 #21
0
 private void AddAnnounceInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         //Announcements.CreateAnnouncement(this.username, this.userid, this.title.Text, this.displayorder.Text.ToInt(0), this.starttime.Text, this.endtime.Text, Request["announcemessage_hidden"]);
         Announcement.Create(userid, username, title.Text, Request["announcemessage_hidden"], Utility.ToDateTime(starttime.Text), Utility.ToDateTime(endtime.Text), Int32.Parse(displayorder.Text));
         XCache.Remove(CacheKeys.FORUM_ANNOUNCEMENT_LIST);
         XCache.Remove(CacheKeys.FORUM_SIMPLIFIED_ANNOUNCEMENT_LIST);
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "添加公告", "添加公告,标题为:" + this.title.Text);
         base.RegisterStartupScript("PAGE", "window.location.href='global_announcegrid.aspx';");
     }
 }
예제 #22
0
 private void SaveInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         string fieldvalue = this.available.SelectedValue + "," + this.extcredits1.Text + "," + this.extcredits2.Text + "," + this.extcredits3.Text + "," + this.extcredits4.Text + "," + this.extcredits5.Text + "," + this.extcredits6.Text + "," + this.extcredits7.Text + "," + this.extcredits8.Text;
         //Forums.UpdateForumField(DNTRequest.GetInt("fid", 0), Request["fieldname"], fieldvalue);
         var f = XForum.FindByID(Request["fid"].ToInt());
         f.Field.SetItem(Request["fieldname"], fieldvalue);
         f.Field.Save();
         XCache.Remove(CacheKeys.FORUM_FORUM_LIST);
         base.RegisterStartupScript("PAGE", "window.location.href='forum_editforums.aspx?fid=" + Request["fid"] + "&tabindex=1';");
     }
 }
예제 #23
0
        protected void SaveVar_Click(object sender, EventArgs e)
        {
            this.dsSrc = this.LoadDataTable();
            int num = 0;

            foreach (object current in this.DataGrid1.GetKeyIDArray())
            {
                int    num2  = int.Parse(current.ToString());
                string text  = this.DataGrid1.GetControlValue(num, "variablename").Trim();
                string text2 = this.DataGrid1.GetControlValue(num, "variablevalue").Trim();
                if (!(String.IsNullOrEmpty(text)) && !(String.IsNullOrEmpty(text2)))
                {
                    foreach (DataRow dataRow in this.dsSrc.Tables["TemplateVariable"].Rows)
                    {
                        if (num2.ToString() == dataRow["id"].ToString())
                        {
                            dataRow["variablename"]  = text;
                            dataRow["variablevalue"] = text2;
                            break;
                        }
                    }
                    try
                    {
                        if (this.dsSrc.Tables[0].Rows.Count == 0)
                        {
                            File.Delete(Utils.GetMapPath("../../templates/" + Request["path"] + "/templatevariable.xml"));
                            this.dsSrc.Reset();
                            this.dsSrc.Dispose();
                        }
                        else
                        {
                            string fileName = base.Server.MapPath("../../templates/" + Request["path"] + "/templatevariable.xml");
                            this.dsSrc.WriteXml(fileName);
                            this.dsSrc.Reset();
                            this.dsSrc.Dispose();

                            XCache.Remove("/Forum/" + Request["path"] + "/TemplateVariable");
                            base.RegisterStartupScript("PAGE", "window.location.href='global_templatevariable.aspx?templateid=" + Request["templateid"] + "&path=" + Request["path"] + "&templatename=" + Request["templatename"] + "';");
                        }
                    }
                    catch
                    {
                        base.RegisterStartupScript("", "<script>alert('无法更新数据库.');window.location.href='global_templatevariable.aspx?templateid=" + Request["templateid"] + "&path=" + Request["path"] + "&templatename=" + Request["templatename"] + "';</script>");
                        break;
                    }
                    num++;
                }
            }
        }
예제 #24
0
        public Int32 Execute(DbCommand cmd, String[] tableNames)
        {
            CheckBeforeUseDatabase();

            Interlocked.Increment(ref _ExecuteTimes);
            var ret = Session.Execute(cmd);

            // 移除所有和受影响表有关的缓存
            if (EnableCache)
            {
                XCache.Remove(tableNames);
            }

            return(ret);
        }
예제 #25
0
 private void UpdateAdvertisementAvailable(int available)
 {
     if (base.CheckCookie())
     {
         if (Request["advid"] != "")
         {
             //Advertisements.UpdateAdvertisementAvailable(Request["advid"], available);
             Advertisement.SetAvailable(Request["advid"], available);
             XCache.Remove(CacheKeys.FORUM_ADVERTISEMENTS);
             base.RegisterStartupScript("PAGE", "window.location.href='advsgrid.aspx';");
             return;
         }
         base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='advsgrid.aspx';</script>");
     }
 }
예제 #26
0
        public Int64 InsertAndGetIdentity(String sql, params String[] tableNames)
        {
            CheckBeforeUseDatabase();

            Interlocked.Increment(ref _ExecuteTimes);

            var rs = Session.InsertAndGetIdentity(sql);

            // 移除所有和受影响表有关的缓存
            if (EnableCache)
            {
                XCache.Remove(tableNames);
            }

            return(rs);
        }
예제 #27
0
        public Int32 Execute(String sql, CommandType type, DbParameter[] ps, params String[] tableNames)
        {
            CheckBeforeUseDatabase();

            Interlocked.Increment(ref _ExecuteTimes);

            var rs = Session.Execute(sql, type, ps);

            // 移除所有和受影响表有关的缓存
            if (EnableCache)
            {
                XCache.Remove(tableNames);
            }

            return(rs);
        }
예제 #28
0
        private void DelAds_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                String ads = Request["advid"];
                if (ads != "")
                {
                    //Advertisements.DeleteAdvertisementList(Request["advid"]);
                    Advertisement.DeleteAll(ads);

                    XCache.Remove(CacheKeys.FORUM_ADVERTISEMENTS);
                    base.RegisterStartupScript("PAGE", "window.location.href='advsgrid.aspx';");
                    return;
                }
                base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='advsgrid.aspx';</script>");
            }
        }
예제 #29
0
 private void addrota_Click(object sender, EventArgs e)
 {
     if (this.rotaimg.Text.Trim() != "" && this.url.Text.Trim() != "" && this.titlecontent.Text.Trim() != "")
     {
         if (!Utils.IsURL(this.rotaimg.Text.Trim()) || !Utils.IsURL(this.url.Text.Trim()))
         {
             base.RegisterStartupScript("", "<script>alert('图片路径或点击链接可能是非法URL');</script>");
             this.BindData();
             this.ResetForm();
             return;
         }
         XmlDocumentExtender xmlDocumentExtender = new XmlDocumentExtender();
         xmlDocumentExtender.Load(this.configPath);
         int num = 0;
         if (xmlDocumentExtender.SelectSingleNode(this.targetNode) != null && xmlDocumentExtender.SelectSingleNode(this.targetNode).InnerText != "")
         {
             num = int.Parse(xmlDocumentExtender.SelectSingleNode(this.targetNode).LastChild["rotatepicid"].InnerText);
         }
         num++;
         XmlElement newChild = xmlDocumentExtender.CreateElement(this.nodeName);
         xmlDocumentExtender.AppendChildElementByNameValue(ref newChild, "rotatepicid", num.ToString());
         xmlDocumentExtender.AppendChildElementByNameValue(ref newChild, "pagetype", "1");
         xmlDocumentExtender.AppendChildElementByNameValue(ref newChild, "img", this.rotaimg.Text.Trim());
         xmlDocumentExtender.AppendChildElementByNameValue(ref newChild, "url", this.url.Text.Trim());
         xmlDocumentExtender.AppendChildElementByNameValue(ref newChild, "titlecontent", this.titlecontent.Text.Trim());
         xmlDocumentExtender.CreateNode(this.targetNode).AppendChild(newChild);
         xmlDocumentExtender.Save(this.configPath);
         AggregationFacade.BaseAggregation.ClearAllDataBind();
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "添加聚合页图版轮换广告", "添加聚合页图版轮换广告,名称为: " + this.titlecontent.Text.Trim());
         try
         {
             this.BindData();
             XCache.Remove(CacheKeys.FORUM_FORUM_LINK_LIST);
             this.ResetForm();
             base.RegisterStartupScript("PAGE", "window.location.href='aggregation_rotatepic.aspx?pagename=" + Request["pagename"] + "';");
             return;
         }
         catch
         {
             base.RegisterStartupScript("", "<script>alert('无法更新XML文件');window.location.href='aggregation_rotatepic.aspx?pagename=" + Request["pagename"] + "';</script>");
             return;
         }
     }
     base.RegisterStartupScript("", "<script>alert('图片或链接地址以及标题不能为空.');window.location.href='aggregation_rotatepic.aspx?pagename=" + Request["pagename"] + "';</script>");
 }
예제 #30
0
        public static void InsertMedalList(ArrayList medalFiles)
        {
            medalFiles.Remove("thumbs.db");
            DataTable existMedalList = BBX.Data.Medals.GetExistMedalList();

            foreach (DataRow dataRow in existMedalList.Rows)
            {
                medalFiles.Remove(dataRow["image"].ToString().ToLower());
            }
            int num = TypeConverter.ObjectToInt(existMedalList.Rows[existMedalList.Rows.Count - 1]["medalid"]) + 1;

            for (int i = 0; i < medalFiles.Count; i++)
            {
                int num2 = num + i;
                Medals.InsertMedal(num2, "Medal No." + num2, medalFiles[i].ToString());
            }
            XCache.Remove(CacheKeys.FORUM_UI_MEDALS_LIST);
        }