コード例 #1
0
        public FundViewModel GetFundInformation(string accountCode, string customerCode = null, Currency currency = null)
        {
            List <FundInformation> results = _portfolioManager.GetFundInformation(customerCode, accountCode, currency);
            FundInformation        fund    = results.First();

            FundViewModel result = Mapper.Map <FundInformation, FundViewModel>(fund);

            List <OptionPositionViewModel> positions = GetOptionPositions(customerCode, accountCode);
            decimal floatingPL = 0;

            foreach (OptionPositionViewModel position in positions)
            {
                floatingPL += position.OptionFloatingPL;
            }
            result.FloatingPL = floatingPL;

            RiskLevelInformation riskLevel = _portfolioManager.GetAccountRiskLevelInformation(accountCode, currency);

            result.UsedMargin = riskLevel.UsedMargin;
            result.MarginRate = 0;
            if (fund.AvailableFund != 0)
            {
                result.MarginRate = riskLevel.UsedMargin / fund.AvailableFund;
            }

            return(result);
        }
コード例 #2
0
ファイル: BLLFundInformation.cs プロジェクト: 15831944/C-12-
 //经费登记
 public void Insert(FundInformation FundInfo)
 {
     try
     {
         dbcontext.FundInformationContext.Add(FundInfo);
         dbcontext.SaveChanges();
     }
     catch
     {
         throw;
     }
 }
コード例 #3
0
 /// <summary>
 /// 获取用户资金信息
 /// </summary>
 /// <param name="accountName">用户账号</param>
 /// <param name="loginId">登录ID</param>
 /// <param name="fund">ref  FundInformation</param>
 /// <returns>ErrType</returns>
 public ErrType GetMoneyInventoryEx(string accountName, string loginId, ref FundInformation fund)
 {
     try
     {
         MoneyInventory moneyInfo = TradeService.GetMoneyInventoryEx(accountName, loginId);
         fund = TradeConverter.ToFundInformation(moneyInfo);
         return(moneyInfo.Result ? GeneralErr.Success : new ErrType(ERR.ERROR, moneyInfo.Desc));
     }
     catch (Exception ex)
     {
         FileLog.WriteLog("", Assembly.GetExecutingAssembly().GetName().Name, this.GetType().Name, new StackTrace().GetFrame(0).GetMethod().Name, ex.Message);
         return(new ErrType(ERR.EXEPTION, ErrorText.GetClientFundsInfo));
     }
 }
コード例 #4
0
ファイル: BLLFundInformation.cs プロジェクト: 15831944/C-12-
 //根据ID删除经费信息
 public bool Delete(int ID)
 {
     try
     {
         FundInformation file = dbcontext.FundInformationContext.Where(u => u.FundInformationID == ID).FirstOrDefault();
         dbcontext.FundInformationContext.Attach(file);
         dbcontext.FundInformationContext.Remove(file);
         dbcontext.SaveChanges();
         return(true);
     }
     catch
     {
         throw;
     }
 }
コード例 #5
0
ファイル: BLLFundInformation.cs プロジェクト: 15831944/C-12-
 //更新IsPass状态
 public void UpdateIsPass(int ID, bool isPass)
 {
     try
     {
         FundInformation NewFundInformation = dbcontext.FundInformationContext.Find(ID);
         if (NewFundInformation == null)
         {
             return;
         }
         NewFundInformation.IsPass = isPass;
         dbcontext.SaveChanges();
     }
     catch
     {
         throw;
     }
 }
コード例 #6
0
ファイル: BLLFundInformation.cs プロジェクト: 15831944/C-12-
 //设置经费比例
 public void Update(FundInformation Fund, string Propor)
 {
     try
     {
         FundInformation newFund = dbcontext.FundInformationContext.Find(Fund.FundInformationID);
         newFund.FundInformationID = Fund.FundInformationID;
         newFund.UserInfoID        = Fund.UserInfoID;
         newFund.ProjectID         = Fund.ProjectID;
         newFund.OperateType       = Fund.OperateType;
         newFund.Proportion        = Propor;
         newFund.Time = Fund.Time;
         newFund.FundingPurposeSortName = Fund.FundingPurposeSortName;
         newFund.EveItemUseMoney        = Fund.EveItemUseMoney;
         newFund.BudgetDirector         = Fund.BudgetDirector;
         dbcontext.SaveChanges();
     }
     catch
     {
         throw;
     }
 }