Пример #1
0
    private void EditPage()
    {
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "红包群ID错误"));

        Master.Title = "编辑红包群";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("编辑红包群");
        builder.Append(Out.Tab("</div>", ""));
        BCW.Model.Chat model = new BCW.BLL.Chat().GetChat(id);
        if (model == null)
        {
            Utils.Error("不存在的红包群", "");
        }
        string ExTime = model.ExTime.ToString();

        if (DT.FormatDate(model.ExTime, 0) == "1990-01-01 00:00:00")
        {
            ExTime = "0";
        }
        string strText = "红包群名称:/,红包群主题(200字内):/,室主ID(多个用#分隔):/,见习室主ID(多个用#分隔):/,临管(多个用#分隔):/,红包群底部UBB:/,红包群基金:/,基金密码:/,最高在线:/,红包群积分:/,创建ID:/,关联城市ID:/,红包群类型:/,红包群密码(自建类型有效):/,抢币词语(15字内):/,抢币整点随机值(格式如10-20):/,抢币非整点随机值(格式如1-5):/,抢币循环时间(秒):/,排序:/,创建时间:/,过期时间(永不过期请填写0):/,,,";
        string strName = "ChatName,ChatNotes,ChatSZ,ChatJS,ChatLG,ChatFoot,ChatCent,CentPwd,ChatTopLine,ChatScore,UsID,GroupId,Types,ChatPwd,ChatCT,ChatCbig,ChatCsmall,ChatCon,Paixu,AddTime,ExTime,id,act,backurl";
        string strType = "text,text,text,text,text,textarea,num,text,num,text,num,num,select,text,text,text,text,num,snum,date,date,hidden,hidden,hidden";
        string strValu = "" + model.ChatName + "'" + model.ChatNotes + "'" + model.ChatSZ + "'" + model.ChatJS + "'" + model.ChatLG + "'" + model.ChatFoot + "'" + model.ChatCent + "'" + model.CentPwd + "'" + model.ChatTopLine + "'" + Convert.ToDouble(model.ChatScore) + "'" + model.UsID + "'" + model.GroupId + "'" + model.Types + "'" + model.ChatPwd + "'" + model.ChatCT + "'" + model.ChatCbig + "'" + model.ChatCsmall + "'" + model.ChatCon + "'" + model.Paixu + "'" + DT.FormatDate(model.AddTime, 0) + "'" + ExTime + "'" + id + "'editsave'" + Utils.getPage(0) + "";
        string strEmpt = "false,true,true,true,true,true,false,true,false,false,false,false,0|主题红包群|1|圈子红包群|2|同城红包群|3|自建红包群,true,true,true,true,false,false,false,false,false,false,false";
        string strIdea = "/";
        string strOthe = "编辑红包群|reset,chat.aspx,post,1,red|blue";

        builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        builder.Append(Out.Tab("<div>", "<br />"));
        builder.Append("温馨提示:<br />抢币词语如:“我要抢币”,限15字内.<br />当会员整点抢币时,系统自动调用整点随机值随机奖币,反之随机非整点值<br />抢币词语不为空与抢币循环时间不为0时将启用该红包群的抢币功能");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getPage("chat.aspx") + "\">返回上一级</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=del&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">删除此红包群</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Пример #2
