Beispiel #1
0
        private void InitMembers()
        {
            appli     = null;
            reference = null;

            this.DisposeAllCSVFile();

            sectionCSVManage   = null;
            blockCSVManage     = null;
            articleCSVManage   = null;
            translateCSVManage = null;

            sceneInfo              = null;
            catalogFilePath        = String.Empty;
            catalogFileName        = String.Empty;
            catalogFileDir         = String.Empty;
            this.Status_TSPB.Value = 0;
            this.Status_TSSL.Text  = KD.StringTools.Const.Zero + KD.StringTools.Const.WhiteSpace + KD.StringTools.Const.Percent;

            spaceIniFile = new KD.Config.IniFile(spaceIniPath);
            kdsdkIniFile = new KD.Config.IniFile(kdsdkIniPath);

            exportDir = spaceIniFile.ReadValue(MainForm.SectionExport, KD.CatalogProperties.Const.KeyDir);
            this.SaveFilesDirectory_TBX.Text = exportDir;
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public string GetNextOrdersNumberHex()
        {
            string nextOrderNumber = ordersIniFile.ReadValue(FileEDI.numberSection, FileEDI.nextKey);

            int.TryParse(nextOrderNumber, out int value);
            string valueHex  = value.ToString("X");
            string valueHexa = String.Empty;

            for (int i = 0; i < (8 - valueHex.Length); i++)
            {
                valueHexa += KD.StringTools.Const.Zero;
            }
            return(valueHexa + valueHex);
        }