示例#1
0
 //================================================================================
 // 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);
     }
 }
示例#2
0
 public List <User> GetUsersByStoreCode(String storeCode)
 {
     try
     {
         UserService client = WebServiceUtils.GetEndpointService <UserService>(UserServiceInfo.ENDPOINT_NAME);
         return(client.GetUsersByStoreCode(storeCode));
     }
     catch (Exception e)
     {
         return(null);
     }
 }
示例#3
0
 public User GetUserById(int id)
 {
     try
     {
         UserService client = WebServiceUtils.GetEndpointService <UserService>(UserServiceInfo.ENDPOINT_NAME);
         return(client.GetUserById(id));
     }
     catch (Exception e)
     {
         return(null);
     }
 }
示例#4
0
 //================================================================================
 // Users
 //================================================================================
 public List <User> GetAllUsers()
 {
     try
     {
         UserService client = WebServiceUtils.GetEndpointService <UserService>(UserServiceInfo.ENDPOINT_NAME);
         return(client.GetAllUsers());
     }
     catch (Exception e)
     {
         return(null);
     }
 }
示例#5
0
 public bool CustomerUpdateDefaultAddress(int AddressId, int CustomerId)
 {
     try
     {
         CustomerService customerService = WebServiceUtils.GetEndpointService <CustomerService>(CustomerServiceInfo.ENDPOINT_NAME);
         return(customerService.CustomerUpdateDefaultAddress(AddressId, CustomerId));
     }
     catch
     {
         return(false);
     }
 }
示例#6
0
        //========================================================================================
        // 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);
            }
        }
示例#7
0
        //================================================================================
        // 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);
        }
示例#8
0
 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);
     }
 }
示例#9
0
        internal Project ProjectCollectFirstIfExists(int CustomerId, int StatusId)
        {
            ProjectService projectService = WebServiceUtils.GetEndpointService <ProjectService>(ProjectServiceInfo.ENDPOINT_NAME);

            return(projectService.ProjectCollectFirstIfExists(CustomerId, StatusId));
        }
示例#10
0
        //============================================================================================
        //  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));
        }
示例#11
0
        internal bool ProductInstanceDelete(int id)
        {
            ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME);

            return(productService.ProductInstanceDelete(id));
        }
示例#12
0
        //==============================================================================================
        //  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));
        }
示例#13
0
        internal ProductCategory ProductsForCategory(String guid)
        {
            ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME);

            return(productService.ProductsForCategory(guid));
        }
示例#14
0
        //============================================================================================
        //  Categories
        //============================================================================================

        internal List <RoomsCategory> RoomsCategoryReadAll()
        {
            ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME);

            return(productService.GetAllRoomsCategories());
        }
示例#15
0
        internal bool ProjectDeleteFromUsers(int ProjectId)
        {
            ProjectService projectService = WebServiceUtils.GetEndpointService <ProjectService>(ProjectServiceInfo.ENDPOINT_NAME);

            return(projectService.ProjectDeleteFromUsers(ProjectId));
        }
示例#16
0
        internal List <Project> ProjectFindChildren(int ProjectId, int StatusId)
        {
            ProjectService projectService = WebServiceUtils.GetEndpointService <ProjectService>(ProjectServiceInfo.ENDPOINT_NAME);

            return(projectService.ProjectFindChildren(ProjectId, StatusId));
        }
示例#17
0
        //  Updates  or adds customer an existing customer
        public int CustomerUpdateOrAdd(Customers customer)
        {
            CustomerService customerService = WebServiceUtils.GetEndpointService <CustomerService>(CustomerServiceInfo.ENDPOINT_NAME);

            return(customerService.CustomerUpdateOrAdd(customer));
        }
示例#18
0
        /// <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));
        }
示例#19
0
        ///<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));
        }
示例#20
0
        /// <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));
        }
示例#21
0
        public Customers CustomerGetByGUID(String CustomerGUID)
        {
            CustomerService customerService = WebServiceUtils.GetEndpointService <CustomerService>(CustomerServiceInfo.ENDPOINT_NAME);

            return(customerService.CustomerGetByGUID(CustomerGUID));
        }
示例#22
0
        internal RoomsCategory CategoriesForRoomsCategory(String name)
        {
            ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME);

            return(productService.CategoriesForRoomsCategory(name));
        }
示例#23
0
        //==============================================================================================
        //  Product Types
        //==============================================================================================

        internal Dictionary <string, ProductType> ProductsGetAll()
        {
            ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME);

            return(productService.ProductGetAll());
        }
示例#24
0
        internal SiteArea ProductsForSiteArea(SiteArea siteArea)
        {
            ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME);

            return(productService.ProductsForSiteArea(siteArea));
        }
示例#25
0
        public SiteArea SiteAreaById(String guid)
        {
            ProductService productService = WebServiceUtils.GetEndpointService <ProductService>(ProductServiceInfo.ENDPOINT_NAME);

            return(productService.GetSiteArea(guid));
        }