//================================================================================ // Addresses //================================================================================ /// <summary> /// Creates an address /// </summary> /// <returns>ID of the new address</returns> public int AddressCreate(Address address) { try { CustomerService client = WebServiceUtils.GetEndpointService <CustomerService>(CustomerServiceInfo.ENDPOINT_NAME); return(client.AddressCreateOrUpdate(address)); } catch { return(-1); } }
public List <User> GetUsersByStoreCode(String storeCode) { try { UserService client = WebServiceUtils.GetEndpointService <UserService>(UserServiceInfo.ENDPOINT_NAME); return(client.GetUsersByStoreCode(storeCode)); } catch (Exception e) { return(null); } }
public User GetUserById(int id) { try { UserService client = WebServiceUtils.GetEndpointService <UserService>(UserServiceInfo.ENDPOINT_NAME); return(client.GetUserById(id)); } catch (Exception e) { return(null); } }
//================================================================================ // Users //================================================================================ public List <User> GetAllUsers() { try { UserService client = WebServiceUtils.GetEndpointService <UserService>(UserServiceInfo.ENDPOINT_NAME); return(client.GetAllUsers()); } catch (Exception e) { return(null); } }
public bool CustomerUpdateDefaultAddress(int AddressId, int CustomerId) { try { CustomerService customerService = WebServiceUtils.GetEndpointService <CustomerService>(CustomerServiceInfo.ENDPOINT_NAME); return(customerService.CustomerUpdateDefaultAddress(AddressId, CustomerId)); } catch { return(false); } }
//======================================================================================== // CUSTOMERS //======================================================================================== public List <Customers> CustomerListGetByAssociate(int Id) { try { CustomerService customerService = WebServiceUtils.GetEndpointService <CustomerService>(CustomerServiceInfo.ENDPOINT_NAME); List <Customers> customerList = customerService.GetCustomerListBySalesAssociate(Id); return(customerList); } catch (Exception e) { throw new Exception(e.Message); } }
//================================================================================ // Site Areas //================================================================================ public List <SiteArea> SiteAreasForStoreCode(String storecode) { List <SiteArea> result = null; List <StoreInfo> stores = this.GetStoreInfoByStoreCode(storecode); if (stores.Count > 0) { StoreInfo info = stores.First(); ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME); result = productService.SiteAreasForStoreCode(info); } return(result); }
public int AddUser(String firstname, String lastname, String username, String storecode, int role = 1) { try { User newUser = new User(); newUser.firstName = firstname; newUser.lastName = lastname; newUser.userName = username; newUser.storeCode = storecode; newUser.roleid = role; UserService client = WebServiceUtils.GetEndpointService <UserService>(UserServiceInfo.ENDPOINT_NAME); return(client.AddUser(newUser)); } catch (Exception e) { return(-1); } }
internal Project ProjectCollectFirstIfExists(int CustomerId, int StatusId) { ProjectService projectService = WebServiceUtils.GetEndpointService <ProjectService>(ProjectServiceInfo.ENDPOINT_NAME); return(projectService.ProjectCollectFirstIfExists(CustomerId, StatusId)); }
//============================================================================================ // Projects //============================================================================================ /// <summary> /// This creates a record attaching a project and a customer. /// </summary> /// <param name="?"></param> /// <param name="?"></param> /// <returns></returns> internal int ProjectAttachCustomer(int CustomerId, int ProjectId) { ProjectService projectService = WebServiceUtils.GetEndpointService <ProjectService>(ProjectServiceInfo.ENDPOINT_NAME); return(projectService.ProjectAttachCustomer(CustomerId, ProjectId)); }
internal bool ProductInstanceDelete(int id) { ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME); return(productService.ProductInstanceDelete(id)); }
//============================================================================================== // Product Instances //============================================================================================== /// <summary> /// Creates or updates a product instance depending on whether or not we have an Id. /// </summary> /// <param name="ProductInstance">ProductInstance</param> /// <returns></returns> internal int ProductInstanceCreateOrUpdate(ProductInstance ProductInstance) { ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME); return(productService.ProductInstanceCreateOrUpdate((ProductInstance)ProductInstance)); }
internal ProductCategory ProductsForCategory(String guid) { ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME); return(productService.ProductsForCategory(guid)); }
//============================================================================================ // Categories //============================================================================================ internal List <RoomsCategory> RoomsCategoryReadAll() { ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME); return(productService.GetAllRoomsCategories()); }
internal bool ProjectDeleteFromUsers(int ProjectId) { ProjectService projectService = WebServiceUtils.GetEndpointService <ProjectService>(ProjectServiceInfo.ENDPOINT_NAME); return(projectService.ProjectDeleteFromUsers(ProjectId)); }
internal List <Project> ProjectFindChildren(int ProjectId, int StatusId) { ProjectService projectService = WebServiceUtils.GetEndpointService <ProjectService>(ProjectServiceInfo.ENDPOINT_NAME); return(projectService.ProjectFindChildren(ProjectId, StatusId)); }
// Updates or adds customer an existing customer public int CustomerUpdateOrAdd(Customers customer) { CustomerService customerService = WebServiceUtils.GetEndpointService <CustomerService>(CustomerServiceInfo.ENDPOINT_NAME); return(customerService.CustomerUpdateOrAdd(customer)); }
/// <summary> /// Feed this an existing project ID and we create the whole quote. /// </summary> /// <param name="project">Project ID to Turn into a Quote</param> /// <returns></returns> /// Here we copy an entire project into a quote. To do so we need to /// 1. Copy the project row itself, setting a new FKParent and updating the ProjectStatus /// 2. Copy all the rooms, setting new FKParentRoom and new FKProject /// 3. Copy all the ProductInstances, setting a new FKParentInstance and FKRoom internal int ProjectCreateFromProject(Project project, int statusId) { ProjectService projectService = WebServiceUtils.GetEndpointService <ProjectService>(ProjectServiceInfo.ENDPOINT_NAME); return(projectService.ProjectCreateFromProject(project, statusId)); }
///<summary> /// This collects a JSON object that can power the entire projects/customers section of the app. It returns by ID ///</summary> public Customers CustomerGetById(int id) { CustomerService customerService = WebServiceUtils.GetEndpointService <CustomerService>(CustomerServiceInfo.ENDPOINT_NAME); return(customerService.CustomerGetById(id)); }
/// <summary> /// Creates a new project in the database and returns the Id. /// </summary> /// <param name="project"></param> /// <returns></returns> internal int ProjectCreateNew(Project project) { ProjectService projectService = WebServiceUtils.GetEndpointService <ProjectService>(ProjectServiceInfo.ENDPOINT_NAME); return(projectService.ProjectCreateNew(project)); }
public Customers CustomerGetByGUID(String CustomerGUID) { CustomerService customerService = WebServiceUtils.GetEndpointService <CustomerService>(CustomerServiceInfo.ENDPOINT_NAME); return(customerService.CustomerGetByGUID(CustomerGUID)); }
internal RoomsCategory CategoriesForRoomsCategory(String name) { ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME); return(productService.CategoriesForRoomsCategory(name)); }
//============================================================================================== // Product Types //============================================================================================== internal Dictionary <string, ProductType> ProductsGetAll() { ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME); return(productService.ProductGetAll()); }
internal SiteArea ProductsForSiteArea(SiteArea siteArea) { ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME); return(productService.ProductsForSiteArea(siteArea)); }
public SiteArea SiteAreaById(String guid) { ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME); return(productService.GetSiteArea(guid)); }