예제 #1
0
        public JsonResult AddStatisticsMoneyLog(int TradingType, decimal TradingPrice, string OrderNum, int PayType, string TypeID)
        {
            IStatisticsMoneyService isms = ServiceHelper.Create <IStatisticsMoneyService>();
            decimal         moneybynow   = isms.GetMoneyByUidType(base.CurrentSellerManager.Id, 2);
            StatisticsMoney entity       = new StatisticsMoney
            {
                UserId       = base.CurrentSellerManager.Id,
                UserName     = base.CurrentSellerManager.UserName,
                UserType     = 2,
                TradingTime  = DateTime.Now,
                TradingType  = TradingType,
                TradingPrice = TradingPrice,
                OrderNum     = OrderNum,
                PayType      = PayType,
                Balance      = moneybynow + TradingPrice,
                BalanceAble  = moneybynow + TradingPrice
            };

            isms.Add(entity);
            CapitalInfo cinfo = ServiceHelper.Create <IMemberCapitalService>().GetCapitalInfoByManagerId(base.CurrentSellerManager.Id);

            if (cinfo != null)
            {
                cinfo.Balance += TradingPrice;
                ServiceHelper.Create <IMemberCapitalService>().UpdateCapitalAmount(cinfo.Id, 0, cinfo.Balance, 0, 0, base.CurrentSellerManager.Id);
            }
            return(Json(new { Successful = true }));
        }
예제 #2
0
        public JsonResult AddAccount(string ordernum, string orderprice)
        {
            IStatisticsMoneyService imcs = ServiceHelper.Create <IStatisticsMoneyService>();
            decimal moneynow             = imcs.GetMoneyByUidType(base.CurrentSellerManager.Id, 2);
            IManagersAccountService IMAS = ServiceHelper.Create <IManagersAccountService>();
            decimal price;

            if (decimal.TryParse(orderprice, out price))
            {
                price = decimal.Parse(orderprice);
            }
            ManagersAccount MA = new ManagersAccount()
            {
                Zhuanzhang       = 0,
                ZhuanzhangName   = "",
                Tiqu             = price,
                Tiqufeiyong      = 0,
                Tiquhuobi        = "1",
                Huilv            = "",
                Tuikuan          = 0,
                OrderNum         = ordernum,
                Balance          = moneynow,
                BalanceAvailable = moneynow,
                Datatime         = DateTime.Now,
                ManagerId        = base.CurrentSellerManager.Id,
                Daikuan          = 0
            };

            IMAS.AddManagersAccountInfo(MA);
            return(Json(new { Successful = true }));
        }
예제 #3
0
        public JsonResult AddStatisticsMoney(int TradingType, decimal TradingPrice, string OrderNum, int PayType, string TypeID)
        {
            IStatisticsMoneyService isms = ServiceHelper.Create <IStatisticsMoneyService>();
            decimal         moneybynow   = isms.GetMoneyByUidType(base.CurrentUser.Id, base.CurrentUser.UserType);
            StatisticsMoney entity       = new StatisticsMoney
            {
                UserId       = base.CurrentUser.Id,
                UserName     = base.CurrentUser.UserName,
                UserType     = base.CurrentUser.UserType,
                TradingTime  = DateTime.Now,
                TradingType  = TradingType,
                TradingPrice = TradingPrice,
                OrderNum     = OrderNum,
                PayType      = PayType,
                Balance      = moneybynow,
                BalanceAble  = moneybynow
            };

            isms.Add(entity);
            return(Json(new { Successful = true }));
        }