Exemplo n.º 1
0
 public Statuses(IOrdersManager orderManager, long id, UserDTO user)
 {
     _ordersManager = orderManager;
     _user          = user;
     _id            = id;
     InitializeComponent();
 }
Exemplo n.º 2
0
        public void SendBuyOrder(OptionData optionData, int quantity = 1)
        {
            var            unlManager   = (UNLManager)(AppManager.UNLManagerDic[optionData.Symbol]);
            IOrdersManager orderManager = unlManager.OrdersManager;

            orderManager.BuyOption(optionData, quantity);
        }
Exemplo n.º 3
0
        public ProfitReportsController(IAdditionalCostsManager additionalCostsManager, 
            IEmployeeRateRspManager employeeRateRspManager, IEmployeesManager employeeManager, IOrdersManager orderManager,
            IForeignProductsManager foreignProductsManager, IMaterialDeliveryRspManager materialDeliveryRspManager,
            ISocialTaxesManager socialTaxesManager, IInstrumentsManager instrumentsManager, IOwnProductsManager ownProductsManager,
            ITermPositionsManager termPositionsManager, IPositionsManager positionsManager, ITermCostsManager termCostsManager,
            ITaxesManager taxesManager, IInvoicesManager invoicesManager, IInterestsManager interestsManager, ITermsManager termsManager)
        {
            this.additionalCostsManager = additionalCostsManager;
            this.employeeRateRspManager = employeeRateRspManager;
            this.employeeManager = employeeManager;
            this.orderManager = orderManager;
            this.foreignProductsManager = foreignProductsManager;
            this.ownProductsManager = ownProductsManager;
            this.materialDeliveryRspManager = materialDeliveryRspManager;
            this.socialTaxesManager = socialTaxesManager;
            this.instrumentsManager = instrumentsManager;
            this.interestsManager = interestsManager;

            this.termPositionsManager = termPositionsManager;
            this.positionsManager = positionsManager;
            this.termCostsManager = termCostsManager;
            this.taxesManager = taxesManager;
            this.invoicesManager = invoicesManager;
            this.termsManager = termsManager;
        }
Exemplo n.º 4
0
 public OrderController(IOrdersManager ordersManager, ICitiesManager citiesManager, ICustomersManager customersManager, IDeliversManager deliversManager)
 {
     OrderManager    = ordersManager;
     CitiesManager   = citiesManager;
     CustomerManager = customersManager;
     DeliverManager  = deliversManager;
 }
 public GenerateMonthInvoicesController(IInvoicesManager invoicesManager, IOrdersManager ordersManager,
     ITaxesManager taxesManager, IInvoicePositionsManager invoicePositionsManager, IUniqueNumberProvider numberProvider,
     ITermPositionsManager termPositionsManager, IPositionsManager positionsManager, ITermCostsManager termCostsManager,
     IPrinterManager printerManager) : 
     base(invoicesManager, ordersManager, taxesManager, invoicePositionsManager, numberProvider, termPositionsManager, positionsManager, termCostsManager)
 {
     this.printerManager = printerManager;
 }
 public GenerateMonthInvoicesController(IInvoicesManager invoicesManager, IOrdersManager ordersManager,
                                        ITaxesManager taxesManager, IInvoicePositionsManager invoicePositionsManager, IUniqueNumberProvider numberProvider,
                                        ITermPositionsManager termPositionsManager, IPositionsManager positionsManager, ITermCostsManager termCostsManager,
                                        IPrinterManager printerManager) :
     base(invoicesManager, ordersManager, taxesManager, invoicePositionsManager, numberProvider, termPositionsManager, positionsManager, termCostsManager)
 {
     this.printerManager = printerManager;
 }
Exemplo n.º 7
0
 public OrdersController(ApiContext context,
                         IOrderDTOValidator orderDtoValidator,
                         IOrdersManager ordersManager,
                         UserManager <User> userManager)
     : base(context, userManager)
 {
     _orderDtoValidator = orderDtoValidator;
     _ordersManager     = ordersManager;
 }
