示例#1
0
    private void RemovePage()
    {
        string info = Utils.GetRequest("info", "all", 1, "", "");
        int    id   = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误"));
        int    hid  = int.Parse(Utils.GetRequest("hid", "get", 2, @"^[1-9]\d*$", "会员ID错误"));

        if (info == "")
        {
            Master.Title = "撤销记录";
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("确定撤销此记录吗");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<a href=\"" + Utils.getUrl("medal.aspx?info=ok&amp;act=remove&amp;id=" + id + "&amp;hid=" + hid + "&amp;backurl=" + Utils.getPage(0) + "") + "\">确定撤销</a><br />");
            builder.Append("<a href=\"" + Utils.getPage("medal.aspx?act=me&amp;hid=" + hid + "") + "\">先留着吧..</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        else
        {
            if (!new BCW.BLL.Medal().Exists(id, hid))
            {
                Utils.Error("不存在的记录", "");
            }
            BCW.Model.Medal model  = new BCW.BLL.Medal().GetMedalMe(id);
            string          sPayID = string.Empty;
            sPayID = Utils.Mid(model.PayID, 1, model.PayID.Length);
            sPayID = Utils.DelLastChar(sPayID, "#");
            string[] temp = Regex.Split(sPayID, "##");
            //得到位置
            int strPn = 0;
            for (int i = 0; i < temp.Length; i++)
            {
                if (temp[i].ToString() == hid.ToString())
                {
                    strPn = i;
                    break;
                }
            }
            string sPayExTime = string.Empty;
            sPayExTime = Utils.Mid(model.PayExTime, 1, model.PayExTime.Length);
            sPayExTime = Utils.DelLastChar(sPayExTime, "#");
            string[] temp2     = Regex.Split(sPayExTime, "##");
            string   PayExTime = string.Empty;
            for (int i = 0; i < temp2.Length; i++)
            {
                if (i != strPn)
                {
                    PayExTime += "#" + temp2[i] + "#";
                }
            }
            string PayID = model.PayID.Replace("#" + hid + "#", "");
            //更新
            new BCW.BLL.Medal().UpdatePayID(id, PayID, PayExTime);
            //清缓存
            string CacheKey = CacheName.App_UserMedal(hid);
            DataCache.RemoveByPattern(CacheKey);
            Utils.Success("撤销", "撤销成功..", Utils.getPage("medal.aspx?act=me&amp;hid=" + hid + ""), "1");
        }
    }
示例#2
0
    private void GrantSavePage()
    {
        int ID   = int.Parse(Utils.GetRequest("ID", "post", 2, @"^[1-9]\d*$", "勋章编号填写错误"));
        int iDay = int.Parse(Utils.GetRequest("iDay", "post", 2, @"^[0-9]\d*$", "勋章有效天数填写错误"));
        int hid  = int.Parse(Utils.GetRequest("hid", "post", 2, @"^[1-9]\d*$", "会员ID错误"));

        if (!new BCW.BLL.Medal().Exists(ID))
        {
            Utils.Error("不存在的勋章记录", "");
        }
        if (new BCW.BLL.Medal().Exists(ID, hid))
        {
            Utils.Error("此会员已存在这个勋章,如要修改期限请先撤销再授予", "");
        }

        BCW.Model.Medal model  = new BCW.BLL.Medal().GetMedal(ID);
        string          PayID  = model.PayID + "#" + hid + "#";
        string          ExTime = string.Empty;

        if (iDay == 0)
        {
            ExTime = "1990-1-1";
        }
        else
        {
            ExTime = DT.FormatDate(DateTime.Now.AddDays(iDay), 11);
        }

        string PayExTime = model.PayExTime + "#" + ExTime + "#";

        new BCW.BLL.Medal().UpdatePayID(ID, PayID, PayExTime);
        //清缓存
        string CacheKey = CacheName.App_UserMedal(hid);

        DataCache.RemoveByPattern(CacheKey);

        //记录获授勋章日志
        string DayTime = "" + iDay + "天";

        if (iDay == 0)
        {
            DayTime = "永久";
        }

        BCW.Model.Medalget m = new BCW.Model.Medalget();
        m.Types   = 0;
        m.UsID    = hid;
        m.MedalId = ID;
        m.Notes   = "" + model.Title + "[IMG]" + model.ImageUrl + "[/IMG][有效期" + DayTime + "]";
        m.AddTime = DateTime.Now;
        new BCW.BLL.Medalget().Add(m);


        Utils.Success("授予勋章", "授予勋章并记录授日志成功..", Utils.getUrl("medal.aspx?act=me&amp;hid=" + hid + "&amp;ptype=1"), "1");
    }
示例#3
0
    private void EditPage()
    {
        Master.Title = "编辑勋章";
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "勋章ID错误"));

        BCW.Model.Medal model = new BCW.BLL.Medal().GetMedal(id);
        if (model == null)
        {
            Utils.Error("不存在的记录", "");
        }
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("编辑勋章");
        builder.Append(Out.Tab("</div>", ""));
        string sText  = string.Empty;
        string sName  = string.Empty;
        string sTypes = string.Empty;
        string sValu  = string.Empty;
        string sEmpt  = string.Empty;

        if (model.Types > 0)
        {
            sText  = "价格(" + ub.Get("SiteBz") + "):/,库存数量:/,勋章有效期(天):/,";
            sName  = "iCent,iCount,iDay,";
            sTypes = "num,num,num,";
            sValu  = "" + model.iCent + "'" + model.iCount + "'" + model.iDay + "'";
            sEmpt  = "false,false,false,";
        }
        string strText = "勋章名称:/,勋章图片:/,勋章说明:/,勋章类型(选择系统勋章时,以下填写0):/,勋章所属论坛ID:/,排序:/," + sText + ",,";
        string strName = "Title,ImageUrl,Notes,Types,ForumId,Paixu," + sName + "id,act,backurl";
        string strType = "text,text,textarea,select,num,num," + sTypes + "hidden,hidden,hidden";
        string strValu = "" + model.Title + "'" + model.ImageUrl + "'" + model.Notes + "'" + model.Types + "'" + model.ForumId + "'" + model.Paixu + "'" + sValu + "" + id + "'editsave'" + Utils.getPage(0) + "";
        string strEmpt = "false,false,false,0|系统勋章|1|自定勋章|2|论坛勋章,false," + sEmpt + "false,false,false";
        string strIdea = "/";
        string strOthe = "确定编辑,medal.aspx,post,1,red";

        builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append(" <a href=\"" + Utils.getPage("medal.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("medal.aspx?act=del&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">删除此勋章</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("medal.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 />"));
    }
示例#4
0
    private void ReloadPage(string act)
    {
        Master.Title = "勋章管理";
        int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[0-2]$", "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("medal.aspx?act=" + act + "&amp;ptype=0&amp;backurl=" + Utils.getPage(0) + "") + "\">系统勋章</a>|");
        }

        if (ptype == 1)
        {
            builder.Append("自定义|");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("medal.aspx?act=" + act + "&amp;ptype=1&amp;backurl=" + Utils.getPage(0) + "") + "\">自定义</a>|");
        }


        if (ptype == 2)
        {
            builder.Append("论坛");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("medal.aspx?act=" + act + "&amp;ptype=2&amp;backurl=" + Utils.getPage(0) + "") + "\">论坛</a>");
        }


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

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

        string[] pageValUrl = { "act", "ptype", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        strWhere = "Types=" + ptype + "";

        // 开始读取列表
        IList <BCW.Model.Medal> listMedal = new BCW.BLL.Medal().GetMedals(pageIndex, pageSize, strWhere, out recordCount);

        if (listMedal.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Medal n in listMedal)
            {
                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.Append("<a href=\"" + Utils.getUrl("medal.aspx?act=edit&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[管理]&gt;</a>");
                if (ptype == 1)
                {
                    builder.Append("" + ((pageIndex - 1) * pageSize + k) + ".");
                }
                else
                {
                    builder.Append("" + n.ID + ".");
                }

                builder.AppendFormat("{0}<img src=\"{1}\" alt=\"load\"/>", n.Title, n.ImageUrl);
                if (act == "pick")
                {
                    string gUrl = Server.UrlDecode(Utils.getPage(0));
                    gUrl = gUrl.Replace("&amp;", "&");
                    gUrl = Regex.Replace(gUrl, @"([\s\S]+?)[&|?]{0,1}xz=[^&]*&{0,}", @"$1&amp;", RegexOptions.IgnoreCase);
                    gUrl = Out.UBB(gUrl);
                    builder.Append("<a href=\"" + Utils.getUrl(gUrl + "&amp;xz=" + n.ID + "") + "\">[选择]</a>");
                }
                builder.AppendFormat("<br />{0}", n.Notes);
                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("medal.aspx?act=add") + "\">添加勋章</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("medal.aspx?act=medallog") + "\">查看荣誉日志</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 MePage()
    {
        Master.Title = "查看会员勋章";

        int hid = int.Parse(Utils.GetRequest("hid", "get", 2, @"^[1-9]\d*$", "会员ID错误"));

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("" + new BCW.BLL.User().GetUsName(hid) + "的勋章");
        builder.Append(Out.Tab("</div>", "<br />"));

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

        string[] pageValUrl = { "hid" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        strWhere = "PayID LIKE '%#" + hid + "#%' and Types>=0";

        // 开始读取列表
        IList <BCW.Model.Medal> listMedal = new BCW.BLL.Medal().GetMedals(pageIndex, pageSize, strWhere, out recordCount);

        if (listMedal.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Medal n in listMedal)
            {
                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.Append("<a href=\"" + Utils.getUrl("medal.aspx?act=remove&amp;id=" + n.ID + "&amp;hid=" + hid + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[撤]</a>" + ((pageIndex - 1) * pageSize + k) + ".");
                builder.AppendFormat("{0}<img src=\"{1}\" alt=\"load\"/>", n.Title, n.ImageUrl);
                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("medal.aspx?act=medallog&amp;hid=" + hid + "") + "\">查看日志</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("medal.aspx?act=grant&amp;hid=" + hid + "") + "\">授予勋章</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("medal.aspx?act=view&amp;uid=" + hid + "") + "\">返回上一级</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 />"));
    }