public CreditCardController(Api application, QueryService query_service, ICreditCardPaymentGateway credit_card_payment_gateway) { _queryService = query_service; _credit_card_payment_gateway = credit_card_payment_gateway; _application = application; }
/// <summary> /// Constructor /// </summary> public RecruiterView() { Competences = new List<SelectListItem>(); FromDate = new List<SelectListItem>(); ToDate = new List<SelectListItem>(); DatesOfApplication = new List<SelectListItem>(); Names = new List<SelectListItem>(); Result = new List<Application>(); _Applications = new QueryService<Application>().GetAll((a => a.Availabilities), (a => a.Person), (a => a.CompetenceProfiles)); _Competences = new QueryService<Competence>().GetAll(); _Availabilities = new QueryService<Availability>().GetAll(); }
/// <summary> /// check for customer /// </summary> /// <param name="syncObjects"></param> /// <param name="service"></param> /// <returns></returns> public Syncdto IsCustSync(Syncdto syncObjects, SyncService service) { Dictionary<string, bool> isSync = new Dictionary<string, bool>(); var custDataInDb = service.GetDatafromDBCustomer(syncObjects); if (custDataInDb.CustomerList.Count > 0) { custDataInDb.IsCustomerNodata = false; for (int i = 0; i < custDataInDb.CustomerList.Count; i++) { string EXISTING_CUSTOMER_QUERY = string.Format("select * from customer where active = true and givenName = '{0}' and familyName = '{1}'", custDataInDb.CustomerList[i].GivenName.Trim(), custDataInDb.CustomerList[i].FamilyName.Trim()); QueryService<Customer> queryService = new QueryService<Customer>(service.ServiceContext); Customer resultFound = queryService.ExecuteIdsQuery(EXISTING_CUSTOMER_QUERY).FirstOrDefault<Customer>(); if (resultFound != null) { custDataInDb.CustomerList[i].Id = resultFound.Id; isSync.Add(custDataInDb.CustomerList[i].GivenName, true); } else { isSync.Add(custDataInDb.CustomerList[i].GivenName, false); } } if (isSync.Where(x => x.Value == false).Any()) { custDataInDb.IsCustomerSync = false; } else { custDataInDb.IsCustomerSync = true; } } else { custDataInDb.IsCustomerNodata = true; custDataInDb.IsCustomerSync = false; } return custDataInDb; }
public void CreateRepository() { sut = new QueryService(dbContext); }
public void registerProductType() { if ( proxy == null) { // Instatiate the embedded space proxy = GigaSpacesFactory.FindSpace("/./xapTutorialSpace");; spaceUtility = new SpaceUtility (proxy); userUtil = new UserUtil(proxy); queryService = new QueryService(proxy); service = new CRUDService(proxy); // Register the Space Document } // Create a user userUtil.loadUsers(); service.registerProductType(); service.createDocumemt(); }
public HomeController(QueryService queryService) { _queryService = queryService; }
/// <summary> /// Return the customer id from timeactivity. /// </summary> /// <param name="invoicedto"></param> /// <returns></returns> private TimeActivity GetCustomerId(Invoicedto invoicedto) { string EXISTING_TimeActive_QUERY = string.Format("select * from timeactivity where Id = '{0}'", invoicedto.timeQboId); QueryService<TimeActivity> queryService = new QueryService<TimeActivity>(dataserviceFactory.getServiceContext); TimeActivity resultFound = queryService.ExecuteIdsQuery(EXISTING_TimeActive_QUERY).FirstOrDefault<TimeActivity>(); return resultFound; }
public void TestExecuteQuery() { List<KeyValuePair<Query, QueryResult>> queryTestData = GetExecuteTestCases.ToList(); foreach (KeyValuePair<Query, QueryResult> keyValuePair in queryTestData) { QueryService queryService = new QueryService(new MockDataService(), new MockQueryTcpClient(), new MockQueryTcpServer()); QueryResult queryResult = queryService.ExecuteQuery(keyValuePair.Key); Assert.AreEqual(keyValuePair.Value.ResultMessage, queryResult.ResultMessage); } }
public PayPalController(Api application, QueryService query_service) { _queryService = query_service; _application = application; }
/// <summary> /// Sync the customer in to QBO /// </summary> /// <param name="controller"></param> /// <param name="syncObjects"></param> /// <returns></returns> internal Syncdto SyncCustomer(object controller, Syncdto syncObjects) { try { for (int i = 0; i < syncObjects.CustomerList.Count; i++) { string EXISTING_CUSTOMER_QUERY = string.Format("select * from customer where active = true and givenName = '{0}' and familyName = '{1}'", syncObjects.CustomerList[i].GivenName.Trim(), syncObjects.CustomerList[i].FamilyName.Trim()); QueryService<Customer> queryService = new QueryService<Customer>(dataserviceFactory.getServiceContext); Customer resultFound = queryService.ExecuteIdsQuery(EXISTING_CUSTOMER_QUERY).FirstOrDefault<Customer>(); if (resultFound == null) { Customer entity = dataService.Add<Customer>(syncObjects.CustomerList[i]); syncObjects.CustomerList[i] = entity; syncObjects.IsCustomerSync = true; } else { syncObjects.CustomerList[i] = resultFound; } } syncObjects = syncRepository.Save(controller, syncObjects); return syncObjects; } catch (Intuit.Ipp.Exception.FaultException ex) { throw ex; } catch (Intuit.Ipp.Exception.InvalidTokenException ex) { throw ex; } catch (Intuit.Ipp.Exception.SdkException ex) { throw ex; } }
/// <summary> /// Sync the items in to QBO. /// </summary> /// <param name="controller"></param> /// <param name="syncObjects"></param> /// <returns></returns> internal Syncdto SyncServiceItems(object controller, Syncdto syncObjects) { try { foreach (Item ItemItem in syncObjects.ItemList) { string EXISTING_ITEM_QUERY = string.Format("select * from Item where active = true and name = '{0}'", ItemItem.Name.Trim()); QueryService<Item> queryService = new QueryService<Item>(dataserviceFactory.getServiceContext); Item resultFound = queryService.ExecuteIdsQuery(EXISTING_ITEM_QUERY).FirstOrDefault<Item>(); if (resultFound == null) { Item entity = dataService.Add<Item>(ItemItem); syncObjects.QboId = entity.Id; syncObjects.IsServiceItemSync = true; } } syncObjects = syncRepository.Save(controller, syncObjects); return syncObjects; } catch (Intuit.Ipp.Exception.FaultException ex) { throw ex; } catch (Intuit.Ipp.Exception.InvalidTokenException ex) { throw ex; } catch (Intuit.Ipp.Exception.SdkException ex) { throw ex; } }
/// <summary> /// Sync the employees in to QBO. /// </summary> /// <param name="controller"></param> /// <param name="syncObjects"></param> /// <returns></returns> public Syncdto SyncEmployees(object controller, Syncdto syncObjects) { try { for (int i = 0; i < syncObjects.EmployeeList.Count; i++) { string EXISTING_EMPLOYEE_QUERY = string.Format("select * from employee where active = true and givenName = '{0}' and familyName = '{1}'", syncObjects.EmployeeList[i].GivenName.Trim(), syncObjects.EmployeeList[i].FamilyName.Trim()); QueryService<Employee> queryService = new QueryService<Employee>(dataserviceFactory.getServiceContext); Employee resultFound = queryService.ExecuteIdsQuery(EXISTING_EMPLOYEE_QUERY).FirstOrDefault<Employee>(); if (resultFound == null) { Employee entity = dataService.Add<Employee>(syncObjects.EmployeeList[i]); syncObjects.EmployeeList[i] = entity; syncObjects.IsEmployeeSync = true; } else { syncObjects.EmployeeList[i] = resultFound; } } syncObjects = syncRepository.Save(controller, syncObjects); return syncObjects; } catch (Intuit.Ipp.Exception.FaultException ex) { throw ex; } catch (Intuit.Ipp.Exception.InvalidTokenException ex) { throw ex; } catch (Intuit.Ipp.Exception.SdkException ex) { throw ex; } }
/// <summary> /// Check for service item. /// </summary> /// <param name="syncObjects"></param> /// <param name="service"></param> /// <returns></returns> public Syncdto IsServiceItemSync(Syncdto syncObjects, SyncService service) { Dictionary<string, bool> isSync = new Dictionary<string, bool>(); var itemDataInDb = service.GetDatafromDBItem(syncObjects); if (itemDataInDb.ItemList.Count>0) { itemDataInDb.IsServiceItemNodata = false; for (int i = 0; i < itemDataInDb.ItemList.Count; i++) { string EXISTING_ITEM_QUERY = string.Format("select * from Item where active = true and name = '{0}'", itemDataInDb.ItemList[i].Name.Trim()); QueryService<Item> queryService = new QueryService<Item>(service.ServiceContext); Item resultFound = queryService.ExecuteIdsQuery(EXISTING_ITEM_QUERY).FirstOrDefault<Item>(); if (resultFound != null) { itemDataInDb.ItemList[i].Id = resultFound.Id; isSync.Add(itemDataInDb.ItemList[i].Name, true); } else { isSync.Add(itemDataInDb.ItemList[i].Name, false); } } if (isSync.Where(x => x.Value == false).Any()) { itemDataInDb.IsServiceItemSync = false; } else { itemDataInDb.IsServiceItemSync = true; } } else { itemDataInDb.IsServiceItemNodata = true; itemDataInDb.IsServiceItemSync = false; } return itemDataInDb; }
/// <summary> /// check for employees /// </summary> /// <param name="syncObjects"></param> /// <param name="service"></param> /// <returns></returns> public Syncdto IsEmpSync(Syncdto syncObjects, SyncService service) { Dictionary<string, bool> isSync = new Dictionary<string, bool>(); var empDataInDb = service.GetDatafromDBEmployee(syncObjects); if (empDataInDb.EmployeeList.Count > 0) { empDataInDb.IsEmployeeNoData = false; for (int i = 0; i < empDataInDb.EmployeeList.Count; i++) { string EXISTING_EMPLOYEE_QUERY = string.Format("select * from employee where active = true and givenName='{0}' and familyName= '{1}'", empDataInDb.EmployeeList[i].GivenName.Trim(), empDataInDb.EmployeeList[i].FamilyName.Trim()); QueryService<Employee> queryService = new QueryService<Employee>(service.ServiceContext); Employee resultFound = queryService.ExecuteIdsQuery(EXISTING_EMPLOYEE_QUERY).FirstOrDefault<Employee>(); if (resultFound != null) { empDataInDb.EmployeeList[i].Id = resultFound.Id; //indexIterator = i+1; isSync.Add(empDataInDb.EmployeeList[i].GivenName, true); } else { isSync.Add(empDataInDb.EmployeeList[i].GivenName, false); } } if (isSync.Where(x => x.Value == false).Any()) { empDataInDb.IsEmployeeSync = false; } else { empDataInDb.IsEmployeeSync = true; } } else { empDataInDb.IsEmployeeNoData = true; empDataInDb.IsEmployeeSync = false; } return empDataInDb; }
public static List<Employee> getEmployeeList(IppRealmOAuthProfile profile) { ServiceContext serviceContext = getServiceContext(profile); QueryService<Employee> employeeQueryService = new QueryService<Employee>(serviceContext); return employeeQueryService.Select(c => c).ToList(); }
public static List<Customer> getCustomerList(RestProfile profile) { ServiceContext serviceContext = getServiceContext(profile); QueryService<Customer> customerQueryService = new QueryService<Customer>(serviceContext); return customerQueryService.Select(c => c).ToList(); }
private void displayCustomers() { string consumerKey = ConfigurationSettings.AppSettings["consumerKey"]; string consumerSecret = ConfigurationSettings.AppSettings["consumerSecret"]; OAuthRequestValidator oauthRequestValidator = new OAuthRequestValidator(_ippRealmOAuthProfile.accessToken, _ippRealmOAuthProfile.accessSecret, consumerKey, consumerSecret); ServiceContext serviceContext = new ServiceContext(_ippRealmOAuthProfile.realmId, IntuitServicesType.QBO, oauthRequestValidator); DataService dataService = new DataService(serviceContext); QueryService<Customer> customerQueryService = new QueryService<Customer>(serviceContext); dataGridView1.DataSource = customerQueryService.ExecuteIdsQuery("Select * From Customer MaxResults 50").ToList(); }
public BasketController(Api application, QueryService query_service, IClientStorage client_storage) { _application = application; _query_service = query_service; _client_storage = client_storage; }
public void TestConstructQuery() { QueryService queryService = new QueryService(); foreach(KeyValuePair<string, Query> kvp in GetConstructTestCases) { Query query = queryService.ConstructQuery(kvp.Key); Assert.AreEqual(kvp.Value.Command, query.Command); Assert.AreEqual(kvp.Value.Argument, query.Argument); Assert.AreEqual(kvp.Value.Key, query.Key); } }
/// <summary> /// Default constructor, initializes query service objects for database access. /// </summary> public RecruiterController() { _applicationQueryService = new QueryService<Application>(); }