Ejemplo n.º 1
0
    private void GroupSavePage(int uid)
    {
        string Title = Utils.GetRequest("Title", "post", 2, @"^[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{1,10}$", "分组名称限1-10字,不能使用特殊字符");
        int    Paixu = int.Parse(Utils.GetRequest("Paixu", "post", 2, @"^[0-9]\d*$", "排序必须是数字形式"));

        if (new BCW.BLL.Favgroup().ExistsTitle(uid, Title, 0))
        {
            Utils.Error("此收藏夹名称已存在", "");
        }
        BCW.Model.Favgroup model = new BCW.Model.Favgroup();
        model.Types   = 0;
        model.Title   = Title;
        model.UsID    = uid;
        model.Paixu   = Paixu;
        model.AddTime = DateTime.Now;
        new BCW.BLL.Favgroup().Add(model);

        Utils.Success("添加收藏夹", "添加收藏夹成功,正在返回..", Utils.getUrl("favorites.aspx?act=group&backurl=" + Utils.getPage(0) + ""), "1");
    }
Ejemplo n.º 2
0
    private void EditGroupSavePage(int uid)
    {
        int    id    = int.Parse(Utils.GetRequest("id", "post", 2, @"^[0-9]\d*$", "ID错误"));
        string Title = Utils.GetRequest("Title", "post", 2, @"^[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{1,10}$", "收藏夹名称限1-10字,不能使用特殊字符");
        int    Paixu = int.Parse(Utils.GetRequest("Paixu", "post", 2, @"^[0-9]\d*$", "排序必须是数字形式"));

        if (!new BCW.BLL.Favgroup().Exists(id, uid, 0))
        {
            Utils.Error("不存在的记录", "");
        }
        BCW.Model.Favgroup model = new BCW.Model.Favgroup();
        model.ID      = id;
        model.Types   = 0;
        model.Title   = Title;
        model.UsID    = uid;
        model.Paixu   = Paixu;
        model.AddTime = DateTime.Now;
        new BCW.BLL.Favgroup().Update(model);

        Utils.Success("编辑收藏夹分组", "编辑收藏夹成功,正在返回..", Utils.getUrl("favorites.aspx?act=group&backurl=" + Utils.getPage(0) + ""), "1");
    }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BCW.Model.Favgroup model)
 {
     dal.Update(model);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(BCW.Model.Favgroup model)
 {
     return(dal.Add(model));
 }