public List <string> GetMailByRole(List <int> ContractIds, string Application, string Role) { List <string> result = new List <string>(); foreach (int id in ContractIds) { using (var APSService = new APSCaseWCFServiceClient()) { using (var roleServiceAgentClient = new RoleServiceAgentClient()) { List <string> roleusers = roleServiceAgentClient.GetUsersInRole(Application, Role).ToList(); List <string> agencyusers = CMSService.ListofUsersByContractId(id).ToList(); List <string> finalraw = new List <string>(); foreach (var u in roleusers) { foreach (var au in agencyusers) { if (u.ToUpper() == au.ToUpper()) { finalraw.Add(u); } } } result.AddRange(GetEmails((from u in roleusers where (finalraw.Contains(u)) select u).ToList()).ToList()); } } } return(result); }
protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); // Session is available codeTable = (CodeTable)Session["CODETABLE"]; var x = Session["USER"]; var log = PersonService = new PersonProfileWCFService.PersonProfileWCFServiceClient(); CMSService = new CaseManagementService((LoggedInUser)(Session["USER"]), log4net.LogManager.GetLogger(typeof(MvcApplication)), codeTable); CMSReportsService = new CMSReportsServiceClient(); APSCaseService = new APSCaseWCFServiceClient(); }