public bool ProcessOrder(int callParamsBlock) { _pluginWord = new KD.Plugin.Word.Plugin(); orderInformations = new OrderInformations(this.CurrentAppli, callParamsBlock); string supplierName = orderInformations.GetSupplierName(); string generateOrder = Order._pluginWord.CurrentAppli.Scene.SceneGetCustomInfo(OrderKey.GenerateOrder); string supplierEmail = Order._pluginWord.CurrentAppli.Scene.SceneGetCustomInfo(OrderKey.SupplierEmail); if (!String.IsNullOrEmpty(supplierEmail)) { orderInformations.SetSupplierEmail(supplierEmail); } if (!String.IsNullOrEmpty(generateOrder)) { bool.TryParse(generateOrder, out bool isGenerateOrder); if (isGenerateOrder) { string retailerNumber = orderInformations.GetRetailerNumber(); Order.orderDir = orderInformations.GetOrderDir(); Order.rootOrderDir = orderInformations.GetRootOrderDir(); KD.Config.IniFile ordersIniFile = new KD.Config.IniFile(Path.Combine(Order.rootOrderDir, FileEDI.IniOrderFileName)); MainForm.EmailTo = ordersIniFile.ReadValue(Eancom.FileEDI.ediSection, Eancom.FileEDI.emailToKey + supplierName); MainForm.EmailCc = ordersIniFile.ReadValue(Eancom.FileEDI.ediSection, Eancom.FileEDI.emailCcKey + supplierName); MainForm.MandatoryDeliveryInformation = ordersIniFile.ReadValue(Eancom.FileEDI.ediSection, OrderKey.MandatoryDeliveryRetailerInformation + retailerNumber); string recipientAddresses = MainForm.EmailTo; // "[email protected];[email protected];[email protected]"; recipientAddresses = recipientAddresses.Replace(KD.StringTools.Const.SemiColon, KD.StringTools.Const.Comma); string ccAdress = MainForm.EmailCc; ccAdress = ccAdress.Replace(KD.StringTools.Const.SemiColon, KD.StringTools.Const.Comma); if (!String.IsNullOrEmpty(recipientAddresses)) { this.SendMail(recipientAddresses, ccAdress); return(true); } } } MessageBox.Show("La commande n'a pas été généré.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); return(true); }
/// <summary> /// The "GenerateOrder" function belonging to the "Order" class is the entry point of the supplier orders management module. /// If the DLL is selected in the "Computer file" option box corresponding to a supplier in the "Suppliers" dialog box, /// the following "GenerateOrder" function is called when the user generates an order for that supplier running /// the "File | Orders to suppliers | Generate". /// </summary> /// <param name="callParamsBlock"></param> /// <returns></returns> public bool GenerateOrder(int callParamsBlock) { _pluginWord = new KD.Plugin.Word.Plugin(); _pluginWord.InitializeAll(callParamsBlock); orderInformations = new OrderInformations(this.CurrentAppli, callParamsBlock); Order.rootOrderDir = orderInformations.GetRootOrderDir(); Order.orderDir = orderInformations.GetOrderDir(); Articles articles = SupplierArticleValidInScene(); orderInformationsFromArticles = new OrderInformations(this.CurrentAppli, callParamsBlock, articles); if (this.IsGenerateOrders(articles) && this.IsNotSameNumbers(articles)) { this.mainForm = new MainForm(orderInformations); this.Main(articles); //callParamsBlock Cursor.Current = Cursors.Arrow; return(true); } return(false); }
public BuildOrder(AppliComponent currentAppli, OrderInformations orderInformations) { _currentAppli = currentAppli; _orderInformations = orderInformations; }