Esempio n. 1
0
 private void btnOpenAPI_Click(object sender, RoutedEventArgs e)
 {
     try {
         this.Cursor = Cursors.Wait;
         APIEngine.Initialize(cmbApp.Text, txtCompany.Text, true);
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message, Application.Current.MainWindow.Title, MessageBoxButton.OK, MessageBoxImage.Error);
     }
     finally {
         this.Cursor = Cursors.Arrow;
     }
 }
Esempio n. 2
0
 private void btnOpenCompany_Click(object sender, EventArgs e)
 {
     try {
         if (APIEngine.APIInitialized)
         {
             MessageBox.Show("API Is already initialized. Close if first", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         APIEngine.Initialize(cmbAppCode.Text, txtCompanyID.Text, true);
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Esempio n. 3
0
        private void btnAbrirEmpresa_Click(object sender, EventArgs e)
        {
            try {
                //this.Cursor = Cursors.WaitCursor;
                APIEngine.WarningError   += S50cAPIEngine_WarningError;
                APIEngine.WarningMessage += S50cAPIEngine_WarningMessage;

                var productCode = cmbApplicationCode.Text;
                var companyId   = txtEmpresaNome.Text.Trim();
                //Inicia a API na empresa com o nome "Empresa", tal como existe na Área de Sistema
                APIEngine.Initialize(productCode, companyId, false);
                txtTransDate.Text = DateTime.Today.ToShortDateString();
                btnCriar.Enabled  = true;
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            //Config. Connect to Database
            string ProductCode = "CRTL";
            string CompanyID   = "EMPRESA";
            bool   Isdebug     = true;

            try {
                //Inicialize API
                APIEngine.Initialize(ProductCode, CompanyID, Isdebug);
            }
            catch (Exception ex) {
                Console.Error.Write(ex.Message);
            }

            if (APIEngine.APIInitialized)
            {
                //1º  stock entry
                //ES : 10 7UPs | 10 TARAS
                //StockTransactionSave();

                //2º Purchase
                //FS: 20 7UPs | 20 TARAS
                //ItemTransactionSavePurchase();

                //3º Sale
                //FS: 5 7UPs | 5 TARAS
                ItemTransactionSaveSale();

                //4º Sale sale with returnable return
                //FS: 5 7UPs | 5 TARAS
                //ItemTransactionSaveSaleWithReturnOfReturnable();
            }

            //Terminate API
            APIEngine.Terminate();
        }