Exemplo n.º 1
0
        public static bool AddAgentUser2(User user)
        {
            try
            {
                //计算各级代理占成
                user.SubCompanyPercent   = user.SubCompanyPercent - user.PartnerPercent;
                user.PartnerPercent      = user.PartnerPercent - user.GeneralAgentPercent;
                user.GeneralAgentPercent = user.GeneralAgentPercent - user.AgentPercent;
                user.AgentPercent        = user.AgentPercent - user.Percent;
                //会员等级、跟投、吃货比例
                GradeManager  gm = new GradeManager();
                ConfigManager cm = new ConfigManager();
                user.UserLevel   = gm.GetDefaultGrade().ID.ToString();
                user.Coefficient = Convert.ToDecimal(cm.GetConfigByOtype("跟投系数").Oval);
                user.Proportion  = Convert.ToDecimal(cm.GetConfigByOtype("吃货比例").Oval);

                return(userService.AddAgentUser2(user));
            }
            catch (Exception ex)
            {
                return(false);
            }
        }