Esempio n. 1
0
        public Customer()
        {
            try
            {
                mBCCustomer = ConfigurationManager.AppSettings["CustomerLoginName"].ToString();
                //mBCUserName = ConfigurationManager.AppSettings["UserLoginName"].ToString();
                //mBCPassword = ConfigurationManager.AppSettings["Password"].ToString();
                mBCLanguage = ConfigurationManager.AppSettings["Language"].ToString();
                mBCPackage = ConfigurationManager.AppSettings["PackageName"].ToString();
                mBCReportType = ConfigurationManager.AppSettings["ReportType"].ToString();
            }
            catch { }

            try
            {
                app = new Garp.Application();

                mTA = app.Tables.Item("TA");
                mTA_TX1 = mTA.Fields.Item("TX1");

                if (mTA.Find("W100FU" + app.User.Trim()))
                {
                    if (noNULL(mTA_TX1.Value).Contains(";"))
                    {
                        string[] s = mTA_TX1.Value.Split(';');
                        mBCUserName = s[0];
                        mBCPassword = s[1];
                    }
                }

                oComp = app.Components;
                dsKA = app.Datasets.Item("McDataSet1");
                oComp.BaseComponent = "Panel1";

                if (!string.IsNullOrEmpty(mBCUserName))
                {
                    createButton();

                    oComp.Item("McText1").Width = oComp.Item("McText1").Width + 5;
                    dsKA.BeforePost += new Garp.IDatasetEvents_BeforePostEventHandler(dsKA_BeforePost);
                    dsKA.AfterScroll += new Garp.IDatasetEvents_AfterScrollEventHandler(dsKA_AfterScroll);
                    app.ButtonClick += new Garp.IGarpApplicationEvents_ButtonClickEventHandler(app_ButtonClick);
                }

                //                ctx = new DataImport2SoapClient("DataImport2Soap");

            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
        public Purchase()
        {
            mGarp = new Garp.Application();

            mIGA = new GarpGenericDB("IGA");
            mIGK = new GarpGenericDB("IGK");
            mHIA = new GarpGenericDB("HIA");
            mLR = new GarpGenericDB("LR");

            dsIGR = mGarp.Datasets.Item("igrMcDataSet");
            dsIGR.AfterScroll += new Garp.IDatasetEvents_AfterScrollEventHandler(dsIGR_AfterScroll);
            dsIGR.BeforePost += new Garp.IDatasetEvents_BeforePostEventHandler(dsIGR_BeforePost);
            mGarp.ButtonClick += new Garp.IGarpApplicationEvents_ButtonClickEventHandler(mGarp_ButtonClick);

            mInvoiceButton = mGarp.Components.AddButton("Invoice");
            mInvoiceButton.Top = 3;
            mInvoiceButton.Left = 550;
            mInvoiceButton.Text = "Fakturanr";
        }