예제 #1
0
        /// <summary>
        /// 更新给定分组的证券信息。
        /// </summary>
        /// <param name="xmdm">项目代码</param>
        /// <param name="zcdy">资产单元</param>
        /// <param name="zhdm">组合代码</param>
        public void UpdateSecurityInfo(int xmdm, string zcdy, string zhdm)
        {
            if (xmdm < 0) return;

            SettleEntities dbContext = new SettleEntities();
            if (!string.IsNullOrEmpty(zhdm))
                this.SecurityStoreAccList = dbContext.tb_security_store_acc.Where(o => o.xmdm == xmdm && o.zcdy.Equals(zcdy, StringComparison.OrdinalIgnoreCase) && o.zhdm.Equals(zhdm, StringComparison.OrdinalIgnoreCase)).ToList();
            else if (!string.IsNullOrEmpty(zcdy))
                this.SecurityStoreAccList = dbContext.tb_security_store_acc.Where(o => o.xmdm == xmdm && o.zcdy.Equals(zcdy, StringComparison.OrdinalIgnoreCase)).ToList();
            else
                this.SecurityStoreAccList = dbContext.tb_security_store_acc.Where(o => o.xmdm == xmdm).ToList();
        }
예제 #2
0
        /// <summary>
        /// 更新给定分组的资金信息。
        /// </summary>
        /// <param name="xmdm">项目代码</param>
        /// <param name="zcdy">资产单元</param>
        /// <param name="zhdm">组合代码</param>
        public void UpdateMoneyInfo(int xmdm, string zcdy, string zhdm)
        {
            if (xmdm < 0) return;

            SettleEntities context = new SettleEntities();
            if (!string.IsNullOrEmpty(zhdm))
                this.MoneyStoreList = context.tb_money_store.Where(o => o.xmdm == xmdm && o.zcdy.Equals(zcdy) && o.zhdm.Equals(zhdm)).ToList();
            else if (!string.IsNullOrEmpty(zcdy))
                this.MoneyStoreList = context.tb_money_store.Where(o => o.xmdm == xmdm && o.zcdy.Equals(zcdy)).ToList();
            else
                this.MoneyStoreList = context.tb_money_store.Where(o => o.xmdm == xmdm).ToList();

            //
            this.StatisticsInfo.FrozeBalance = this.MoneyStoreList.Where(o => o.froze == 1).Sum(o => o.money);
            this.StatisticsInfo.ValidBalance = this.MoneyStoreList.Where(o => o.froze == 0).Sum(o => o.money);
            this.StatisticsInfo.Total = this.MoneyStoreList.Sum(o => o.money);
        }