public ActionResult Add(ClientDto client) { ClientTask.Create(new CreateClientCommand( client.Name, client.UserName, client.Paw, client.ClientSecret, client.ClientIdentifier) { RedirectUrl = client.RedirectUrl, ClientState = client.ClientState, Desc = client.Desc, Img = client.Img }); return Redirect(Url.Action("List")); }
public ActionResult Update(ClientDto viewModel) { var client = ClientQueryService.Get(viewModel.Id); if (client == null) return List(viewModel.Id); ClientTask.Update(new UpdateClientCommand(viewModel.Id) { RedirectUrl = viewModel.RedirectUrl, ClientIdentifier = viewModel.ClientIdentifier, ClientSecret = viewModel.ClientSecret, Paw = viewModel.Paw, UserName = viewModel.UserName, Name = viewModel.Name, ClientState = viewModel.ClientState, Desc = viewModel.Desc, Img = viewModel.Img }); return Redirect(Url.Action("List", new { @id = client.Id })); }
public async Task <ResultModel> GetById(int id) { var client = await _userDatabaseContext.Clients.Where(x => x.Id == id) .Include(x => x.ClientSecrets) .Include(x => x.AllowedGrantTypes) .Include(x => x.RedirectUris) .Include(x => x.PostLogoutRedirectUris) .Include(x => x.AllowedScopes) .Include(x => x.IdentityProviderRestrictions) .Include(x => x.Claims) .Include(x => x.AllowedCorsOrigins) .Include(x => x.Properties) .FirstOrDefaultAsync(); if (client == null) { return(new ResultModel(ResultCode.Fail, "没有对应客户端")); } List <ClientSecretDto> clientSecretDtos = new List <ClientSecretDto>(); foreach (var item in client.ClientSecrets) { clientSecretDtos.Add(new ClientSecretDto { Created = item.Created, Description = item.Description, Expiration = item.Expiration, Type = item.Type, Value = item.Value, Id = item.Id, ClientId = item.ClientId }); } List <ClientGrantTypeDto> clientGrantTypeDtos = new List <ClientGrantTypeDto>(); foreach (var item in client.AllowedGrantTypes) { clientGrantTypeDtos.Add(new ClientGrantTypeDto { GrantType = item.GrantType, Id = item.Id, ClientId = item.ClientId }); } List <ClientRedirectUriDto> clientRedirectUriDtos = new List <ClientRedirectUriDto>(); foreach (var item in client.RedirectUris) { clientRedirectUriDtos.Add(new ClientRedirectUriDto { RedirectUri = item.RedirectUri, Id = item.Id, ClientId = item.ClientId }); } List <ClientPostLogoutRedirectUriDto> clientPostLogoutRedirectUriDtos = new List <ClientPostLogoutRedirectUriDto>(); foreach (var item in client.PostLogoutRedirectUris) { clientPostLogoutRedirectUriDtos.Add(new ClientPostLogoutRedirectUriDto { PostLogoutRedirectUri = item.PostLogoutRedirectUri, Id = item.Id, ClientId = item.ClientId }); } List <ClientScopeDto> clientScopeDtos = new List <ClientScopeDto>(); foreach (var item in client.AllowedScopes) { clientScopeDtos.Add(new ClientScopeDto { Scope = item.Scope, Id = item.Id, ClientId = item.ClientId }); } List <ClientIdPRestrictionDto> clientIdPRestrictionDtos = new List <ClientIdPRestrictionDto>(); foreach (var item in client.IdentityProviderRestrictions) { clientIdPRestrictionDtos.Add(new ClientIdPRestrictionDto { Provider = item.Provider, Id = item.Id, ClientId = item.ClientId }); } List <ClientClaimDto> clientClaimDtos = new List <ClientClaimDto>(); foreach (var item in client.Claims) { clientClaimDtos.Add(new ClientClaimDto { Type = item.Type, Value = item.Value, Id = item.Id, ClientId = item.ClientId }); } List <ClientCorsOriginDto> clientCorsOriginDtos = new List <ClientCorsOriginDto>(); foreach (var item in client.AllowedCorsOrigins) { clientCorsOriginDtos.Add(new ClientCorsOriginDto { Origin = item.Origin, Id = item.Id, ClientId = item.ClientId }); } List <ClientPropertyDto> clientPropertyDtos = new List <ClientPropertyDto>(); foreach (var item in client.Properties) { clientPropertyDtos.Add(new ClientPropertyDto { Key = item.Key, Value = item.Value, Id = item.Id, ClientId = item.ClientId }); } var clientDto = new ClientDto { Id = client.Id, Enabled = client.Enabled, ClientId = client.ClientId, ProtocolType = client.ProtocolType, RequireClientSecret = client.RequireClientSecret, ClientName = client.ClientName, Description = client.Description, ClientUri = client.ClientUri, LogoUri = client.LogoUri, RequireConsent = client.RequireConsent, AllowRememberConsent = client.AllowRememberConsent, AlwaysIncludeUserClaimsInIdToken = client.AlwaysIncludeUserClaimsInIdToken, AllowPlainTextPkce = client.AllowPlainTextPkce, RequireRequestObject = client.RequireRequestObject, AllowAccessTokensViaBrowser = client.AllowAccessTokensViaBrowser, FrontChannelLogoutUri = client.FrontChannelLogoutUri, FrontChannelLogoutSessionRequired = client.FrontChannelLogoutSessionRequired, BackChannelLogoutUri = client.BackChannelLogoutUri, BackChannelLogoutSessionRequired = client.BackChannelLogoutSessionRequired, AllowOfflineAccess = client.AllowOfflineAccess, IdentityTokenLifetime = client.IdentityTokenLifetime, AllowedIdentityTokenSigningAlgorithms = client.AllowedIdentityTokenSigningAlgorithms, AccessTokenLifetime = client.AccessTokenLifetime, AuthorizationCodeLifetime = client.AuthorizationCodeLifetime, AbsoluteRefreshTokenLifetime = client.AbsoluteRefreshTokenLifetime, SlidingRefreshTokenLifetime = client.SlidingRefreshTokenLifetime, RefreshTokenUsage = client.RefreshTokenUsage, UpdateAccessTokenClaimsOnRefresh = client.UpdateAccessTokenClaimsOnRefresh, RefreshTokenExpiration = client.RefreshTokenExpiration, AccessTokenType = 0, EnableLocalLogin = client.EnableLocalLogin, IncludeJwtId = client.IncludeJwtId, AlwaysSendClientClaims = client.AlwaysSendClientClaims, ClientClaimsPrefix = client.ClientClaimsPrefix, PairWiseSubjectSalt = client.PairWiseSubjectSalt, Created = client.Created, Updated = client.Updated, LastAccessed = client.LastAccessed, RequirePkce = client.RequirePkce, UserSsoLifetime = client.UserSsoLifetime, UserCodeType = client.UserCodeType, DeviceCodeLifetime = client.DeviceCodeLifetime, NonEditable = client.NonEditable, ClientSecrets = clientSecretDtos, AllowedGrantTypes = clientGrantTypeDtos, RedirectUris = clientRedirectUriDtos, PostLogoutRedirectUris = clientPostLogoutRedirectUriDtos, AllowedScopes = clientScopeDtos, IdentityProviderRestrictions = clientIdPRestrictionDtos, AllowedCorsOrigins = clientCorsOriginDtos, Properties = clientPropertyDtos, Claims = clientClaimDtos }; return(new ResultModel(ResultCode.Success, clientDto)); }
/// <summary> /// 检查回调URL是否正确 /// </summary> private string GetRedirectUri(string callbackUrl, ClientDto client) { if (string.IsNullOrEmpty(callbackUrl)) { if (string.IsNullOrEmpty(client.RedirectUrl)) { return string.Empty; } return client.RedirectUrl; } else { // 校验callbackUrl 和 client.RedirectUrl 的域名是否一致. if (callbackUrl.GetDomain().Trim() != client.RedirectUrl.GetDomain().Trim()) { return string.Empty; } return callbackUrl; } }
public ClientUpdatedEvent(ClientDto originalClient, ClientDto client) { OriginalClient = originalClient; Client = client; }
public virtual Task <bool> CanInsertClientAsync(ClientDto client, bool isCloned = false) { var clientEntity = client.ToEntity(); return(ClientRepository.CanInsertClientAsync(clientEntity, isCloned)); }
public ClientDetailedDto(ClientDto client, AddressDto address) { Client = client; Address = address; }
/// <summary> /// InvoiceXpress <a href="https://invoicexpress.com/api/clients/update">Clients Update</a> Method /// </summary> public static void Update(string apiKey, string accountName, int clientId, ClientDto inputData) { Rest_Update(apiKey, accountName, clientId, inputData.XmlSerializeToString()); }
public async Task NewClient(ClientDto client) { await Clients.All.NewClient(client); }
public void Add(ClientDto clientDto) { var client = clientMapper.MapperDtoToEntity(clientDto); clientService.Add(client); }
public ClientRequestedEvent(ClientDto clientDto) { ClientDto = clientDto; }
public void fillExcelTableByType(IEnumerable <object> grid, string status, FileInfo xlsxFile) { if (grid != null) { //ExcelPackage.LicenseContext = LicenseContext.NonCommercial; ExcelPackage pck = new ExcelPackage(xlsxFile); var excel = pck.Workbook.Worksheets.Add(status); int x = 1; int y = 1; CultureInfo cultureInfo = new CultureInfo(Thread.CurrentThread.CurrentCulture.Name); Thread.CurrentThread.CurrentCulture = cultureInfo; cultureInfo.NumberFormat.NumberDecimalSeparator = "."; excel.Cells["A1: Z1"].Style.Font.Bold = true; excel.Cells.Style.HorizontalAlignment = ExcelHorizontalAlignment.Left; excel.Cells.Style.Numberformat.Format = "General"; Object dtObj = new Object(); switch (status) { case "Client": dtObj = new ClientDto(); break; case "Room": dtObj = new RoomDto(); break; } foreach (var prop in dtObj.GetType().GetProperties()) { excel.Cells[y, x].Value = prop.Name.Trim(); x++; } // Генерация строк-записей таблицы. foreach (var item in grid) { y++; // Объект-контейнер для текущего читаемого элемента. Object itemObj = item; x = 1; foreach (var prop in itemObj.GetType().GetProperties()) { object t = prop.GetValue(itemObj, null); object val; if (t == null) { val = " "; } else { val = t.ToString(); } excel.Cells[y, x].Value = val; x++; } } // Устанавливаем размер колонок по ширине содержимого. excel.Cells.AutoFitColumns(); // Сохраняем файл. pck.Save(); } else { MessageBox.Show("Данные не загружены"); } }
public ClientDto Insert(ClientDto client) { return(_clientRepository.Insert(client)); }
public ClientDto Update(int clientId, ClientDto client) { client.ClientId = clientId; return(_clientRepository.Update(client)); }
public ClientDto AddClient(ClientDto client) { ClientDto clientDtos = _clientRepo.AddClient(client); return(clientDtos); }
public ClientDto DeleteClient(ClientDto client) { ClientDto clientDtos = _clientRepo.DeleteClient(client); return(clientDtos); }
public void Remove(ClientDto clientDto) { var client = clientMapper.MapperDtoToEntity(clientDto); clientService.Remove(client); }
/// <summary> /// InvoiceXpress <a href="https://invoicexpress.com/api/clients/create">Clients Create</a> Method /// </summary> public static ClientDto Create(string apiKey, string accountName, ClientDto inputData) { HttpResponseInfo result = Rest_Create(apiKey, accountName, inputData.XmlSerializeToString()); return(result.Text.DeserializeXml <ClientDto>()); }
public void Update(ClientDto clientDto) { var client = clientMapper.MapperDtoToEntity(clientDto); clientService.Update(client); }
public AccountEntered(ClientDto client) { Client = client; }
public void CreateDocuments(Guid applicationId) { var appl = _context.Applications .Include(c => c.Steps) .Include(c => c.Documents) .Include(c => c.User) .First(c => c.Id == applicationId); // get the advisor advise var advise = _context.AdvisorAdvise .First(c => c.ApplicationId == applicationId); // get the advisor var advisor = _context.Users .Include(c => c.BrokerDetails) .First(c => c.Id == advise.AdvisorId); // If we did a digital KYC, get it var kycExist = _context.KycMetaData.Any(c => c.ApplicationId == applicationId); KycMetaDataModel kyc = null; if (kycExist) { kyc = _context.KycMetaData.First(c => c.ApplicationId == applicationId); } // get record of advise var roa = _context.RecordOfAdvise .Include(c => c.SelectedProducts) .First(c => c.ApplicationId == applicationId); // get the bank validation data var bankValidation = _context.BankVerifications .First(c => c.ApplicationId == applicationId); // get schedule step var scheduleStep = _context.ApplicationSteps .First(c => c.ApplicationId == applicationId && c.StepType == ApplicationStepTypesEnum.PrimarySchedule); // get scheduele details AddressDto address = null; ClientDto client = null; if (scheduleStep.ScheduleType == "Individual") { var schedule = _context.PrimaryIndividuals .Where(c => c.ApplicationId == applicationId) .Include(c => c.ContactDetails) .Include(c => c.ClientDetails) .ThenInclude(c => c.IdentityDetails) .Include(c => c.TaxResidency) .ThenInclude(c => c.TaxResidencyItems) .First(); address = new AddressDto() { UnitNumber = schedule.ContactDetails.UnitNumber, Complex = schedule.ContactDetails.Complex, StreetNumber = schedule.ContactDetails.StreetNumber, StreetName = schedule.ContactDetails.StreetName, City = schedule.ContactDetails.City, Country = schedule.ContactDetails.Country, Suburb = schedule.ContactDetails.Suburb, PostalCode = schedule.ContactDetails.PostalCode, }; client = new ClientDto() { DateOfBirth = schedule.ClientDetails.DateOfBirth, TaxNumber = schedule.TaxResidency.TaxNumber, WorkNumber = schedule.ContactDetails.WorkNumber, MobileNumber = schedule.ContactDetails.MobileNumber, Email = schedule.ContactDetails.Email }; } var risk = _context.RiskProfiles.First(c => c.ApplicationId == applicationId); var fdpMandate = _context.FspMandatates.First(c => c.ApplicationId == applicationId); var divTax = _context.Dividends.First(c => c.ApplicationId == applicationId); var documentList = new List <ApplicationDocumentsModel>(); // intro letter documentList.Add(kycExist == true ? CreateIntroLetter(advisor, kyc.FirstNames, kyc.SurName, kyc.IdNumber) : CreateIntroLetter(advisor, appl.User.FirstName, appl.User.LastName, appl.User.IdNumber)); // FNA documentList.Add(kycExist == true ? CreateFinancialNeedsAnalysis(roa, address.City, kyc.FirstNames, kyc.SurName, kyc.IdNumber, advisor) : CreateFinancialNeedsAnalysis(roa, address.City, appl.User.FirstName, appl.User.LastName, appl.User.IdNumber, advisor)); // Bank Validation documentList.Add(kycExist == true ? CreateBankValidationReport(bankValidation, kyc.FirstNames, kyc.SurName) : CreateBankValidationReport(bankValidation, appl.User.FirstName, appl.User.LastName)); // Primary Schedule ApplicationDocumentsModel schedulePrimary = null; if (scheduleStep.ScheduleType == "Individual") { var schedule = _context.PrimaryIndividuals .Where(c => c.ApplicationId == applicationId) .Include(c => c.ContactDetails) .Include(c => c.ClientDetails) .ThenInclude(c => c.IdentityDetails) .Include(c => c.TaxResidency) .ThenInclude(c => c.TaxResidencyItems) .Include(c => c.PurposeAndFunding) .First(); schedulePrimary = CreatePrimaryIndividualSchedule(schedule, bankValidation); } ; // Risk Profile documentList.Add(kycExist == true ? CreateRiskProfile(risk, advisor, advise, kyc.FirstNames, kyc.SurName, kyc.IdNumber) : CreateRiskProfile(risk, advisor, advise, appl.User.FirstName, appl.User.LastName, appl.User.IdNumber)); // Record Of Advise documentList.Add(kycExist == true ? CreateRecordOfAdvie(roa, kyc.FirstNames, kyc.SurName, kyc.IdNumber, advisor, risk, advise) : CreateRecordOfAdvie(roa, appl.User.FirstName, appl.User.LastName, appl.User.IdNumber, advisor, risk, advise)); // FSP Mandate documentList.Add(kycExist == true ? CreateFspMandate(kyc.FirstNames, kyc.SurName, risk, fdpMandate, address, appl.User, advisor, roa, bankValidation) : CreateFspMandate(appl.User.FirstName, appl.User.LastName, risk, fdpMandate, address, appl.User, advisor, roa, bankValidation)); // Dividend documentList.Add(kycExist == true ? CreateDividendTax(divTax, address, client, kyc.FirstNames, kyc.SurName, kyc.IdNumber) : CreateDividendTax(divTax, address, client, appl.User.FirstName, appl.User.LastName, appl.User.IdNumber)); documentList.ForEach(doc => { doc.ApplicationId = appl.Id; doc.B64Prefix = "data:application/pdf;base64,"; doc.Name = doc.DocumentType == DocumentTypesEnum.IntorLetter ? $"Intro Letter: {appl.User.FirstName} {appl.User.LastName}.pdf" : doc.DocumentType == DocumentTypesEnum.FinancialNeedsAnalysis ? $"Financial Needs Analysis: {appl.User.FirstName} {appl.User.LastName}.pdf" : doc.DocumentType == DocumentTypesEnum.BankVerification ? $"Bank Validation Report: {appl.User.FirstName} {appl.User.LastName}.pdf" : doc.DocumentType == DocumentTypesEnum.PrimarySchedule ? $"Primary Schedule, Individual: {appl.User.FirstName} {appl.User.LastName}.pdf" : doc.DocumentType == DocumentTypesEnum.RiskProfile ? $"Risk Profile: {appl.User.FirstName} {appl.User.LastName}.pdf" : doc.DocumentType == DocumentTypesEnum.RecordOfAdvise ? $"Record of Advise: {appl.User.FirstName} {appl.User.LastName}.pdf" : doc.DocumentType == DocumentTypesEnum.FspMandate ? $"FSP Mandate: {appl.User.FirstName} {appl.User.LastName}.pdf" : doc.DocumentType == DocumentTypesEnum.Dividende ? $"Dividend Tax: {appl.User.FirstName} {appl.User.LastName}.pdf" : null; if (appl.Documents.Any(c => c.DocumentType == doc.DocumentType)) { _context.ApplicationDocuments.Update(doc); } else { _context.ApplicationDocuments.Add(doc); } _context.SaveChanges(); }); // update applicaiton - documents created appl.DocumentsCreated = true; _context.Applications.Update(appl); _context.SaveChanges(); }
public ClientRegistered(ClientDto user) { User = user; }
public async Task <DinazorResult <List <OrganizationLicenceDto> > > IsLicenceValid(ClientDto clientDto) { var result = new DinazorResult <List <OrganizationLicenceDto> >(); // try to the generate the client identifier according to the given information var clientIdentifier = clientDto.BiosVersion + clientDto.HddSerialNo + clientDto.Username + clientDto.Password; if (clientIdentifier != clientDto.ClientIdentifier) { result.Status = ResultStatus.Unauthorized; return(result); } //then check the database if there is a row with given information var clientIdResult = await _licenceOperation.GetClientByClientIdentifier(clientIdentifier); if (!clientIdResult.IsSuccess) { //something went wrong return(result); } clientDto.Id = clientIdResult.Data; // then get the client active licences var activeLicencesResult = await _licenceOperation.GetActiveLicence(clientDto.Id); return(activeLicencesResult); }
public async Task <IActionResult> EditClient(int id) { ClientDto client = await _clientService.GetClientByIdAsync(id); return(View(client)); }
public int Add(ClientDto item) { item.CreateValidation(); return(_clientRepository.Create(_mapper.Map <ClientDto, Client>(item))); }
private void EditClick(int id) { ToSave = Clients.Find(x => x.ClientId == id); }
public async Task <IActionResult> PostClient(ClientDto clientDto) { bool created = await _service.CreateClient(clientDto); return(created ? StatusCode(201, clientDto) : (IActionResult)BadRequest()); }
public static Client ToEntity(this ClientDto client) { return(Mapper.Map <Client>(client)); }
public async Task <IActionResult> UpdateClient(string id, ClientDto clientDto) { var updatedClient = await _service.UpdateClient(id, clientDto); return(updatedClient != null?Ok(updatedClient) : (IActionResult)BadRequest()); }
public async Task <IActionResult> Post([FromBody] ClientDto dto) { var result = await _customClientService.Insert(dto); return(CreatedResponse(result)); }
public static Client FromDto(ClientDto dto) => new(new Code(dto.Code)
private void Button_Click(object sender, RoutedEventArgs e) { ClientDto obj = ((FrameworkElement)sender).DataContext as ClientDto; Switcher.Switch(new AddContractPage(obj)); }
public ClientDto UpdateClient(ClientDto client) { ClientDto clientDtos = _clientRepo.UpdateClient(client); return(clientDtos); }