public ActionResult AddTeamMember(string MemberId) { string UserId = User.Identity.GetUserId(); var UserDetail = generic.GetUserDetail(UserId); ViewData["UserProfile"] = UserDetail; ViewData["CompanyLogo"] = cms.GetCompanyLogo(UserDetail.SubscriberId).FirstOrDefault(); ViewBag.MemberId = MemberId; PopulateTeamRoles(); ViewData["Rights"] = admin.GetempRights(); ViewData["TeamMember"] = cms.GetTeamMember(UserId).OrderBy(c => c.Name); if (MemberId != null) { ClientTeamMemberProfileView Team = cms.GetTeamMember(UserId, MemberId).FirstOrDefault(); var Trights = cms.GetTeamMemberRights(MemberId).AsEnumerable(); Team.ClientTeamRights = Trights; ViewData["TeamRights"] = Trights; PopulateTeamRoles(Team.EmpRoleId); return(View(Team)); } return(View()); }