Exemple #1
0
        private void btnCopDoc2_Click(object sender, EventArgs e)
        {
            Config.CopDoc cd = Config.getCopDoc[1];
            GarpGenericDB garp;
            Process copdoc = new Process();

            if (cd.Table.Equals("OGA"))
            {
                garp = new GarpGenericDB(cd.Table);

                // If we found the post searched for
                if (garp.find(txtONR.Text))
                {
                    cd.Arguments = cd.Arguments.Replace("{" + cd.Table + ";", "");
                    cd.Arguments = cd.Arguments.Replace(cd.Field + "}", "\"" + garp.getValue(cd.Field) + "\"");

                    copdoc.StartInfo.FileName = cd.Path;
                    copdoc.StartInfo.Arguments = cd.Arguments;
                    try
                    {
                        Log4Net.Logger.loggInfo("CopDoc started with following string: " + copdoc.StartInfo.FileName + " " + copdoc.StartInfo.Arguments, Config.User, "frmMain.btnCopDoc1_Click()");
                        copdoc.Start();
                    }
                    catch (Exception ex)
                    {
                        Log4Net.Logger.loggError(ex, "Error when starting CopDoc Path:" + cd.Path + " Arguments:" + cd.Arguments, Config.User, "frmMain.btnCopDoc1_Click");
                        MessageBox.Show(this, "Det gick inte att starta CopDoc", "CopDoc", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show(this, "Hittade inte den eftersökta patienten i Garp", "Patient hittades ej", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else if (cd.Table.Equals("KA"))
            {
                garp = new GarpGenericDB(cd.Table);

                // If we found the post searched for
                if (garp.find(txtKNR.Text))
                {
                    cd.Arguments = cd.Arguments.Replace("{" + cd.Table + ";", "");
                    cd.Arguments = cd.Arguments.Replace(cd.Field + "}", garp.getValue(cd.Field));

                    copdoc.StartInfo.FileName = cd.Path;
                    copdoc.StartInfo.Arguments = cd.Arguments;
                    try
                    {
                        copdoc.Start();
                    }
                    catch (Exception ex)
                    {
                        Log4Net.Logger.loggError(ex, "Error when starting CopDoc Path:" + cd.Path + " Arguments:" + cd.Arguments, Config.User, "frmMain.btnCopDoc1_Click");
                        MessageBox.Show(this, "Det gick inte att starta CopDoc", "CopDoc", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show(this, "Hittade inte den eftersökta patienten i Garp", "Patient hittades ej", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

            }
        }
        /// <summary>
        /// Saves information that is common for all rows on a AidId
        /// 
        /// </summary>
        private void saveCommonOrderRow(OrderRowDefinitions.OrderRow or, ref GarpGenericDB data)
        {
            data.find(or.OrderNo);
            data.next();

            while (data.getValue("ONR").Equals(or.OrderNo) && !data.EOF)
            {
                if ((getFormatedAidId(data.getValue("NX1")) == or.AidNr) && (!isEgenAvgift(data.getValue("ANR"))))
                {
                    fillCommonOrderRowFields(or, data);
                }
                data.next();
            }
        }
Exemple #3
0
        public PurchaseDefenitions[] getAllPurchaseOrders(string cust_onr)
        {
            GarpGenericDB IGA = new GarpGenericDB("IGA");
            GarpGenericDB IGF = new GarpGenericDB("IGF");
            GarpGenericDB LA = new GarpGenericDB("LA");
            PurchaseDefenitions purchase;
            ArrayList alPurchase = new ArrayList();

            IGF.first();

            while (!IGF.EOF)
            {
                if (GCF.noNULL(IGF.getValue("TX3")).StartsWith(cust_onr.Trim()))
                {
                    purchase = new PurchaseDefenitions();
                    purchase.IO_No = IGF.getValue("ONR").Trim();
                    purchase.CustomerOrderNo = IGF.getValue("TX3");

                    if (IGA.find(IGF.getValue("ONR")))
                    {
                        purchase.IO_Status = IGA.getValue("LEF");
                        purchase.SupplierNo = IGA.getValue("LNR");

                        if (LA.find(IGA.getValue("LNR")))
                            purchase.SupplierName = LA.getValue("NAM");
                    }
                    alPurchase.Add(purchase);
                }

                IGF.next();
            }
            return (PurchaseDefenitions[])alPurchase.ToArray(typeof(PurchaseDefenitions));
        }