Exemplo n.º 8
0
 public DishController(IDishesManager dishesManager, IRestaurantsManager restaurantsManager, ICourierManager courierManager, IOrder_dishesManager order_dishesManager, IOrdersManager orderManager, ICitiesManager citiesManager, ICustomersManager customerManager)
 {
     DishesManager       = dishesManager;
     RestaurantsManager  = restaurantsManager;
     CourierManager      = courierManager;
     Order_dishesManager = order_dishesManager;
     OrderManager        = orderManager;
     CitiesManager       = citiesManager;
     CustomerManager     = customerManager;
 }
 public OrdersController(IOrdersManager ordersManager, ICustomersManager customersManager,
                         IDeliverersManager deliverersManager, IDishesManager dishesManager, IOrderDishesManager orderDishesManager,
                         IOrdersStatusHistoryManager ordersStatusHistoryManager, IOrdersStatusManager ordersStatusManager)
 {
     this.ordersManager              = ordersManager;
     this.customersManager           = customersManager;
     this.deliverersManager          = deliverersManager;
     this.dishesManager              = dishesManager;
     this.orderDishesManager         = orderDishesManager;
     this.ordersStatusHistoryManager = ordersStatusHistoryManager;
     this.ordersStatusManager        = ordersStatusManager;
 }
Exemplo n.º 10
0
 public AddInvoicesController(IInvoicesManager invoicesManager, IOrdersManager ordersManager,
                              ITaxesManager taxesManager, IInvoicePositionsManager invoicePositionsManager, IUniqueNumberProvider numberProvider,
                              ITermPositionsManager termPositionsManager, IPositionsManager positionsManager, ITermCostsManager termCostsManager)
 {
     this.invoicesManager         = invoicesManager;
     this.numberProvider          = numberProvider;
     this.ordersManager           = ordersManager;
     this.taxesManager            = taxesManager;
     this.invoicePositionsManager = invoicePositionsManager;
     this.termPositionsManager    = termPositionsManager;
     this.positionsManager        = positionsManager;
     this.termCostsManager        = termCostsManager;
 }
Exemplo n.º 11
0
 public AddInvoicesController(IInvoicesManager invoicesManager, IOrdersManager ordersManager,
     ITaxesManager taxesManager, IInvoicePositionsManager invoicePositionsManager, IUniqueNumberProvider numberProvider,
     ITermPositionsManager termPositionsManager, IPositionsManager positionsManager, ITermCostsManager termCostsManager)
 {
     this.invoicesManager = invoicesManager;
     this.numberProvider = numberProvider;
     this.ordersManager = ordersManager;
     this.taxesManager = taxesManager;
     this.invoicePositionsManager = invoicePositionsManager;
     this.termPositionsManager = termPositionsManager;
     this.positionsManager = positionsManager;
     this.termCostsManager = termCostsManager;
 }
Exemplo n.º 12
0
 public PrintController(IOrdersManager manager, IInvoicesManager invoicesManager,
                        IInvoiceStornosManager invoiceStornosManager, ITaxesManager taxesManager,
                        ITransportOrdersManager transportOrdersManager, IPrinterManager printerManager,
                        ITermsManager termsManager) :
     base()
 {
     this.taxesManager           = taxesManager;
     this.invoicesManager        = invoicesManager;
     this.invoiceStornosManager  = invoiceStornosManager;
     this.transportOrdersManager = transportOrdersManager;
     this.printerManager         = printerManager;
     this.termsManager           = termsManager;
     Manager = manager;
     FilterExpressionCreator = new FilterExpressionCreator();
 }
Exemplo n.º 13
0
 public PrintController(IOrdersManager manager, IInvoicesManager invoicesManager, 
     IInvoiceStornosManager invoiceStornosManager, ITaxesManager taxesManager,
     ITransportOrdersManager transportOrdersManager, IPrinterManager printerManager,
     ITermsManager termsManager) :
     base()
 {
     this.taxesManager = taxesManager;
     this.invoicesManager = invoicesManager;
     this.invoiceStornosManager = invoiceStornosManager;
     this.transportOrdersManager = transportOrdersManager;
     this.printerManager = printerManager;
     this.termsManager = termsManager;
     Manager = manager;
     FilterExpressionCreator = new FilterExpressionCreator();
 }
