Esempio n. 1
0
        private void ExportUI_Click(object sender, EventArgs e)
        {
            long quoteNumberReference = -1;

            ClipperApi.SelectQuoteUI(out quoteNumberReference);
            txtQuoteid.Text = quoteNumberReference.ToString();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            AlmaCamBinFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            ParamFolder      = AlmaCamBinFolder + @"\ActcutClipperExeParam"; // ActcutClipperExeParam : nom de sous répertoire imposé
            ParamFile        = ParamFolder + @"\Param.txt";                  // Nom du fichier contenant les commandes : nom imposé
            WorkFile         = ParamFolder + @"\Param.wrk";                  // Nom du fichier contenant les commandes : nom imposé
            ResultFile       = ParamFolder + @"\Result.txt";                 // Nom du fichier contenant les resultats : nom imposé

            if (Directory.Exists(ParamFolder) == false)
            {
                Directory.CreateDirectory(ParamFolder);
            }

            string[] arguments = Environment.GetCommandLineArgs();

            string action; string user; string db;
            long   quoteNumber; string orderNumber; string exportFile;

            GetParam(arguments, out action, out user, out db, out quoteNumber, out orderNumber, out exportFile);

            #region Init

            if (action == "Init" && db != null)
            {
                bool ret = Init(db, user);
                if (ret)
                {
                    File.WriteAllText(ResultFile, "Ok");
                    ManageCommand();
                }
                else
                {
                    File.WriteAllText(ResultFile, "Error");
                    Environment.ExitCode = -1;
                }
            }

            #endregion

            #region Export Quote

            else if (action == "ExportQuote" && db != null)
            {
                bool ret = Init(db, user);
                if (ret)
                {
                    bool status = ClipperApi.ExportQuote(quoteNumber, orderNumber, exportFile);
                    Environment.ExitCode = (status ? 0 : -1);
                }
                else
                {
                    Environment.ExitCode = -2;
                }
            }
            #endregion

            #region Get Quote

            else if (action == "SelectQuoteUI" && db != null)
            {
                bool ret = Init(db, user);
                if (ret)
                {
                    long quoteId;
                    bool status = ClipperApi.SelectQuoteUI(out quoteId);
                    Environment.ExitCode = (int)quoteId;
                }
                else
                {
                    Environment.ExitCode = -2;
                }
            }

            #endregion        }
        }