public Task <List <string> > Handle(GetCustomers request, CancellationToken cancellationToken) { // TODO: Read from repository (EF, CosmosDB, Blob, DataLake, Search, ...) return(Task.FromResult(new List <string> { "Pong" })); }
public string GetCustomer(string id) { GetCustomers Customers = new GetCustomers(); string emp_no = id; var list = Customers.GetCustomerBusiness(emp_no); return(JsonConvert.SerializeObject(list)); }
public DataTable CustomersList() { DataTable data = new DataTable(); data = new GetCustomers().CustomersList(); return(data); }
public DataTable Question4() { DataTable data = new DataTable(); data = new GetCustomers().Question4(); return(data); }
/// <summary> /// Конструктор формы отображения списка ответсвенных лиц по заявке технику(ПС) /// </summary> /// <param name="_serviceorder">Заявка на ПС</param> public ObjCustsPopupViewModel(NewTest2ExtensionBase_ex _serviceorder) { ServiceOrderFireAlarm = _serviceorder; GetCustomers.Execute(null); ArrowCircleCustomers = IconName("arrow_circle_down"); OpacityForm = 1; IndicatorVisible = false; CloseImage = IconName("close"); CallImage = IconName("call"); }
public IReadOnlyList <CustomerModel> Handle(GetCustomers query) { return(_customerRespository.Where(x => x.Active == query.Active).Select(x => new CustomerModel { Id = x.Id, FirstName = x.FirstName, LastName = x.LastName, Email = x.Email }).ToList()); }
public void Get_customers_using_dto_from_assembly_and_deserialize() { using (var client = new Soap12ServiceClient(base.WsSyncReplyUri)) { var request = new GetCustomers { CustomerIds = new ArrayOfIntId { CustomerId } }; var response = client.Send(request); var customersResponse = response.GetBody<GetCustomersResponse>(); Assert.AreEqual(1, customersResponse.Customers.Count); Assert.AreEqual(CustomerId, customersResponse.Customers[0].Id); } }
public object Get(GetCustomers request) { if (string.IsNullOrEmpty(request.LastName)) { return(_dbCustomerContext.Customers.ToList() .Select(c => c.Translate())); } return(_dbCustomerContext.Customers .Where(c => c.LastName == request.LastName).ToList() .Select(c => c.Translate())); }
public void Get_customers_using_dto_from_assembly_and_parse_with_xlinq() { using (var client = new Soap12ServiceClient(base.WsSyncReplyUri)) { var request = new GetCustomers { CustomerIds = new ArrayOfIntId { CustomerId } }; var response = client.Send(request); var el = XNode.ReadFrom(response.GetReaderAtBodyContents()) as XElement; var customers = el.AnyElement("Customers").AllElements("Customer").ToList(); Assert.AreEqual(1, customers.Count); Assert.AreEqual(CustomerId, customers[0].GetInt("Id")); } }
public void Get_customers_using_JsonServiceClient() { using (IServiceClient client = new JsonServiceClient(base.JsonSyncReplyBaseUri)) { var request = new GetCustomers { CustomerIds = new ArrayOfIntId { CustomerId } }; var response = client.Send <GetCustomersResponse>(request); Assert.AreEqual(1, response.Customers.Count); Assert.AreEqual(CustomerId, response.Customers[0].Id); } }
public void Get_customers_using_dto_from_assembly_and_deserialize() { using (var client = new Soap12ServiceClient(base.WsSyncReplyUri)) { var request = new GetCustomers { CustomerIds = new ArrayOfIntId { CustomerId } }; var response = client.Send(request); var customersResponse = response.GetBody <GetCustomersResponse>(); Assert.AreEqual(1, customersResponse.Customers.Count); Assert.AreEqual(CustomerId, customersResponse.Customers[0].Id); } }
public void Get_customers_using_dto_from_assembly_and_parse_with_xlinq_BasicHttp() { using (var client = new Soap11ServiceClient(base.BasicHttpSyncReplyUri)) { var request = new GetCustomers { CustomerIds = new ArrayOfIntId { CustomerId } }; var response = client.Send(request); var el = XNode.ReadFrom(response.GetReaderAtBodyContents()) as XElement; var customers = el.AnyElement("Customers").AllElements("Customer").ToList(); Assert.AreEqual(1, customers.Count); Assert.AreEqual(CustomerId, customers[0].GetInt("Id")); } }
public void Get_customers_using_dto_from_assembly_and_parse_all_with_xlinq() { using (var client = new Soap12ServiceClient(base.WsSyncReplyUri)) { var request = new GetCustomers { CustomerIds = new ArrayOfIntId { CustomerId } }; var response = client.Send(request); var el = XNode.ReadFrom(response.GetReaderAtBodyContents()) as XElement; var customers = CustomerTranslator.Instance.ParseAll(el.AnyElement("Customers").AllElements("Customer")).ToList(); Assert.AreEqual(1, customers.Count); Assert.AreEqual(CustomerId, customers[0].Id); } }
public async Task <IEnumerable <CustomerModel> > Handle(GetCustomers request, CancellationToken cancellationToken) { var query = _dbCtx.Customers.Select(c => new CustomerModel() { Address = c.Address, City = c.City, CompanyName = c.CompanyName, ContactName = c.ContactName, CustomerId = c.CustomerId }) .OrderBy(c => c.CompanyName) .AsQueryable(); if (!string.IsNullOrEmpty(request.SearchText)) { query = query.Where(c => c.CompanyName.ToLower().StartsWith(request.SearchText.ToLower())); } return(await query.ToListAsync(cancellationToken)); }
public IEnumerable <CustomerItem> Handle(GetCustomers query) { var propsSearch = BuildPropertiesList(query.Search); if (propsSearch.Any()) { var customers = _archContext.Customers.AsQueryable(); foreach (var item in propsSearch) { customers = item.ApplyToQuery(customers); } return(_mapper.Map <IEnumerable <CustomerItem> >(customers).ToList()); } return(_mapper.Map <IEnumerable <CustomerItem> >(_archContext.Customers).ToList()); //if (query.Search.Any()) //{ // return _mapper.Map<IEnumerable<CustomerItem>>(BuildProperties(query.Search).ApplyToQuery(_archContext.Customers)).ToList(); //} else //{ // return _mapper.Map<IEnumerable<CustomerItem>>(_archContext.Customers).ToList(); //} }
public IActionResult getCustomer(long?ID, string Name, string custOrName, string CusNo, string email, string mobile, string nationID, long?languageID, long?CustomerType, string CommName) { GetCustomers operation = new GetCustomers(); operation.ID = ID; operation.Name = Name; operation.Email = email; operation.Mobile = mobile; operation.ReferenceNo = nationID; operation.CustomerNo = CusNo; operation.CustomerType = CustomerType; operation.CustomerNoOrName = custOrName; operation.CommName = CommName; if (languageID.HasValue) { operation.LangID = languageID; } else { operation.LangID = 1; } var result = operation.QueryAsync().Result; if (result is ValidationsOutput) { return(Ok(new ApiResult <List <ValidationItem> >() { Data = ((ValidationsOutput)result).Errors })); } else { var ReturnResult = (List <Customer>)result; return(Ok(ReturnResult)); } }
public object Get(GetCustomers request) { return(new GetCustomersResponse { Results = Db.Select <Customer>() }); }
public async Task <IEnumerable <CustomerDto> > HandleAsync(GetCustomers query) { var customers = await _customerRepository.FindAsync(_ => true); return(customers.Select(p => p.AsDto())); }
public IReadOnlyList <CustomerItem> Handle(GetCustomers query) { return(_customerRepository.GetList <CustomerItem>().ToList()); }
public GetCustomersResponse Get(GetCustomers request) { return new GetCustomersResponse { Results = Db.Select<Customer>() }; }
public async Task <IEnumerable <Customer> > Handle(GetCustomers query, CancellationToken cancellationToken) { var result = await _repository.GetAsync(); return(result); }
public IActionResult Get([FromQuery] GetCustomers customers) { return(Ok(_processor.Get(customers))); }
public object Get(GetCustomers request) { return(Db.Select <Customer>()); }
public IActionResult DisplayCustomerSearchList(SearchCustomerViewModel model, int page) { model.CurrentPage = page; model = new GetCustomers(_context).FilteredByNameAndCity(model); return(View(model)); }