Exemplo n.º 14
0
        public MemoryStream PrepareMonthInvoicePrintData(IEnumerable<Invoices> invoices, string path, IInvoicesManager invoicesManager, 
            ITaxesManager taxesManager, IOrdersManager ordersManager)
        {
            var result = new MemoryStream();
            try
            {
                Package pkg;
                PackagePart part;
                XmlReader xmlReader;
                XDocument xmlMainXMLDoc;
                GetXmlDoc(path, result, out pkg, out part, out xmlReader, out xmlMainXMLDoc);


                var temp = xmlMainXMLDoc.Descendants().LastOrDefault(o => o.Value.Contains("#CustomerName"));
                var parentElement = GetParentElementByName(temp, "<w:body ");
                var bodyText = String.Join("", parentElement.Elements());

                var templateBody = xmlMainXMLDoc.Root.ToString();
                bool firstElem = true;
                foreach (var invoice in invoices)
                {
                    if (!firstElem)
                    {
                        var index = templateBody.IndexOf("</w:body");
                        var pageBreak = @"<w:p w:rsidRDefault=""00C97ADC"" w:rsidR=""00C97ADC""><w:pPr><w:rPr><w:lang w:val=""en-GB""/></w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=""en-GB""/>
                            </w:rPr><w:br w:type=""page""/></w:r></w:p><w:p w:rsidRDefault=""009A5AB0"" w:rsidRPr=""00905C57"" w:rsidR=""009A5AB0"" w:rsidP=""0030272E"">
                            <w:pPr><w:rPr><w:lang w:val=""en-GB""/></w:rPr></w:pPr><w:bookmarkStart w:name=""_GoBack"" w:id=""0""/><w:bookmarkEnd w:id=""0""/></w:p>";
                        templateBody = templateBody.Substring(0, index) + pageBreak + bodyText + templateBody.Substring(index);
                    }
                    else
                    {
                        firstElem = false;
                    }

                    //replace fields
                    templateBody = ReplaceFields(ordersManager, 0, PrintTypes.Invoice, templateBody, invoicesManager, taxesManager, invoice);
                }

                xmlMainXMLDoc = SaveDoc(result, pkg, part, xmlReader, xmlMainXMLDoc, templateBody);
            }
            catch
            {
            }

            return result;
        }
 public DeleteAllOrderPositionsController(IOrdersManager manager, IPositionsManager positionManager)
 {
     this.manager         = manager;
     this.positionManager = positionManager;
 }
Exemplo n.º 16
0
 public OrdersController(IOrdersManager ordersManager)
 {
     _ordersManager = ordersManager;
 }
Exemplo n.º 17
0
 public MainForm(IOrdersManager ordersManager)
 {
     InitializeComponent();
     _ordersManager = ordersManager;
 }
Exemplo n.º 18
0
 public CourierController(ICourierManager courierManager, IOrdersManager ordersManager)
 {
     CourierManager = courierManager;
     OrderManager   = ordersManager;
 }
Exemplo n.º 19
0
 public OrderListViewModel(IOrdersManager ordersManager)
 {
     _orderManager = ordersManager;
     Update();
 }
Exemplo n.º 20
0
 public OrdersDetails(IOrdersManager _ordersManager)
 {
     InitializeComponent();
     this._ordersManager = _ordersManager;
 }
Exemplo n.º 21
0
 public OrdersController(IOrdersManager ordersManager, IValidateService validateService, ILogger <OrdersController> logger)
 {
     _ordersManager   = ordersManager;
     _validateService = validateService;
     _logger          = logger;
 }
 public DashboardsController(IInvoicesManager invoicesManager, IOrdersManager orderManager)
 {
     _invoicesManager = invoicesManager;
     _orderManager    = orderManager;
 }
Exemplo n.º 23
0
 public OrderDishController(IOrderDishesManager orderdishesManager, IDishesManager dishesManager, IOrdersManager ordersManager)
 {
     OrderDishManager = orderdishesManager;
     DishesManager    = dishesManager;
     OrderManager     = ordersManager;
 }
