ResponseMessage Import()
        {
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, null, null);

            request.MessageDataExtension.Add("IMPORT_TYPE", "Full");
            return(new MessageBroker().Execute(request));
        }
Esempio n. 2
0
        static ResponseMessage Get(long id)
        {
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, null, null);

            request.MessageDataExtension.Add("ID", id.ToString());
            return(new MessageBroker().Execute(request));
        }
        static ResponseMessage Update(long orderId, int quantity, string notes)
        {
            OrderMaster item = new OrderMaster()
            {
                CreateDate  = DateTime.Now.AddDays(-1),
                CreatedUser = "******",
                Id          = orderId,
                Customer    = new MaestroCustomer()
                {
                    Id = 88
                },
                Notes        = "Some notes about order",
                DeliveryDate = DateTime.Now.AddDays(3),
                OrderDate    = DateTime.Now,
                OrderStatus  = "ON",
                PaymentType  = "COD",
                OrderItems   = new List <OrderItem>(
                    new OrderItem[]
                {
                    new OrderItem()
                    {
                        OrderId = orderId,
                        Product = new MaestroProduct()
                        {
                            Id = 2
                        },
                        QbProductMap = new QuickBooksProductMapDef()
                        {
                            Id = 10
                        },
                        Quantity = 12,
                        Unit     = new MaestroUnit {
                            Id = 12
                        }
                    },
                    new OrderItem()
                    {
                        OrderId = orderId,
                        Product = new MaestroProduct()
                        {
                            Id = 24
                        },
                        Quantity     = 11,
                        QbProductMap = new QuickBooksProductMapDef()
                        {
                            Id = 74
                        },
                        Unit = new MaestroUnit {
                            Id = 12
                        }
                    }
                }
                    )
            };
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, "UpdateQbOrder", new List <ITransactionEntity>(new ITransactionEntity[] { item }));

            request.MessageDataExtension.Add(MessageDataExtensionKeys.CLEAN_ORDER_ITEMS, "true");
            return(new MessageBroker().Execute(request));
        }
        ResponseMessage Import()
        {
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, null, null);

            request.MessageDataExtension.Add("BEGIN_DATE", new DateTime(2019, 5, 1).ToString());
            request.MessageDataExtension.Add("END_DATE", new DateTime(2019, 6, 1).ToString());
            return(new MessageBroker().Execute(request));
        }
        static ResponseMessage List()
        {
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, null, null);

            request.MessageDataExtension.Add(MessageDataExtensionKeys.CUSTOMER_ID, "5");
            request.MessageDataExtension.Add(MessageDataExtensionKeys.LIST_CODE, OrderRequestType.DashboardSummary.ToString());
            return(new MessageBroker().Execute(request));
        }
        static ResponseMessage Add(long orderId)
        {
            OrderMaster item = new OrderMaster()
            {
                Id       = orderId,
                Customer = new MaestroCustomer()
                {
                    Id = 503
                },
                Notes        = "Some notes about order",
                DeliveryDate = DateTime.Now.AddDays(3),
                OrderDate    = DateTime.Now,
                OrderStatus  = "ON",
                PaymentType  = "COD",
                OrderItems   = new List <OrderItem>(
                    new OrderItem[]
                {
                    new OrderItem()
                    {
                        OrderId = orderId,
                        Product = new MaestroProduct()
                        {
                            Id = 164
                        },
                        Quantity = 2,
                        Unit     = new MaestroUnit {
                            Id = 1
                        },
                        QbProductMap = new QuickBooksProductMapDef {
                            Id = 386
                        }
                    },
                    new OrderItem()
                    {
                        OrderId = orderId,
                        Product = new MaestroProduct()
                        {
                            Id = 165
                        },
                        Quantity = 1,
                        Unit     = new MaestroUnit {
                            Id = 1
                        },
                        QbProductMap = new QuickBooksProductMapDef {
                            Id = 393
                        }
                    }
                }
                    )
            };
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, "InsertNewOrder", new List <ITransactionEntity>(new ITransactionEntity[] { item }));

            return(new MessageBroker().Execute(request));
        }
        ResponseMessage DoOrderSummary(Dictionary <string, object> testData)
        {
            RequestMessage request = MessagePrepareAgent.GetRequest("Report", "ORDER", "", null);

            foreach (KeyValuePair <string, object> kvp in testData)
            {
                request.MessageDataExtension.Add(kvp.Key, kvp.Value.ToString());
            }

            return(new MessageBroker().Execute(request));
        }
        public static ResponseMessage Add(string name, string postalCode)
        {
            MaestroRegion item = new MaestroRegion()
            {
                Description = "Region description",
                Name        = name,
                PostalCode  = postalCode
            };
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, "", new List <ITransactionEntity>(new ITransactionEntity[] { item }));

            return(new MessageBroker().Execute(request));
        }
