Example #1
0
        public ActionResult Analysis(int xm_id, int xm_type)
        {
            AnalysisResult result = new AnalysisResult();
            switch(xm_type)
            {
                case (int)CaseTypes.Financing:
                    result = GetFinancingAnalysisResult(xm_id, result);
                    break;
                case (int)CaseTypes.Investment:
                    result = GetInvestmentAnalysisResult(xm_id, result);
                    break;
            }

            return PartialView(result);
        }
Example #2
0
        private AnalysisResult GetInvestmentAnalysisResult(int investment_id, AnalysisResult result)
        {
            var investment = db.T_XM_Investment.Find(investment_id);
            var investment_list = db.T_XM_Investment
                                    .Where(i => i.AimIndustry.IndexOf((String)investment.AimIndustry) >= 0 && i.TeamworkType.IndexOf((String)investment.TeamworkType) >= 0)
                                    .ToList();

            result.Turnover = (Decimal)investment_list.Average(m => m.Investment);
            result.ReturnRatio = (Double)investment_list.Average(m => m.ReturnRatio);
            result.Num = investment_list.Count();
            result.TurnoverRatio = investment_list.Count() % db.T_XM_Financing.Where(f => f.IsValid == true).Count();

            return result;
        }
Example #3
0
        private AnalysisResult GetFinancingAnalysisResult(int finacial_id, AnalysisResult result)
        {
            //to-do:
            //添加成交项目的判断
            var finacial = db.T_XM_Financing.Find(finacial_id);
            var finacial_list = db.T_XM_Financing
                                  .Where(f => f.ItemType == finacial.ItemType && f.Industry == finacial.Industry && f.IsValid == true)
                                  .ToList();

            result.Turnover = (Decimal)finacial_list.Average(m => m.TotalInvestment);
            result.ReturnRatio = (Double)finacial_list.Average(m => m.ReturnRatio);
            result.Num = finacial_list.Count();
            result.TurnoverRatio = finacial_list.Count() % db.T_XM_Financing.Where(f => f.IsValid == true).Count();

            return result;
        }