Exemplo n.º 24
0
 public CloseOrderController(IOrdersManager manager)
 {
     this.manager = manager;
 }
Exemplo n.º 25
0
 public CopyOrderController(IOrdersManager manager, IPositionsManager positionManager, IUniqueNumberProvider numberProvider)
 {
     this.manager = manager;
     this.positionManager = positionManager;
     this.numberProvider = numberProvider;
 }
Exemplo n.º 26
0
        public ProfitReportsController(IAdditionalCostsManager additionalCostsManager,
                                       IEmployeeRateRspManager employeeRateRspManager, IEmployeesManager employeeManager, IOrdersManager orderManager,
                                       IForeignProductsManager foreignProductsManager, IMaterialDeliveryRspManager materialDeliveryRspManager,
                                       ISocialTaxesManager socialTaxesManager, IInstrumentsManager instrumentsManager, IOwnProductsManager ownProductsManager,
                                       ITermPositionsManager termPositionsManager, IPositionsManager positionsManager, ITermCostsManager termCostsManager,
                                       ITaxesManager taxesManager, IInvoicesManager invoicesManager, IInterestsManager interestsManager, ITermsManager termsManager)
        {
            this.additionalCostsManager     = additionalCostsManager;
            this.employeeRateRspManager     = employeeRateRspManager;
            this.employeeManager            = employeeManager;
            this.orderManager               = orderManager;
            this.foreignProductsManager     = foreignProductsManager;
            this.ownProductsManager         = ownProductsManager;
            this.materialDeliveryRspManager = materialDeliveryRspManager;
            this.socialTaxesManager         = socialTaxesManager;
            this.instrumentsManager         = instrumentsManager;
            this.interestsManager           = interestsManager;

            this.termPositionsManager = termPositionsManager;
            this.positionsManager     = positionsManager;
            this.termCostsManager     = termCostsManager;
            this.taxesManager         = taxesManager;
            this.invoicesManager      = invoicesManager;
            this.termsManager         = termsManager;
        }
Exemplo n.º 27
0
 public DeliverersController(IDeliverersManager deliverersManager, IOrdersManager ordersManager)
 {
     this.deliverersManager = deliverersManager;
     this.ordersManager     = ordersManager;
 }
Exemplo n.º 28
0
 public CopyOrderController(IOrdersManager manager, IPositionsManager positionManager, IUniqueNumberProvider numberProvider)
 {
     this.manager         = manager;
     this.positionManager = positionManager;
     this.numberProvider  = numberProvider;
 }
Exemplo n.º 29
0
 public void SetUp()
 {
     _unitOfWork    = new Mock <IUnitOfWork>();
     _ordersManager = new OrdersManager(_unitOfWork.Object);
 }
Exemplo n.º 30
0
        public void CancelOrderTest(string symbol, string orderId)
        {
            IOrdersManager ordersManager = ((UNLManager)UNLManagerDic[symbol]).OrdersManager;

            ordersManager.CancelOrder(orderId);
        }
Exemplo n.º 31
0
        private MemoryStream PrepareCommonOrderPrintData(IOrdersManager ordersManager, int id, string path, PrintTypes type,
            IInvoicesManager invoicesManager, ITaxesManager taxesManager, IInvoiceStornosManager invoiceStornosManager = null,
            ITransportOrdersManager transportOrdersManager = null,
            ITermsManager termsManager = null)
        {
            var result = new MemoryStream();
            try
            {
                Package pkg;
                PackagePart part;
                XmlReader xmlReader;
                XDocument xmlMainXMLDoc;
                GetXmlDoc(path, result, out pkg, out part, out xmlReader, out xmlMainXMLDoc);


                var images = new List<Image>();

                if (type == PrintTypes.DeliveryNote)
                {
                    var term = termsManager.GetById(id);
                    for (var i = 0; i < term.DeliveryNoteSignatures.Count; i++)
                    {
                        var deliveryNoteSignature = term.DeliveryNoteSignatures.ElementAt(term.DeliveryNoteSignatures.Count - i - 1);
                        //TODO doesnt work ((
                        //pkg.CreateRelationship(uri, TargetMode.Internal,
                        //    "Http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
                        //    "barcodeImageId");


                        byte[] bytes = Convert.FromBase64String(deliveryNoteSignature.Signature.Replace("data:image/png;base64,", ""));

                        Image image;
                        using (MemoryStream ms = new MemoryStream(bytes))
                        {
                            image = Image.FromStream(ms);
                        }

                        images.Add(image);
                    }
                }

                //replace fields
                var templateBody = ReplaceFields(ordersManager, id, type, xmlMainXMLDoc.Root.ToString(),
                    invoicesManager, taxesManager, null, invoiceStornosManager, transportOrdersManager, termsManager, images);

                xmlMainXMLDoc = SaveDoc(result, pkg, part, xmlReader, xmlMainXMLDoc, templateBody);

                InsertImages(result, images);

                var doc = new Spire.Doc.Document();
                doc.LoadFromStream(result, Spire.Doc.FileFormat.Docx);
                doc.JPEGQuality = 100;

                result = new MemoryStream();
                doc.SaveToStream(result, Spire.Doc.FileFormat.PDF);
            }
            catch
            {
            }

            return result;
        }