0
    /// <summary>
    /// 清空聊天记录
    /// </summary>
    private void ClearPage()
    {
        int    id       = int.Parse(Utils.GetRequest("id", "get", 1, @"^[1-9]\d*$", "0"));
        string ChatName = string.Empty;

        if (id > 0)
        {
            BCW.Model.Chat model = new BCW.BLL.Chat().GetChatBasic(id);
            if (model == null)
            {
                Utils.Error("不存在的红包群", "");
            }
            ChatName = model.ChatName;
        }
        Master.Title = "清空" + ChatName + "聊天记录";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("清空" + ChatName + "聊天记录");
        builder.Append(Out.Tab("</div>", ""));

        builder.Append(Out.Tab("<div>", "<br />"));
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=clearok&amp;id=" + id + "&amp;ptype=1&amp;backurl=" + Utils.getPage(0) + "") + "\">清空本日前</a>");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div>", "<br />"));
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=clearok&amp;id=" + id + "&amp;ptype=2&amp;backurl=" + Utils.getPage(0) + "") + "\">清空本周前</a>");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div>", "<br />"));
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=clearok&amp;id=" + id + "&amp;ptype=3&amp;backurl=" + Utils.getPage(0) + "") + "\">清空本月前</a>");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div>", "<br />"));
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=clearok&amp;id=" + id + "&amp;ptype=4&amp;backurl=" + Utils.getPage(0) + "") + "\">清空全部</a>");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx") + "\">红包群管理</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Пример #3
0
    private void MorePage(int ptype)
    {
        string sText = string.Empty;

        if (ptype == 7)
        {
            sText = "圈子";
        }
        else if (ptype == 8)
        {
            sText = "论坛";
        }
        else
        {
            sText = "聊室";
        }

        Master.Title = "搜索" + sText + "";

        string keyword = Utils.GetRequest("keyword", "all", 2, @"^[\s\S]{1,10}$", "请输入1-10字的搜索关键字");

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("搜索:'" + keyword + "'结果:");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div>", ""));
        if (ptype == 7)
        {
            DataSet ds = new BCW.BLL.Group().GetList("ID,Title", "Status=0 and Title like '%" + keyword + "%'");
            if (ds != null && ds.Tables[0].Rows.Count != 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    int    id    = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                    string Title = ds.Tables[0].Rows[0]["Title"].ToString();
                    builder.Append("<a href=\"" + Utils.getUrl("/bbs/group.aspx?act=view&amp;id=" + id + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + Title + "</a><br />");
                }
            }
            else
            {
                builder.Append("没有相关记录..<br />");
            }
        }
        else if (ptype == 8)
        {
            DataSet ds = new BCW.BLL.Forum().GetList("ID,Title", "IsActive=0 and Title like '%" + keyword + "%'");
            if (ds != null && ds.Tables[0].Rows.Count != 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    int    id    = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                    string Title = ds.Tables[0].Rows[0]["Title"].ToString();
                    builder.Append("<a href=\"" + Utils.getUrl("/bbs/forum.aspx?forumid=" + id + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + Title + "</a><br />");
                }
            }
            else
            {
                builder.Append("没有相关记录..<br />");
            }
        }
        else if (ptype == 9)
        {
            DataSet ds = new BCW.BLL.Chat().GetList("ID,ChatName", "(ExTime='1990-1-1' OR ExTime>'" + DateTime.Now + "') and ChatName like '%" + keyword + "%'");
            if (ds != null && ds.Tables[0].Rows.Count != 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    int    id    = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                    string Title = ds.Tables[0].Rows[0]["ChatName"].ToString();
                    builder.Append("<a href=\"" + Utils.getUrl("/bbs/chatroom.aspx?id=" + id + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + Title + "</a><br />");
                }
            }
            else
            {
                builder.Append("没有相关记录..<br />");
            }
        }
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"title\">", Out.RHr()));
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getPage("search.aspx") + "\">返回上级</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Пример #4
0
    private void Add2Page()
    {
        string  RadioType     = "multiple";
        int     ptype         = int.Parse(Utils.GetRequest("ptype", "get", 2, @"^[1-9]\d*$", "类型选择错误"));
        int     leibie        = int.Parse(Utils.GetRequest("leibie", "all", 1, @"^[0-9]\d*$", "0"));
        int     nid           = int.Parse(Utils.GetRequest("nid", "all", 1, @"^[0-9]\d*$", "0"));
        int     p             = int.Parse(Utils.GetRequest("p", "get", 2, @"^[0-9]\d*$", "类型选择错误"));
        string  strEmptyValue = string.Empty;
        DataSet ds            = null;

        if (ptype <= 4)
        {
            //查询条件
            string strWhere = string.Empty;
            if (ptype == 1)
            {
                strWhere = "Types=11";
            }
            else if (ptype == 2)
            {
                strWhere = "Types=12";
            }
            else if (ptype == 3)
            {
                strWhere = "Types=13";
            }
            else if (ptype == 4)
            {
                strWhere = "Types=14";
            }

            ds = new BCW.BLL.Topics().GetList("ID,Title", strWhere);
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    strEmptyValue += "|" + ds.Tables[0].Rows[i]["ID"].ToString() + "|" + ds.Tables[0].Rows[i]["Title"].ToString() + "";
                }
                strEmptyValue = "0|全部栏目" + strEmptyValue;
            }
            else
            {
                strEmptyValue = "0|全部栏目";
            }
        }
        else if (ptype == 5)
        {
            strEmptyValue = "0|全部栏目";
        }
        else if (ptype == 6)
        {
            strEmptyValue = "0|全部分类|" + ub.GetSub("LinkLeibie", "/Controls/link.xml") + "";
        }
        else if (ptype == 7 || ptype == 15)//论坛
        {
            if (ptype == 7)
            {
                ds = new BCW.BLL.Forum().GetList("ID,Title", "IsActive=0");
            }
            else
            {
                ds = new BCW.BLL.Forum().GetList("ID,Title", "IsActive=0 and GroupId>0");
            }

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    strEmptyValue += "|" + ds.Tables[0].Rows[i]["ID"].ToString() + "|" + ds.Tables[0].Rows[i]["Title"].ToString() + "";
                }
                strEmptyValue = "0|全部论坛" + strEmptyValue;
            }
            else
            {
                strEmptyValue = "0|全部论坛";
            }
        }
        else if (ptype == 8 || ptype == 9)
        {
            strEmptyValue = "0|全部分类";
        }
        else if (ptype == 10)
        {
            if (p != 2)
            {
                strEmptyValue = "0|全部记录";
            }
            else
            {
                RadioType     = "select";
                strEmptyValue = "0|全部游戏|1|剪刀石头|2|ktv789|3|猜猜乐|4|竞拍|6|幸运二八|8|疯狂彩球|9|挖宝竞猜|10|跑马游戏|11|上证竞猜|12|社区商城";
                if (Utils.GetDomain().Contains("kubao") || Utils.GetDomain().Contains("tuhao") || Utils.GetDomain().Contains("th") || Utils.GetDomain().Contains("kb288"))
                {
                    strEmptyValue += "|13|大小庄";
                    strEmptyValue += "|14|疯狂吹牛";
                }
                strEmptyValue += "|15|结婚系统";
                if (Utils.GetDomain().Contains("168yy") || Utils.GetDomain().Contains("tl88"))
                {
                    strEmptyValue += "|16|猜拳游戏";
                }
            }
        }
        else if (ptype == 11)
        {
            strEmptyValue = "0|全部记录";
        }
        else if (ptype == 12)
        {
            ds = new BCW.BLL.Chat().GetList("ID,ChatName", "Types=0");
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    strEmptyValue += "|" + ds.Tables[0].Rows[i]["ID"].ToString() + "|" + ds.Tables[0].Rows[i]["ChatName"].ToString() + "";
                }
                strEmptyValue = "0|全部聊室" + strEmptyValue;
            }
            else
            {
                strEmptyValue = "0|全部聊室";
            }
        }
        else if (ptype == 13)
        {
            if (p < 4)
            {
                //查询条件
                string strWhere = string.Empty;
                if (p == 0)
                {
                    strWhere = "Types=11";
                }
                else if (p == 1)
                {
                    strWhere = "Types=13";
                }
                else if (p == 2)
                {
                    strWhere = "Types=12";
                }
                else if (p == 3)
                {
                    strWhere = "Types=14";
                }

                ds = new BCW.BLL.Topics().GetList("ID,Title", strWhere);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        strEmptyValue += "|" + ds.Tables[0].Rows[i]["ID"].ToString() + "|" + ds.Tables[0].Rows[i]["Title"].ToString().Replace("|", "") + "";
                    }
                    strEmptyValue = "0|全部栏目" + strEmptyValue;
                }
                else
                {
                    strEmptyValue = "0|全部栏目";
                }
            }
            else
            {
                strEmptyValue = "0|全部记录";
            }
        }
        else if (ptype == 14)
        {
            strEmptyValue = "0|全部记录";
        }
        builder.Append(Out.Tab("<div class=\"title\">选择调用栏目</div>", ""));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("选择调用栏目:");
        builder.Append(Out.Tab("</div>", ""));

        string strText = ",,,,,,,";
        string strName = "NodeId,ptype,p,leibie,nid,act,backurl";
        string strType = "" + RadioType + ",hidden,hidden,hidden,hidden,hidden,hidden";
        string strValu = "";

        if (ptype != 13)
        {
            strValu = "0'" + ptype + "'" + p + "'" + leibie + "'" + nid + "'add3'" + Utils.getPage(0) + "";
        }
        else
        {
            strValu = "0'" + ptype + "'" + p + "'" + leibie + "'" + nid + "'add6'" + Utils.getPage(0) + "";
        }

        string strEmpt = "" + strEmptyValue + ",false,false,false,false,false,false";
        string strIdea = "/";
        string strOthe = "下一步,smart.aspx,post,1,red";

        builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("smart.aspx?backurl=" + Utils.getPage(0) + "") + "\">返回上一级</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Пример #5
