Exemplo n.º 1
0
        public void UpdateProfileDynamic(string userId, string schemeId, string gameCode, string issuseNumber, decimal totalMoney, string dynamicType)
        {
            try
            {
                DB.Begin();

                var man = new Sports_Manager();
                var ub  = new UserBalanceManager();

                var together = man.QuerySports_Together(schemeId);
                var user2    = string.Empty;
                switch (dynamicType)
                {
                case "参与合买":
                    user2 = together.CreateUserId;
                    break;
                }

                var user1Name = ub.QueryUserRegister(userId);
                var user2Name = new C_User_Register();
                if (!string.IsNullOrEmpty(user2))
                {
                    user2Name = ub.QueryUserRegister(user2);
                }

                var entity = new E_Blog_Dynamic()
                {
                    UserId           = userId,
                    UserDisplayName  = user1Name.DisplayName,
                    UserId2          = user2,
                    User2DisplayName = string.IsNullOrEmpty(user2) ? "" : user2Name.DisplayName,
                    GameCode         = gameCode,
                    GameType         = together == null ? "" : together.GameType,
                    IssuseNumber     = issuseNumber,
                    DynamicType      = dynamicType,
                    Guarantees       = together == null ? 0 : together.Guarantees,
                    Price            = together == null ? 0M : together.Price,
                    Progress         = together == null ? 0M : together.Progress,
                    TotalMonery      = together == null ? 0M : together.TotalMoney,
                    SchemeId         = schemeId,
                    Subscription     = together == null ? 0 : together.Subscription,
                    CreateTime       = DateTime.Now,
                };
                var manager = new BlogManager();
                manager.AddBlog_Dynamic(entity);
                DB.Commit();
            }
            catch (Exception ex)
            {
                DB.Rollback();
                throw ex;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 被关注
        /// </summary>
        public void UpdateProfileAttention_Passive(string activeUserId, string passiveUserId, int count)
        {
            string guanZhu = string.Empty;

            if (count == 1)
            {
                guanZhu = "被关注";
            }
            if (count == -1)
            {
                guanZhu = "取消被关注";
            }

            //添加一条动态
            var ub        = new UserBalanceManager();
            var user1Name = ub.QueryUserRegister(passiveUserId);
            var user2Name = ub.QueryUserRegister(activeUserId);
            var entity    = new E_Blog_Dynamic()
            {
                UserId           = passiveUserId,
                UserDisplayName  = user1Name.DisplayName,
                UserId2          = activeUserId,
                User2DisplayName = user2Name.DisplayName,
                GameCode         = "",
                GameType         = "",
                IssuseNumber     = "",
                DynamicType      = guanZhu,
                Guarantees       = 0,
                Price            = 0M,
                Progress         = 0M,
                TotalMonery      = 0M,
                SchemeId         = "",
                Subscription     = 0,
                CreateTime       = DateTime.Now,
            };
            var manager = new BlogManager();

            manager.AddBlog_Dynamic(entity);
        }