public void DaoJuZS()
    {
        string userId     = UiCommon.UserLoginInfo.UserID;
        string userName   = UiCommon.UserLoginInfo.UserName;
        string propId     = Common.SqlEncode(Common.GetStringOfUrl("id"));
        string targetName = Common.GetStringOfUrl("targetname");
        int    count      = Common.GetIntOfUrl("count");

        BLL.Member member = new BLL.Member();
        if (userName.Trim() == targetName.Trim())
        {
            //1.如果被赠送用户是自己,不允许赠送
            Response.Write("myself");
        }
        else if (!member.ExistName(Common.SqlEncode(targetName)))
        {
            //2.被赠送的用户不存在
            Response.Write("nouser");
        }
        else if (count > member.GetDaoJuCount(userId, propId))
        {
            //3.赠送人道具库中的道具数量不足或没有
            Response.Write("nodaoju");
        }
        else
        {
            //4.赠送
            int iRows = member.ZengsongDaoJu(userId, member.GetUserID(targetName), propId, count);
            if (iRows > 0)
            {
                Response.Write("zsdjcg");
            }
            else
            {
                Response.Write("zsdjsb");
            }
        }
    }
Beispiel #2
0
    public void DaoJuZS()
    {
        string userId = UiCommon.UserLoginInfo.UserID;
        string userName = UiCommon.UserLoginInfo.UserName;
        string propId = Common.SqlEncode(Common.GetStringOfUrl("id"));
        string targetName = Common.GetStringOfUrl("targetname");
        int count = Common.GetIntOfUrl("count");

        BLL.Member member = new BLL.Member();
        if (userName.Trim() == targetName.Trim())
        {
            //1.如果被赠送用户是自己,不允许赠送
            Response.Write("myself");
        }
        else if (!member.ExistName(Common.SqlEncode(targetName)))
        {
            //2.被赠送的用户不存在
            Response.Write("nouser");
        }
        else if (count > member.GetDaoJuCount(userId, propId))
        {
            //3.赠送人道具库中的道具数量不足或没有
            Response.Write("nodaoju");
        }
        else
        {
            //4.赠送
            int iRows = member.ZengsongDaoJu(userId, member.GetUserID(targetName), propId, count);
            if (iRows > 0)
            {
                Response.Write("zsdjcg");
            }
            else
            {
                Response.Write("zsdjsb");
            }
        }
    }