public IActionResult DeleteIntegrationCredentials(IntegartionCredentailsViewModel model)//(string VoyagerUser_Id, string Application_Id) { Integration_Search_Request request = new Integration_Search_Request(); Integration_Search_Response response = new Integration_Search_Response(); request.ckUserCompanyId = ckUserCompanyId; request.Application_Id = model.Application_Id; request.UserId = model.ContactPersonID; request.CreatedUser = ckUserEmailId; try { response = userAndRoleMgmtProviders.DeleteIntegrationCredentials(request, token).Result; model = new IntegartionCredentailsViewModel(); request.Application_Id = model.Application_Id; request.UserId = model.ContactPersonID; response = userAndRoleMgmtProviders.GetIntegrationCredentials(request, token).Result; model.Integration_Search_DataList = response.IntegrationSearchDataList; //model.ResponseStatus.Status = "Success"; //model.ResponseStatus.ErrorMessage = "Integration Credentials deleted successfully."; } catch (Exception ex) { response.ResponseStatus.Status = "Error"; response.ResponseStatus.StatusMessage = "Error occurred while deleting record"; return(Json(new { responseText = response.ResponseStatus.StatusMessage, status = response.ResponseStatus.Status })); } return(PartialView("~/Areas/Settings/Views/UserAndRoleMgmt/_ViewIntegrationCredentialsList.cshtml", model)); }
public IActionResult SaveIntegrationCredentials(IntegartionCredentailsViewModel model) { Integration_Search_Request request = new Integration_Search_Request(); Integration_Search_Response response = new Integration_Search_Response(); request.ckUserCompanyId = ckUserCompanyId; request.Application_Id = model.Application_Id; request.UserId = model.ContactPersonID; request.CreatedUser = ckUserEmailId; var retValue = userAndRoleMgmtProviders.CheckCredentialsExit(request, token).Result; if (retValue) { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.StatusMessage = "Key already generated."; return(Json(new { responseText = response.ResponseStatus.StatusMessage, status = response.ResponseStatus.Status })); } else { response = userAndRoleMgmtProviders.SaveIntegrationCredentials(request, token).Result; response = userAndRoleMgmtProviders.GetIntegrationCredentials(request, token).Result; model.Integration_Search_DataList = response.IntegrationSearchDataList; } return(PartialView("~/Areas/Settings/Views/UserAndRoleMgmt/_ViewIntegrationCredentialsList.cshtml", model)); }
public IActionResult ViewIntegrationCredentialsList(IntegartionCredentailsViewModel model) { Integration_Search_Request request = new Integration_Search_Request(); Integration_Search_Response response = new Integration_Search_Response(); request.ckUserCompanyId = ckUserCompanyId; request.Application_Id = model.Application_Id; request.UserId = model.ContactPersonID; request.CreatedUser = ckUserEmailId; if (model.isSearch) { response = userAndRoleMgmtProviders.GetIntegrationCredentials(request, token).Result; model.Integration_Search_DataList = response.IntegrationSearchDataList; } return(PartialView("~/Areas/Settings/Views/UserAndRoleMgmt/_ViewIntegrationCredentialsList.cshtml", model)); }
public IActionResult ViewIntegrationCredentials(IntegartionCredentailsViewModel model) { CompanyOfficerGetReq officerGetReq = new CompanyOfficerGetReq(); Integration_Search_Request request = new Integration_Search_Request(); Integration_Search_Response response = new Integration_Search_Response(); officerGetReq.CompanyId = ckUserCompanyId; var officerGetRes = agentProviders.GetCompanyContacts(officerGetReq, token).Result; model.ContactPersonList = officerGetRes.ContactDetails.Where(a => a.Systemuser_id != null).ToList(); model.ApplicationList = userAndRoleMgmtProviders.GetApplicationAttributes(request, token).Result.Application_DataList; model.ContactPersonList.ForEach(a => a.FIRSTNAME = a.CommonTitle + " " + a.FIRSTNAME + " " + a.LastNAME); return(PartialView("~/Areas/Settings/Views/UserAndRoleMgmt/_ViewIntegrationCredentials.cshtml", model)); }
public FileResult ExportToExcel(IntegartionCredentailsViewModel model) { DataTable dt = new DataTable("IntegrationCredentials"); dt.Columns.AddRange(new DataColumn[4] { new DataColumn("Platform"), new DataColumn("Existing Users"), new DataColumn("Key"), new DataColumn("User") }); Integration_Search_Request request = new Integration_Search_Request(); Integration_Search_Response response = new Integration_Search_Response(); request.ckUserCompanyId = ckUserCompanyId; request.Application_Id = model.Application_Id; request.UserId = model.ContactPersonID; request.CreatedUser = ckUserEmailId; request.IsExport = true; response = userAndRoleMgmtProviders.GetIntegrationCredentials(request, token).Result; model.Integration_Search_DataList = response.IntegrationSearchDataList; foreach (var item in model.Integration_Search_DataList) { dt.Rows.Add(item.Application_Name, item.UserName, item.Keys, item.UserKey); } using (XLWorkbook wb = new XLWorkbook()) { wb.Worksheets.Add(dt); using (MemoryStream stream = new MemoryStream()) { wb.SaveAs(stream); return(File(stream.ToArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "IntegrationCredentials.xlsx")); } } }