예제 #1
0
        public string GetUseLevelName(string code)
        {
            UserDTO model = UserServer.GetModelCode(code);

            if (model != null)
            {
                return(lvelname.GetLevelName(model.LevelID).LevelName);
            }
            else
            {
                return("会员不存在");
            }
        }
예제 #2
0
        public string Tree(long id, string code, int znode)
        {
            UserView uv    = new UserView();
            UserDTO  model = UserServer.GetModelCode(code);

            if (model != null)
            {
                if (id == 0)
                {
                    id = model.ID;
                }
            }
            return(uv.AddTable(id, znode));
        }
예제 #3
0
        public string TreeSeachMethod(string code, string id)
        {
            UserDTO us = new UserDTO();

            if (code != "")
            {
                us = UserServer.GetModelCode(code);
            }
            else
            {
                us = UserServer.GetModelCode("system");
            }

            return(TreeMethod(int.Parse(us.ID.ToString()), id));
        }
예제 #4
0
        public string Tree(long Id, string code, int znode)
        {
            UserView uv = new UserView();
            //long Id = Convert.ToInt32(Request.Params["Id"]);
            //string code = Request.Params["code"];
            //int znode = Convert.ToInt32(Request.Params["znode"]);
            UserDTO model = UserServer.GetModelCode(code);

            if (model != null)
            {
                if (Id == 0)
                {
                    Id = model.ID;
                }
            }
            return(uv.AddTable(Id, znode));
        }
예제 #5
0
        public ActionResult RegisterModel(UserDTO model)
        {
            string msg = "";

            Validate(model);
            if (ModelState.IsValid)
            {
                UserDTO userParanmodel      = UserServer.GetModelCode(model.ParentCode);    //查询父级信息
                UserDTO userRecommendnmodel = UserServer.GetModelCode(model.RecommendCode); //查询推荐人信息
                if (userParanmodel != null && userRecommendnmodel != null)
                {
                    model.ParentID        = int.Parse(userParanmodel.ID.ToString());
                    model.Layer           = userParanmodel.Layer + 1;
                    model.AgentsID        = 0;
                    model.Emoney          = 0;
                    model.BonusAccount    = 0;
                    model.AllBonusAccount = 0;
                    model.StockAccount    = 0;
                    model.StockMoney      = 0;
                    model.User003         = 0;
                    model.ShopAccount     = 0;
                    model.LeftScore       = 0;
                    model.LeftNewScore    = 0;
                    model.LeftBalance     = 0;
                    model.CenterScore     = 0;
                    model.CenterNewScore  = 0;
                    model.CenterBalance   = 0;
                    model.RightScore      = 0;
                    model.RightNewScore   = 0;
                    model.RightBalance    = 0;
                    model.IsOpend         = 0;
                    model.IsLock          = 0;
                    model.IsAgent         = 0;
                    model.BillCount       = 0;
                    model.RecommendGenera = userRecommendnmodel.RecommendGenera + 1;
                    model.RecommendID     = int.Parse(userRecommendnmodel.ID.ToString());
                    model.RegMoney        = 0;
                    model.RegTime         = DateTime.Now;
                    model.CreateTime      = DateTime.Now;
                    model.Password        = CommonHelper.GetMD5(model.Password);
                    long Id = UserServer.Add(model);
                    if (Id > 0)
                    {
                        model.ID            = Id;
                        model.UserPath      = userParanmodel.UserPath + "-" + Id;
                        model.RecommendPath = userRecommendnmodel.RecommendPath + "-" + Id;
                        UserServer.UpdatePath(model);
                        msg = "注册成功";
                    }
                    else
                    {
                        msg = "注册失败";
                    }
                }
                else
                {
                    msg = "推荐人不存在或安置会员不存在";
                }
            }
            else
            {
                string error = string.Empty;
                foreach (var key in ModelState.Keys)
                {
                    var state = ModelState[key];
                    if (state.Errors.Any())
                    {
                        error = state.Errors.First().ErrorMessage;
                        break;
                    }
                }
                msg = error;
            }

            return(Content("<script>alert('" + msg + "');window.location='/Team/Register';</script>"));
        }
예제 #6
0
        public ActionResult ProUserLevel(string code, int leveID)
        {
            UserDTO model = UserServer.GetModelCode(code);
            string  bramk = "";

            if (model != null)
            {
                if (leveID == 0)
                {
                    return(Json(new AjaxResult {
                        Status = "0", Msg = "请选择等级"
                    }));
                }
                if (leveID <= model.LevelID)
                {
                    bramk = "后台降级";
                }
                else
                {
                    bramk = "后台升级";
                }
                //if (leveID > model.LevelID)
                //{
                GlobeParamDTO GlobeParam = new GlobeParamDTO();
                GlobeParam = GlobeParamService.GetByName("Level" + model.LevelID);
                if (GlobeParam == null)
                {
                    return(Json(new AjaxResult {
                        Status = "0", Msg = "后台参数设置错误"
                    }));
                }
                GlobeParamDTO GlobeParam1 = new GlobeParamDTO();
                GlobeParam1 = GlobeParamService.GetByName("Level" + leveID);
                if (GlobeParam1 == null)
                {
                    return(Json(new AjaxResult {
                        Status = "0", Msg = "后台参数设置错误"
                    }));
                }
                decimal a;
                if (!decimal.TryParse("100", out a))
                {
                    return(Json(new AjaxResult {
                        Status = "0", Msg = "数值类型无效"
                    }));
                }
                //shengji.shengji_Left = a;
                //shengji.shengji_right = Convert.ToDecimal(GlobeParam1.ParamVarchar.ToString());
                //shengji.balance = shengji.shengji_right - shengji.shengji_Left;
                //model.shengji = shengji;
                UserProDTO UserPro = new UserProDTO();
                UserPro.AddDate    = DateTime.Now;
                UserPro.CreateTime = DateTime.Now;
                UserPro.Flag       = 1;
                UserPro.FlagDate   = DateTime.Now;
                UserPro.LastLevel  = model.LevelID;
                UserPro.EndLevel   = leveID;
                UserPro.Pro001     = 0;
                UserPro.ProMoney   = 100;
                UserPro.Remark     = bramk;
                UserPro.UserID     = model.ID;
                long i = MemberLevelService.Add(UserPro);
                long b = Member.Update_LeveID(int.Parse(model.ID.ToString()), leveID);
                return(Json(new AjaxResult {
                    Status = "1", Msg = "升级成功"
                }));
                //}
                //else
                //{
                //    return Json(new AjaxResult { Status = "0", Msg = "升级失败" });
                //}
            }
            else
            {
                return(Json(new AjaxResult {
                    Status = "0", Msg = "升级失败"
                }));
            }
        }