// // GET: /Entrepreneur/ // public ActionResult Index() { EntrepreneurHomePage model = null; ActionResult view; if (WebSecurity.IsAuthenticated) { m_fetchHomePageData.EntrepreneurId = WebSecurity.CurrentUserId; m_fetchHomePageData.Execute(); model = new EntrepreneurHomePage(); model = EntrepreneurAdapters.Convert(m_fetchHomePageData); view = View(model); } else { view = View("IndexWithNoCompanies"); } return(View(model)); }
public static EntrepreneurHomePage Convert(IEntrepreneurHomePageData src) { var target = new EntrepreneurHomePage(); // We support only 1 company today. Hence we use 0th element directly. // FUTURE: Add support for multiple companies. if (src.CompanySummary == null || src.CompanySummary.Count <= 0) { target.CompanySummary = null; target.MatchingInvestors = null; target.UnreadCommentsSummary = null; target.UnreadQuestionsSummary = null; } else { var companyId = src.CompanySummary[0].CompanyId; target.CompanySummary = Convert(src.CompanySummary[0]); target.CompanySummary.Id = companyId; target.MatchingInvestors = src.MatchingInvestors[companyId]; target.UnreadCommentsSummary = src.UnreadCommentsSummary[companyId]; target.UnreadQuestionsSummary = src.UnreadQuestionsSummary[companyId]; } return(target); }