Esempio n. 9
0
        static ResponseMessage Add(string name, string description, bool canHaveUnits)
        {
            MaestroUnitType item = new MaestroUnitType()
            {
                CanHaveUnits = canHaveUnits,
                Name         = name,
                Description  = description
            };

            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, "", new List <ITransactionEntity>(new ITransactionEntity[] { item }));

            return(new MessageBroker().Execute(request));
        }
Esempio n. 10
0
        static ResponseMessage Add(string name, string qbUnit, long unitTypeId)
        {
            MaestroUnit item = new MaestroUnit()
            {
                Name           = name,
                QuickBooksUnit = qbUnit,
                UnitType       = new MaestroUnitType()
                {
                    Id = unitTypeId
                },
            };

            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, "", new List <ITransactionEntity>(new ITransactionEntity[] { item }));

            return(new MessageBroker().Execute(request));
        }
Esempio n. 11
0
        public static ResponseMessage Add(string codeBase, int menuId, string group, string desc, string tcode)
        {
            TransactionDefinition item = new TransactionDefinition()
            {
                CodeBase        = "Koenig.Maestro.Operation.TransactionRepository." + codeBase,
                GroupCode       = group,
                IsCancellable   = false,
                IsQbRelated     = false,
                MenuId          = menuId,
                TranCode        = tcode,
                TranDescription = desc
            };

            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, "", new List <ITransactionEntity>(new ITransactionEntity[] { item }));

            return(new MessageBroker().Execute(request));
        }
Esempio n. 12
0
        ResponseMessage Add(long customerId, long productId, long unitId)
        {
            CustomerProductUnit item = new CustomerProductUnit()
            {
                Customer = new MaestroCustomer {
                    Id = customerId
                },
                Product = new MaestroProduct {
                    Id = productId
                },
                Unit = new MaestroUnit {
                    Id = unitId
                }
            };
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, "", new List <ITransactionEntity>(new ITransactionEntity[] { item }));

            return(new MessageBroker().Execute(request));
        }
Esempio n. 13
0
        ResponseMessage Add(long regionId, string name, string title)
        {
            MaestroCustomer item = new MaestroCustomer()
            {
                Address            = "An address",
                DefaultPaymentType = "COD",
                Email  = "*****@*****.**",
                Name   = "A customer",
                Region = new MaestroRegion()
                {
                    Id = regionId
                },
                Title = "A Title",
                Phone = "123456789",
            };
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, "", new List <ITransactionEntity>(new ITransactionEntity[] { item }));

            return(new MessageBroker().Execute(request));
        }
        public static ResponseMessage Add(int minimumOrder, decimal price, long unitTypeId, string name, long groupId)
        {
            MaestroProduct item = new MaestroProduct()
            {
                Name                 = name,
                Description          = "A description",
                MinimumOrderQuantity = minimumOrder,
                Price                = price,
                QuickBooksProductId  = string.Empty,
                //GroupId = groupId,
                UnitType = new MaestroUnitType()
                {
                    Id = unitTypeId
                }
            };

            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, "", new List <ITransactionEntity>(new ITransactionEntity[] { item }));

            return(new MessageBroker().Execute(request));
        }
Esempio n. 15
0
        static ResponseMessage List()
        {
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, null, null);

            return(new MessageBroker().Execute(request));
        }
Esempio n. 16
0
        static ResponseMessage GetNewOrderId()
        {
            RequestMessage request = MessagePrepareAgent.GetRequest(action, tranCode, "RequestNewId", null);

            return(new MessageBroker().Execute(request));
        }