Exemplo n.º 32
0
 public TransactionsController(ApiContext context, UserManager <User> userManager, IOrdersManager ordersManager) :
     base(context, userManager)
 {
     _ordersManager = ordersManager;
 }
Exemplo n.º 33
0
        private string ReplaceFields(IOrdersManager ordersManager, int id, PrintTypes printType, string xmlMainXMLDoc,
            IInvoicesManager invoicesManager, ITaxesManager taxesManager, Invoices invoice = null,
            IInvoiceStornosManager invoiceStornosManager = null,
            ITransportOrdersManager transportOrdersManager = null,
            ITermsManager termsManager = null, 
            IEnumerable<Image> images = null)
        {
            string result = xmlMainXMLDoc;

            switch (printType)
            {
                case PrintTypes.Order:
                    var order = ordersManager.GetById(id);
                    result = ReplaceCommonFields(order, result);
                    result = ReplaceBaseOrderFields(order, result);

                    result = result.Replace("#SignatureDate", order.CreateDate.AddDays(2).ToShortDateString());

                    result = ReplaceRentPositions(order, result, taxesManager);
                    result = ReplaceTotalPrice(order, result, taxesManager);
                    result = ReplaceRentAdditionalCostPositions(order, result);
                    break;
                case PrintTypes.Offer:
                    order = ordersManager.GetById(id);
                    result = ReplaceCommonFields(order, result);
                    result = ReplaceBaseOfferFields(order, result);
                    result = ReplaceBaseOrderFields(order, result);
                    result = ReplaceRentPositions(order, result, taxesManager);
                    result = ReplaceRentAdditionalCostPositions(order, result);
                    break;
                case PrintTypes.Invoice:

                    if (invoice == null)
                    {
                        invoice = invoicesManager.GetById(id);
                    }

                    order = invoice.Orders;

                    result = ReplaceCommonFields(order, result);
                    result = ReplaceBaseOrderFields(order, result);
                    result = ReplaceBaseInvoiceFields(invoice, result, printType);

                    bool manualPricePrinted = false;
                    result = ReplaceInvoicePositions(invoice, invoice.InvoicePositions.ToList(), result,
                        "#PositionDescription", "#PositionPrice", "Leistungen: ", ref manualPricePrinted);

                    result = ReplaceInvoicePrices(invoice, result);
                    break;
                case PrintTypes.InvoiceStorno:

                    var invoiceStorno = invoiceStornosManager.GetById(id);
                    invoice = invoiceStorno.Invoices;
                    order = invoice.Orders;

                    result = ReplaceCommonFields(order, result);
                    result = ReplaceBaseOrderFields(order, result);
                    result = ReplaceBaseInvoiceFields(invoice, result, printType);
                    result = ReplaceInvoiceStornoPrices(invoiceStorno, result);

                    result = ReplaceFieldValue(result, "#FreeText", invoiceStorno.FreeText);

                    break;
                case PrintTypes.ReminderMail:

                    invoice = invoicesManager.GetById(id);
                    order = invoice.Orders;

                    result = ReplaceCommonFields(order, result);
                    result = ReplaceReminderPositions(invoice.InvoicePositions.ToList(), result);
                    result = ReplaceReminderTotalPrice(invoice, result, taxesManager);

                    break;
                case PrintTypes.DeliveryNote:

                    var term = termsManager.GetById(id);
                    result = ReplaceCommonFields(term.Orders, result);
                    result = ReplaceBaseOrderFields(term.Orders, result);

                    result = result.Replace("#DeliveryNoteType", "Lieferschein");
                    result = result.Replace("#DateType", "Liefertermin");
                    result = result.Replace("#AdressType", "Lieferanschrift");
                    result = result.Replace("#OrderNumber", term.Orders.OrderNumber);
                    
                    result = ReplacePositionWithDescription(term, result);


                    if (term.DeliveryNoteSignatures.Count != 0)
                    {
                        var doc = XDocument.Parse(result);
                        var signatureElement = doc.Descendants().FirstOrDefault(o => o.Value.Equals("#Signature",
                            StringComparison.InvariantCultureIgnoreCase));

                        if (signatureElement != null && images != null && images.Count() != 0)
                        {
                            var currentElement = signatureElement;
                            for (var i = 0; i < images.Count(); i++)
                            {
                                var image = images.ElementAt(images.Count() - i - 1);
                                //TODO doesnt work ((
                                //pkg.CreateRelationship(uri, TargetMode.Internal,
                                //    "Http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
                                //    "barcodeImageId");
                                
                                //insert image
                                XmlElement tagDrawing = GetImageTag(image.Width, image.Height,
                                    term.DeliveryNoteSignatures.Count - i);

                                signatureElement.AddAfterSelf(XDocument.Parse(tagDrawing.InnerXml).Root);
                            }

                            signatureElement.Remove();
                            result = doc.Root.ToString();
                        }
                        else
                        {
                            result = result.Replace("#Signature", String.Empty);
                        }
                    }
                    else
                    {
                        result = result.Replace("#Signature", String.Empty);
                    }

                    break;
                default:
                    throw new NotImplementedException();
            }

            return result;
        }
