Exemplo n.º 1
0
        public Plugin()
        {
            _pluginWord = new KD.Plugin.Word.Plugin();

            KD.Plugin.Word.Config config = new KD.Plugin.Word.Config(_pluginWord.CurrentAppli, _pluginWord.CurrentAppli.Language);

            assemblyName = System.IO.Path.GetFileName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            try
            {
                string myselfPath     = System.Reflection.Assembly.GetExecutingAssembly().Location;
                string myselfDir      = System.IO.Path.GetDirectoryName(myselfPath);
                string userConfigPath = System.IO.Path.Combine(myselfDir, assemblyName);

                config.ConfigurationFile = System.Configuration.ConfigurationManager.OpenExeConfiguration(userConfigPath);
            }
            catch (System.Exception)
            {
                return;
            }

            if (!config.ContainsKey(ConstConfig.TechnicalPlanSchmidtMenuItem))
            {
                return;
            }

            bool bTechnicalPlanSchmidtMenuItem = config.GetBooleanConfigValue(ConstConfig.TechnicalPlanSchmidtMenuItem);

            if (bTechnicalPlanSchmidtMenuItem & System.IO.Directory.Exists(KD.Plugin.Word.TechnicalPlan.TechnicalPlanTemplateDocumentDirectory))
            {
                this.InitializeTechnicalPlan();
                this.InitializeMenuItem();
            }
        }
        public TechnicalPlanDocumentFileNameForm(KD.Plugin.Word.Plugin pluginWord, Dico dico)
        {
            InitializeComponent();

            _pluginWord = pluginWord;
            _dico       = dico;

            this.InitializeForm();
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public Plugin()
        {
            SyncfusionLicenseProvider.RegisterLicense("MjA5MzE3QDMxMzcyZTM0MmUzMGxVK0UwczN4TGVQNXhubno4S1Vaby9KN2dweTZWM0lGUEJRZmJUQVVDaDA9");
            SyncfusionLicenseProvider.RegisterLicense("MjA5MzE4QDMxMzcyZTM0MmUzMFFQLzZkWG5WSWprOVl4SmpCOHZsQ0JZaWg1Y3ZGdVB1bERKdFdHWHRFMmc9");

            pluginWord = new KD.Plugin.Word.Plugin();

            this.InitConfig();

            Plugin.TemplateDocumentDirectory = keyValueConfigurationCollection[ConstRessourceNames.TemplateDocumentDirectory].Value;
            Plugin.TemplateDocumentDirectory = TemplateDocumentDirectory.Replace(ConstRessourceNames.ConfigDocDir, this.GetDocDirDirectory());

            Plugin.TechnicalPlanLayer = keyValueConfigurationCollection[ConstRessourceNames.TechnicalPlanLayer].Value;

            this.InitializeDico();
            this.InitializeMenuItem();

            TechnicalDocument.Dico.Add((int)KD.SDK.SceneEnum.ViewMode.UNKNOWN, _dico.GetTranslate(TranslateIdentifyId.Unknown_ID));                     //
            TechnicalDocument.Dico.Add((int)KD.SDK.SceneEnum.ViewMode.VECTELEVATION, _dico.GetTranslate(TranslateIdentifyId.Elevation_ID));             //Elevation
            TechnicalDocument.Dico.Add((int)KD.SDK.SceneEnum.ViewMode.TOP, _dico.GetTranslate(TranslateIdentifyId.Top_ID));                             //Dessus
            TechnicalDocument.Dico.Add((int)KD.SDK.SceneEnum.ViewMode.VECTELEVATION + 100, _dico.GetTranslate(TranslateIdentifyId.WallElevation_ID));   //Elévation du mur...nb
            TechnicalDocument.Dico.Add((int)KD.SDK.SceneEnum.ViewMode.TOP + 100, _dico.GetTranslate(TranslateIdentifyId.TopView_ID));                   //Vue de dessus
            TechnicalDocument.Dico.Add((int)KD.SDK.SceneEnum.ViewMode.VECTELEVATION + 200, _dico.GetTranslate(TranslateIdentifyId.SymbolElevation_ID)); //Elévation...nb (Elevation symbol)

            PageOrientationSubItem.Dico.Add((int)System.Printing.PageOrientation.Unknown, _dico.GetTranslate(TranslateIdentifyId.Unknown_ID));
            PageOrientationSubItem.Dico.Add((int)System.Printing.PageOrientation.Landscape, _dico.GetTranslate(TranslateIdentifyId.Landscape_ID));
            PageOrientationSubItem.Dico.Add((int)System.Printing.PageOrientation.Portrait, _dico.GetTranslate(TranslateIdentifyId.Portrait_ID));

            PageMediaSizeNameSubItem.Dico.Add((int)System.Printing.PageMediaSizeName.Unknown, _dico.GetTranslate(TranslateIdentifyId.Unknown_ID));
            PageMediaSizeNameSubItem.Dico.Add((int)System.Printing.PageMediaSizeName.ISOA3, _dico.GetTranslate(TranslateIdentifyId.ISOA3_ID));
            PageMediaSizeNameSubItem.Dico.Add((int)System.Printing.PageMediaSizeName.ISOA4, _dico.GetTranslate(TranslateIdentifyId.ISOA4_ID));

            ScaleFactorSubItem.Dico.Add(SubItemsConst.scaleFactorUnknown, _dico.GetTranslate(TranslateIdentifyId.Unknown_ID));
            ScaleFactorSubItem.Dico.Add(SubItemsConst.scaleFactor1_20, _dico.GetTranslate(TranslateIdentifyId._1_20_ID));
            ScaleFactorSubItem.Dico.Add(SubItemsConst.scaleFactor1_25, _dico.GetTranslate(TranslateIdentifyId._1_25_ID));
            ScaleFactorSubItem.Dico.Add(SubItemsConst.scaleFactor1_50, _dico.GetTranslate(TranslateIdentifyId._1_50_ID));
            ScaleFactorSubItem.Dico.Add(SubItemsConst.scaleFactorAuto, _dico.GetTranslate(TranslateIdentifyId.Auto_ID));
        }
Exemplo n.º 5
0
        /// <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);
        }