Example #1
0
        public string ConsoLogin(string code, string account, string password, string loginIp)
        {
            if (string.IsNullOrEmpty(code))
            {
                throw new CustomException(400, "请输入商户号!");
            }
            if (string.IsNullOrEmpty(account))
            {
                throw new CustomException(400, "请输入登录帐号!");
            }
            if (string.IsNullOrEmpty(password))
            {
                throw new CustomException(400, "请输入密码");
            }
            AuthService auth   = new AuthService(this.businessmanRepository);
            var         result = auth.Login(new LoginParames()
            {
                Code = code.Trim(), Password = password, Account = account.Trim(), LoginIP = loginIp, BusinessmanType = 1
            },
                                            identity =>
            {
                MessagePushManager.Send(code, account, Common.Enums.EnumPushCommands.RepeatLogin, c_NeedSignOut);
                //退出
                Exit(identity);
            });

            BehaviorStatService.SaveLoginBehaviorStat(result.Token, EnumBehaviorOperate.LoginCount);
            return(result.Token);
        }
Example #2
0
        public string Login(string code, string account, string password)
        {
            if (string.IsNullOrEmpty(code))
            {
                throw new CustomException(400, "请输入商户号!");
            }
            if (string.IsNullOrEmpty(account))
            {
                throw new CustomException(400, "请输入登录帐号!");
            }
            if (string.IsNullOrEmpty(password))
            {
                throw new CustomException(400, "请输入密码");
            }
            RemoteEndpointMessageProperty endpoint = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
            AuthService auth   = new AuthService(this.businessmanRepository);
            var         result = auth.Login(new LoginParames()
            {
                Code = code.Trim(), Password = password, Account = account.Trim(), LoginIP = endpoint.Address
            },
                                            identity =>
            {
                MessagePushManager.Send(code, account, Common.Enums.EnumPushCommands.RepeatLogin, c_NeedSignOut);
                //退出
                Exit(identity);
            });

            BehaviorStatService.SaveLoginBehaviorStat(result.Token, EnumBehaviorOperate.LoginCount);
            return(result.Token);
        }
Example #3
0
        public List <FinancialProductDto> GetAllProduct()
        {
            BehaviorStatService.SaveBehaviorStat(DataContracts.SystemSetting.EnumBehaviorOperate.AccessCount);
            var temp = financialProxy.GetAllProduct(code, key);

            if (temp != null)
            {
                var result = temp.Select(p => new FinancialProductDto
                {
                    Abstract           = p.Abstract,
                    Day                = p.Day,
                    Description        = p.Description,
                    EndDate            = p.EndDate,
                    IconUrl            = p.IconUrl,
                    LimitAmount        = p.LimitAmount,
                    CurrentAmount      = p.CurrentAmount,
                    MaxAmount          = p.MaxAmount,
                    Name               = p.Name,
                    ProductId          = p.ProductId,
                    ReturnRate         = p.ReturnRate,
                    ValidDate          = p.ValidDate,
                    InterestRate       = p.InterestRate,
                    CanSettleInAdvance = p.CanSettleInAdvance
                });
                if (result == null)
                {
                    return(null);
                }
                return(result.ToList());
            }

            return(null);
        }
Example #4
0
 public void TestSaveBehaviorStat()
 {
     BootStrapper.Boot();
     BehaviorStatService.SaveBehaviorStat(EnumBehaviorOperate.LoginCount);
     //BehaviorStatService.SaveBehaviorStat("100100", "Test", "Buyer","GYS01", EnumBehaviorOperate.LoginCount);
     //BehaviorStatService.SaveBehaviorStat("100100", "Test", "Buyer","GYS01", EnumBehaviorOperate.LoginCount);
     //BehaviorStatService.SaveBehaviorStat("100100", "Test", "Buyer","GYS01", EnumBehaviorOperate.LoginCount);
     //BehaviorStatService.SaveBehaviorStat("100100", "Test", "Buyer","GYS01", EnumBehaviorOperate.LoginCount);
     //BehaviorStatService.SaveBehaviorStat("100100", "Test", "Buyer","GYS01", EnumBehaviorOperate.LoginCount);
     //BehaviorStatService.SaveBehaviorStat("100200", "Test2", "Supplier", "GYS01", EnumBehaviorOperate.LoginCount);
     //BehaviorStatService.SaveBehaviorStat("100300", "Test3", "Supplier", "GYS01", EnumBehaviorOperate.LoginCount);
 }
Example #5
0
        public void GetList()
        {
            BootStrapper.Boot();
            BehaviorStatService service = ObjectFactory.GetInstance <BehaviorStatService>();
            var result = service.Query(new RequestQueryBehaviorStatQuery()
            {
                // BusinessmanCode = "100100",
                BusinessmanType = "buyer",
                StartDateTime   = DateTime.Now.Date,
                EndDateTime     = DateTime.Now.Date,
                PageIndex       = 1,
                PageSize        = 10
            });

            var str = JsonConvert.SerializeObject(result);

            Console.WriteLine(str);
        }
Example #6
0
 public DataContracts.DomesticTicket.FlightResponse[] QueryConnwayFlight(string formCityCode, string midCityCode, string toCityCode, DateTime takeDate, DateTime midDate, bool IsShare = false, string carrayCode = null)
 {
     BehaviorStatService.SaveBehaviorStat(DataContracts.SystemSetting.EnumBehaviorOperate.QueryCount);
     DataContracts.DomesticTicket.FlightResponse[] FlightResponseArr = null;
     try
     {
         if (currentUser == null)
         {
             throw new CustomException(111, "用户未登录或者掉线,请重新登陆!");
         }
         FlightResponseArr = flightDestineService.QueryConnwayFlight(currentUser.Code, formCityCode, midCityCode, toCityCode, takeDate, midDate, IsShare, carrayCode);
     }
     catch (Exception ex)
     {
         throw new CustomException(111, ex.Message);
     }
     return(FlightResponseArr);
 }