예제 #1
0
        //6楼充值样式
        private Model.User Register_6F(User model, RegisterViewModel registerViewModel)
        {
            model.UserName = registerViewModel.UserName;
            model.IPAddress = registerViewModel.IPAddress;
            model.Password = Util.Security.UEncypt.MD5(registerViewModel.Password);
            model.Amount = 10000;//默认充值10000元
            model.CreateDate = DateTime.Now;
            model.IsDel = false;
            model.DepartmentType = registerViewModel.DepartmentType;
            BLLSession.IUserService.Add(model);

            //插入充值表,默认10000元
            Recharge rechargeModel = new Recharge();
            rechargeModel.UserID = model.UserID;
            rechargeModel.RechargeAmount = 10000;
            rechargeModel.Status = (int)RechargeStatusEnum.Succeed;
            rechargeModel.IsDel = false;
            rechargeModel.CreateDate = DateTime.Now;
            rechargeModel.OpeningBalance = 0;
            rechargeModel.CurrentBalance = 10000;
            rechargeModel.RechargeUserName = "******";
            BLLSession.IRechargeService.Add(rechargeModel);

            //插入数据到消费流水表
            BLLSession.IExpendLogService.Add(new ExpendLog()
            {
                UserID = model.UserID,
                ConsumeAmount = 0,
                RechargeAmount = rechargeModel.RechargeAmount,
                CreateDate = DateTime.Now,
                ExpendLogTypeID = rechargeModel.RechargeID,
                ExpendLogType = (int)ExpendLogTypeEnum.Recharge,
                Description = "充值完成增加金额"
            });
            return model;
        }
예제 #2
0
 /// <summary>
 /// 保存用户登陆信息到Session and Cookies
 /// </summary>
 /// <param name="userInfo"></param>
 /// <param name="IsCookie">true为保存Cookie</param>
 public void SetUserToSessionAndCookies(User user, bool IsCookie)
 {
     if (user != null)
     {
         //保存信息到Session
         User = user.ToPOCO();
         if (IsCookie)//存入Cookie
         {
             Util.Web.UCookies.WriteCookies(User_InfoKey, 1, JsonConvert.SerializeObject(User));
         }
     }
 }
예제 #3
0
 //10楼样式
 private Model.User Register_10F(User model, RegisterViewModel registerViewModel)
 {
     model.UserName = registerViewModel.UserName;
     model.IPAddress = registerViewModel.IPAddress;
     model.Password = Util.Security.UEncypt.MD5(registerViewModel.Password);
     model.Amount = 0;
     model.CreateDate = DateTime.Now;
     model.IsDel = false;
     model.DepartmentType = registerViewModel.DepartmentType;
     BLLSession.IUserService.Add(model);
     return model;
 }