public IActionResult AssignedApp(int id) { SelectedAppDetailsViewModel apps = new SelectedAppDetailsViewModel(); apps.appnames = NewApps(); SelAppdDetails selAppdDetails = new SelAppdDetails(); selAppdDetails.apps = PopulateApps(id); foreach (SelectListItem app in apps.appnames) { foreach (var item in selAppdDetails.apps) { if (app.Value == item.Value) { app.Selected = true; } } } return(View(apps)); }
public IActionResult Assign(SelectedAppDetailsViewModel selectedAppDetailsViewModel) { int id = 0; string mergedString = String.Join(",", selectedAppDetailsViewModel.appid); var client = new RestClient("https://localhost:44313/api/app/PostAssignedApps" + id + mergedString); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); return(View("MyApps")); }
public IActionResult AssignedApp(SelectedAppDetailsViewModel apps) { apps.appnames = NewApps(); return(View(apps)); }