Exemple #1
0
        private void FillFinancialPreAnalysisEntity(BaseAbstractEntity entity)
        {
            var financialPreanalysis = entity as FinancialPreanalysis;

            if (financialPreanalysis != null)
            {
                var existFinancialPreanalysis =
                    FinancialPreanalysis.FirstOrDefault(e => e.RefId.ToString().Equals(_refId.ToString()));
                if (existFinancialPreanalysis != null)
                {
                    financialPreanalysis.Id = existFinancialPreanalysis.Id;
                }
                else
                {
                    int id = FinancialPreanalysis.Search(e => true).Max(e => e.Id);
                    financialPreanalysis.Id = id + 1;
                }

                if (_refId == null)
                {
                    throw new Exception("ConsInfo Id is null, please check it!");
                }

                financialPreanalysis.RefId = _refId.Value;
            }
        }
 public void ShareDbContextFrom(BaseAbstractEntity entity)
 {
     _db = entity.GetDb();
 }