Exemplo n.º 34
0
 public MainWindow(IOrdersManager orderManager)
 {
     _orderManager  = orderManager;
     _orderListView = new OrderListViewModel(_orderManager);
     InitializeComponent();
 }
Exemplo n.º 35
0
 public MemoryStream PrepareOfferPrintData(int id, string path, ITaxesManager taxesManager, IOrdersManager ordersManager)
 {
     return PrepareCommonOrderPrintData(ordersManager, id, path, PrintTypes.Offer, null, taxesManager);
 }
 public DeleteAllOrderPositionsController(IOrdersManager manager, IPositionsManager positionManager)
 {
     this.manager = manager;
     this.positionManager = positionManager;
 }
Exemplo n.º 37
0
 public MemoryStream PrepareInvoiceStornoPrintData(int id, string path, IInvoiceStornosManager invoiceStornosManager, IOrdersManager ordersManager)
 {
     return PrepareCommonOrderPrintData(ordersManager, id, path, PrintTypes.InvoiceStorno, null, null, invoiceStornosManager);
 }
Exemplo n.º 38
0
 public OrdersAppService(IOrdersManager ordersManager)
 {
     _ordersManager = ordersManager;
 }
Exemplo n.º 39
0
 public OffersController(IOrdersManager manager, ICustomersManager customerManager, IUniqueNumberProvider numberProvider)
 {
     this.manager         = manager;
     this.customerManager = customerManager;
     this.numberProvider  = numberProvider;
 }
Exemplo n.º 40
0
 public CloseOrderController(IOrdersManager manager)
 {
     this.manager = manager;
 }
Exemplo n.º 41
0
 public CustomerLoginController(ICustomerLoginsManager customerloginsManager, IOrdersManager ordersManager, IOrderDishesManager orderDishesManager)
 {
     CustomerLoginManager = customerloginsManager;
     OrdersManager        = ordersManager;
     OrderDishesManager   = orderDishesManager;
 }