コード例 #1
0
 public ActionResult Details(int id)
 {
     Models.InvestorIndexViewModel investorModel;
     if (User.Identity.GetUserId() != null)
     {
         SessionUserAccessor session = get_SessionIDs();
         if (session.Entrepreneur_ID > 0)
         {
             investorModel = new Models.InvestorIndexViewModel(User.Identity.GetUserId(), id, session.Entrepreneur_ID);
             if (investorModel.Profile_Public)
             {
                 return(View(investorModel));
             }
             else
             {
                 return(Redirect("/Search/Index"));
             }
         }
         else if (session.Investor_ID > 0)
         {
             investorModel = new Models.InvestorIndexViewModel(User.Identity.GetUserId(), id, session.Investor_ID);
             if (investorModel.Profile_Public)
             {
                 return(View(investorModel));
             }
             else
             {
                 return(Redirect("/Search/Index"));
             }
         }
     }
     else
     {
         investorModel = new Models.InvestorIndexViewModel();
         investorModel.get_InvestorData(id);
         if (investorModel.Profile_Public)
         {
             return(View(investorModel));
         }
     }
     return(Redirect("/Search/Index"));
 }