public ActionResult EditConnection(long id, long sid) { TempData["SelectedMenu"] = "Manage"; TempData["SelectedSubMenu"] = "ManageFolders"; SubscriptionsViewModel subscriptionsView = new SubscriptionsViewModel(); Account accountObj = (Account)Session["account"]; var folderName = CCFolderRepository.CCFolders.Where(foid => foid.FolderID == id & foid.AccountGUID == accountObj.AccountGUID).FirstOrDefault().Name; var subscription = CCConnectinRepository.CCSubscriptions.FirstOrDefault(ssid => ssid.ConnectionID == sid & ssid.AccountGUID == accountObj.AccountGUID); subscriptionsView.FolderID = id; subscriptionsView.Subscriptiondetail = subscription; subscriptionsView.FolderName = folderName; CCFolder folderObj = (CCFolder)Session["folderDetail"]; if (folderObj != null) { subscriptionsView.FolderType = folderObj.Type; } if (subscription != null) { return View(subscriptionsView); } else { return RedirectToAction("Items", "Folder", new { ID = id }); } }
public ActionResult EditConnection(SubscriptionsViewModel objSubscription) { if (ModelState.IsValid) { if (objSubscription.Subscriptiondetail.CategoryFilterUsed == false) { objSubscription.Subscriptiondetail.CategoryFilterValues = string.Empty; } var resp = CCConnectinRepository.UpdateSubscription(objSubscription.Subscriptiondetail); return RedirectToAction("ViewConnections", "Folder", new { id = objSubscription.FolderID }); } else { return View(objSubscription); } }
public ActionResult ViewConnections(long id) { TempData["SelectedMenu"] = "Manage"; TempData["SelectedSubMenu"] = "ManageFolders"; Account accountObj = (Account)Session["account"]; LimitationsViewModel limitationsObj = (LimitationsViewModel)Session["limitations"]; SubscriptionsViewModel subscriptionsView = new SubscriptionsViewModel(); subscriptionsView.limitationsObj = limitationsObj; if (Session["newConnections"] != null) { subscriptionsView.conSummary = (ConnectionImportListSummaryModel) Session["newConnections"]; Session["newConnections"] = null; } var folderDetails = CCFolderRepository.CCFolders.Where(fid => fid.FolderID == id & fid.AccountGUID == accountObj.AccountGUID).FirstOrDefault(); var subscriptions = CCConnectinRepository.CCSubscriptions.Where(fid => fid.FolderID == id & fid.AccountGUID == accountObj.AccountGUID); // get Credentials name List<string> credName = new List<string>(); var allCredentials = CCCredentialRepository.Credentials.Where(aguid => aguid.AccountGUID == accountObj.AccountGUID).ToList(); foreach (var conn in subscriptions) { var findCredential = allCredentials.Where(cid => cid.ID == conn.CredentialsID).FirstOrDefault(); if (findCredential != null) { credName.Add(findCredential.Name); } else { credName.Add(""); } } subscriptionsView.CredentialName = credName; subscriptionsView.FolderName = folderDetails.Name; subscriptionsView.FolderType = folderDetails.Type; subscriptionsView.SubscriptionDetails = subscriptions; subscriptionsView.FolderID = id; //assign folder details CCFolder folderDetail = new CCFolder(); folderDetail = CCFolderRepository.FolderDetails(id); Session["folderDetail"] = folderDetail; return View(subscriptionsView); }