0
    private void ReloadPage()
    {
        Master.Title = "红包群管理";
        int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[0-3]$", "0"));

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("红包群管理");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"text\">", ""));
        if (ptype == 0)
        {
            builder.Append("主题红包群|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?ptype=0") + "\">主题</a>|");
        }

        //if (ptype == 1)
        //    builder.Append("圈子红包群|");
        //else
        //    builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?ptype=1") + "\">圈子</a>|");

        if (ptype == 2)
        {
            builder.Append("同城红包群|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?ptype=2") + "\">同城</a>|");
        }

        if (ptype == 3)
        {
            builder.Append("自建红包群");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?ptype=3") + "\">自建</a>");
        }

        builder.Append(Out.Tab("</div>", "<br />"));

        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";
        string strOrder = "";

        string[] pageValUrl = { "ptype", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        //查询条件
        strWhere = "Types=" + ptype + "";
        //排序条件
        strOrder = "Paixu Asc";
        // 开始读取列表
        IList <BCW.Model.Chat> listChat = new BCW.BLL.Chat().GetChats(pageIndex, pageSize, strWhere, strOrder, out recordCount);

        if (listChat.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Chat n in listChat)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }
                builder.AppendFormat("<a href=\"" + Utils.getUrl("chat.aspx?act=edit&amp;id={0}&amp;backurl=" + Utils.PostPage(1) + "") + "\">[管理]&gt;</a>{1}.<a href=\"" + Utils.getUrl("chat.aspx?act=text&amp;id={0}&amp;backurl=" + Utils.PostPage(1) + "") + "\">{2}(ID:{0})</a>", n.ID, n.Paixu, n.ChatName);
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=add") + "\">添加红包群</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=set") + "\">红包群设置</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=clear") + "\">清空聊天记录</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=hb") + "\">红包功能管理</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Пример #6
0
    private void EditSavePage()
    {
        int ManageId = new BCW.User.Manage().IsManageLogin();

        if (ManageId != 1)
        {
            Utils.Error("此功能暂停开放", "");
        }
        int      id          = int.Parse(Utils.GetRequest("id", "post", 2, @"^[1-9]\d*$", "红包群ID错误"));
        string   ChatName    = Utils.GetRequest("ChatName", "post", 2, @"^[^\^]{1,20}$", "聊天名称限20字内");
        string   ChatNotes   = Utils.GetRequest("ChatNotes", "post", 3, @"^[^\^]{1,200}$", "红包群主题限200字内,可留空");
        string   ChatSZ      = Utils.GetRequest("ChatSZ", "post", 3, @"^[0-9]{1,10}(?:\#[0-9]{1,10}){0,500}$", "室主ID多个请用#分隔,可留空");
        string   ChatJS      = Utils.GetRequest("ChatJS", "post", 3, @"^[0-9]{1,10}(?:\#[0-9]{1,10}){0,500}$", "见习室主ID多个请用#分隔,可留空");
        string   ChatLG      = Utils.GetRequest("ChatLG", "post", 3, @"^[0-9]{1,10}(?:\#[0-9]{1,10}){0,500}$", "临管ID多个请用#分隔,可留空");
        string   ChatFoot    = Utils.GetRequest("ChatFoot", "post", 3, @"^[^\^]{1,2000}$", "红包群底部UBB限2000字内,可留空");
        int      ChatCent    = int.Parse(Utils.GetRequest("ChatCent", "post", 2, @"^[0-9]\d*$", "红包群基金填写错误"));
        string   CentPwd     = Utils.GetRequest("CentPwd", "post", 3, @"^[A-Za-z0-9]{4,20}$", "基金密码限4-20位,必须由字母或数字组成");
        int      ChatTopLine = int.Parse(Utils.GetRequest("ChatTopLine", "post", 2, @"^[0-9]\d*$", "最高在线人数填写错误"));
        int      ChatScore   = int.Parse(Utils.GetRequest("ChatScore", "post", 2, @"^[0-9]\d*$", "红包群积分填写错误"));
        int      UsID        = int.Parse(Utils.GetRequest("UsID", "post", 2, @"^[0-9]\d*$", "创建ID填写错误"));
        int      GroupId     = int.Parse(Utils.GetRequest("GroupId", "post", 2, @"^[0-9]\d*$", "关联ID填写错误"));
        int      Types       = int.Parse(Utils.GetRequest("Types", "post", 2, @"^[0-3]$", "类型选择错误"));
        string   ChatPwd     = Utils.GetRequest("ChatPwd", "post", 3, @"^[A-Za-z0-9]{1,20}$", "红包群密码限1-20位,必须由字母或数字组成,可留空");
        string   ChatCT      = Utils.GetRequest("ChatCT", "post", 3, @"^[A-Za-z\u4e00-\u9fa5]{1,15}$", "抢币词语10字内,不能使用特殊符号,可留空");
        string   ChatCbig    = Utils.GetRequest("ChatCbig", "post", 3, @"^[1-9]\d*-[1-9]\d*$", "抢币整点随机值填写格式10-20,不开放抢币请留空");
        string   ChatCsmall  = Utils.GetRequest("ChatCsmall", "post", 3, @"^[1-9]\d*-[1-9]\d*$", "抢币非整点随机值填写格式1-5,不开放抢币请留空");
        int      ChatCon     = int.Parse(Utils.GetRequest("ChatCon", "post", 2, @"^[0-9]\d*$", "循环时间必须为数字,不开放抢币请填写0"));
        int      Paixu       = int.Parse(Utils.GetRequest("Paixu", "post", 2, @"^[0-9]\d*$", "排序必须为数字"));
        DateTime AddTime     = Utils.ParseTime(Utils.GetRequest("AddTime", "post", 2, DT.RegexTime, "创建时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + ""));
        string   sExTime     = Utils.GetRequest("ExTime", "post", 1, "", "");
        DateTime ExTime      = DateTime.Parse("1990-01-01 00:00:00");

        if (sExTime != "0")
        {
            ExTime = Utils.ParseTime(Utils.GetRequest("ExTime", "post", 2, DT.RegexTime, "过期时间填写错误,永不过期请填写0"));
        }

        //抢币随机值判断
        if (ChatCbig != "" && ChatCsmall != "")
        {
            string[] Cbig = ChatCbig.Split("-".ToCharArray());
            if (Convert.ToInt32(Cbig[0]) >= Convert.ToInt32(Cbig[1]))
            {
                Utils.Error("抢币整点随机值填写格式10-20,不开放抢币请留空", "");
            }
            string[] Csmall = ChatCsmall.Split("-".ToCharArray());
            if (Convert.ToInt32(Csmall[0]) >= Convert.ToInt32(Csmall[1]))
            {
                Utils.Error("抢币非整点随机值填写格式1-5,不开放抢币请留空", "");
            }
        }
        BCW.Model.Chat m = new BCW.BLL.Chat().GetChat(id);
        if (m == null)
        {
            Utils.Error("不存在的红包群", "");
        }
        if (UsID > 0)
        {
            if (!new BCW.BLL.User().Exists(UsID))
            {
                Utils.Error("不存在的创建ID", "");
            }
        }
        if (Types == 3 && sExTime == "0")
        {
            Utils.Error("选择自建类型时,过期时间不能填写0", "");
        }
        string getChatPwd = new BCW.BLL.Chat().GetChatPwd(id);

        if (getChatPwd != ChatPwd)
        {
            new BCW.BLL.Chat().UpdatePwdID(id, "");//清空进入的ID标识
        }
        //抢币标识
        string sCTemp = string.Empty;

        if (ChatCT != m.ChatCT)
        {
            string   CText = Utils.ConvertSeparated(ChatCT, 1, "#");
            string[] CTemp = CText.Split("#".ToCharArray());
            for (int i = 0; i < CTemp.Length; i++)
            {
                sCTemp += "#0";
            }
            sCTemp = Utils.Mid(sCTemp, 1, sCTemp.Length);
        }
        else
        {
            sCTemp = m.ChatCId;
        }

        BCW.Model.Chat model = new BCW.Model.Chat();
        model.ID          = id;
        model.ChatName    = ChatName;
        model.ChatNotes   = ChatNotes;
        model.ChatSZ      = ChatSZ;
        model.ChatJS      = ChatJS;
        model.ChatLG      = ChatLG;
        model.ChatFoot    = ChatFoot;
        model.ChatCent    = ChatCent;
        model.CentPwd     = CentPwd;
        model.ChatTopLine = ChatTopLine;
        model.ChatScore   = ChatScore;
        model.UsID        = UsID;
        model.GroupId     = GroupId;
        model.Types       = Types;
        model.ChatPwd     = ChatPwd;
        model.ChatCT      = ChatCT;
        model.ChatCbig    = ChatCbig;
        model.ChatCsmall  = ChatCsmall;
        model.ChatCId     = sCTemp;//初始化抢币
        model.ChatCon     = ChatCon;
        model.Paixu       = Paixu;
        model.AddTime     = AddTime;
        model.ExTime      = ExTime;
        new BCW.BLL.Chat().Update(model);
        Utils.Success("编辑红包群", "编辑红包群成功..", Utils.getUrl("chat.aspx?act=edit&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + ""), "1");
    }
Пример #7
0
    /// <summary>
    /// 清空聊天记录
    /// </summary>
    private void ClearOkPage()
    {
        int    id       = int.Parse(Utils.GetRequest("id", "get", 1, @"^[1-9]\d*$", "0"));
        string ChatName = string.Empty;

        if (id > 0)
        {
            BCW.Model.Chat model = new BCW.BLL.Chat().GetChatBasic(id);
            if (model == null)
            {
                Utils.Error("不存在的红包群", "");
            }
            ChatName = model.ChatName;
        }
        Master.Title = "清空" + ChatName + "聊天记录";
        string act   = Utils.GetRequest("act", "get", 1, "", "");
        string info  = Utils.GetRequest("info", "get", 1, "", "");
        int    ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[1-4]$", "0"));

        if (info != "ok" && info != "acok")
        {
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("确定要清空" + ChatName + "聊天记录吗");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?info=ok&amp;act=" + act + "&amp;id=" + id + "&amp;ptype=" + ptype + "&amp;backurl=" + Utils.getPage(0) + "") + "\">确定清空</a><br />");
            builder.Append("<a href=\"" + Utils.getPage("chat.aspx") + "\">先留着吧..</a>");
            builder.Append(Out.Tab("</div>", ""));
            builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<a href=\"" + Utils.getUrl("chat.aspx") + "\">红包群管理</a><br />");
            builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        else
        {
            if (info == "ok")
            {
                Utils.Success("正在清空", "正在清空,请稍后..", Utils.getUrl("chat.aspx?info=acok&amp;act=" + act + "&amp;id=" + id + "&amp;ptype=" + ptype + "&amp;backurl=" + Utils.getPage(0) + ""), "2");
            }
            else
            {
                string strWhere = string.Empty;
                if (id > 0)
                {
                    strWhere = "ChatId=" + id + " and ";
                }

                if (ptype == 1)
                {
                    //保留本日计算
                    M_Str_mindate = DateTime.Now.ToShortDateString() + " 0:00:00";
                    new BCW.BLL.ChatText().DeleteStr2("" + strWhere + " AddTime<'" + M_Str_mindate + "'");
                }
                else if (ptype == 2)
                {
                    //保留本周计算
                    switch (DateTime.Now.DayOfWeek)
                    {
                    case DayOfWeek.Monday:
                        M_Str_mindate = DateTime.Now.AddDays(0).ToShortDateString() + " 0:00:00";
                        break;

                    case DayOfWeek.Tuesday:
                        M_Str_mindate = DateTime.Now.AddDays(-1).ToShortDateString() + " 0:00:00";
                        break;

                    case DayOfWeek.Wednesday:
                        M_Str_mindate = DateTime.Now.AddDays(-2).ToShortDateString() + " 0:00:00";
                        break;

                    case DayOfWeek.Thursday:
                        M_Str_mindate = DateTime.Now.AddDays(-3).ToShortDateString() + " 0:00:00";
                        break;

                    case DayOfWeek.Friday:
                        M_Str_mindate = DateTime.Now.AddDays(-4).ToShortDateString() + " 0:00:00";
                        break;

                    case DayOfWeek.Saturday:
                        M_Str_mindate = DateTime.Now.AddDays(-5).ToShortDateString() + " 0:00:00";
                        break;

                    case DayOfWeek.Sunday:
                        M_Str_mindate = DateTime.Now.AddDays(-6).ToShortDateString() + " 0:00:00";
                        break;
                    }
                    new BCW.BLL.ChatText().DeleteStr2("" + strWhere + " AddTime<'" + M_Str_mindate + "'");
                }
                else if (ptype == 3)
                {
                    //保留本月计算
                    string MonthText = DateTime.Now.Year + "-" + DateTime.Now.Month;
                    M_Str_mindate = MonthText + "-1 0:00:00";
                    new BCW.BLL.ChatText().DeleteStr2("" + strWhere + " AddTime<'" + M_Str_mindate + "'");
                }
                else if (ptype == 4)
                {
                    if (id > 0)
                    {
                        new BCW.BLL.ChatText().DeleteStr2("ChatId=" + id + "");
                    }
                    else
                    {
                        new BCW.BLL.ChatText().DeleteStr2("");
                    }
                }
                Utils.Success("清空成功", "清空操作成功..", Utils.getPage("chat.aspx"), "2");
            }
        }
    }
Пример #8
0
    private void TextPage()
    {
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "红包群ID错误"));

        BCW.Model.Chat model = new BCW.BLL.Chat().GetChatBasic(id);
        if (model == null)
        {
            Utils.Error("不存在的红包群", "");
        }
        Master.Title = "" + model.ChatName + "聊天记录";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("" + model.ChatName + "聊天记录");
        builder.Append(Out.Tab("</div>", "<br />"));

        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "act", "id", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        //查询条件
        strWhere = "ChatId=" + id + "";
        // 开始读取列表
        IList <BCW.Model.ChatText> listChatText = new BCW.BLL.ChatText().GetChatTexts(pageIndex, pageSize, strWhere, out recordCount);

        if (listChatText.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.ChatText n in listChatText)
            {
                if (k == 1)
                {
                    builder.Append(Out.Tab("<div>", ""));
                }
                else
                {
                    builder.Append(Out.Tab("<div>", "<br />"));
                }

                builder.Append((pageIndex - 1) * pageSize + k + ".");
                int    Isac    = 0;
                string Content = n.Content.Trim();
                if (Content.Contains("$N"))
                {
                    Isac    = 1;
                    Content = Content.Replace("$N", n.UsName).Replace("$n", n.ToName);
                }
                builder.AppendFormat("<a href=\"" + Utils.getUrl("uinfo.aspx?uid={0}&amp;backurl=" + Utils.PostPage(1) + "") + "\">{1}({0})</a>", n.UsID, n.UsName);

                if (n.ToID == 0)
                {
                    builder.AppendFormat(":{0}[{1}]", Out.SysUBB(Content), DT.FormatDate(n.AddTime, 10));
                }
                else
                {
                    if (Isac == 0)
                    {
                        builder.AppendFormat("对{0}说", n.ToName);
                    }
                    builder.AppendFormat(":{0}[{1}]", Out.SysUBB(Content), DT.FormatDate(n.AddTime, 10));
                }
                builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=deltext&amp;id=" + n.ChatId + "&amp;uid=" + n.UsID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[删]</a>");
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getPage("chat.aspx") + "\">返回上一级</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("chat.aspx?act=clear&amp;id=" + id + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">清空聊天记录</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }