コード例 #1
0
        public string CreateJDBCDataSourceXml(Ctx ctx, string DBResourceName, int RecordID)
        {
            List <Document> obj     = new List <Document>();
            string          orgName = "Org Name";

            if (RecordID > 0)
            {
                MVA009Batch            batch        = new MVA009Batch(ctx, RecordID, null);
                MVA009BatchLineDetails batchDetails = null;
                MVA009PaymentMethod    paymthd      = null;
                string  sql = @"SELECT bd.VA009_BatchLineDetails_ID
                                FROM VA009_BatchLineDetails bd
                                INNER JOIN va009_batchlines bl
                                ON bl.va009_batchlines_id= bd.va009_batchlines_id
                                WHERE VA009_Batch_ID =" + RecordID;
                DataSet dsb = DB.ExecuteDataset(sql);
                if (dsb != null && dsb.Tables[0].Rows.Count > 0)
                {
                    DataSet dsbnk = null;
                    for (int x = 0; x < dsb.Tables[0].Rows.Count; x++)
                    {
                        batchDetails = new MVA009BatchLineDetails(ctx, Util.GetValueOfInt(dsb.Tables[0].Rows[x]["VA009_BatchLineDetails_ID"]), null);
                        paymthd      = new MVA009PaymentMethod(ctx, batchDetails.GetVA009_PaymentMethod_ID(), null);
                        Document dataobj = new Document();
                        dataobj.PaymentID     = Util.GetValueOfInt(batchDetails.GetVA009_BatchLineDetails_ID());
                        dataobj.PaymentMethod = paymthd.GetVA009_Name();
                        dataobj.DueAmt        = batchDetails.GetDueAmt();
                        dataobj.currency      = Util.GetValueOfString(DB.ExecuteScalar("SELECT iso_code FROM c_currency WHERE c_currency_id = " + batchDetails.GetC_Currency_ID()));
                        dataobj.Org           = Util.GetValueOfString(DB.ExecuteScalar("SELECT name FROM ad_org WHERE ad_org_id = " + batchDetails.GetAD_Org_ID()));
                        dsbnk = DB.ExecuteDataset("SELECT b.RoutingNo,  ac.IBAN FROM C_Bank b INNER JOIN C_bankaccount ac ON b.c_bank_id= ac.c_bank_id where ac.c_bankaccount_id =" + batch.GetC_BankAccount_ID());
                        if (dsbnk != null && dsbnk.Tables[0].Rows.Count > 0)
                        {
                            dataobj.IBAN = Util.GetValueOfString(dsbnk.Tables[0].Rows[0]["IBAN"]);
                            dataobj.BIC  = Util.GetValueOfString(dsbnk.Tables[0].Rows[0]["RoutingNo"]);
                        }
                        orgName = dataobj.Org;
                        obj.Add(dataobj);
                    }
                }
            }
            //Get DataBase Details of Vienna Advantage Framework
            string      filePath = "";
            VConnection conn     = new VConnection();

            conn.SetAttributes(DBConn.CreateConnectionString());
            DataSet ds = new DataSet();

            if (conn.Db_Type == "Oracle")
            {
                #region commented
                //Document obj = new Document();
                //obj.AccountName = "Manjot";
                //obj.AccountNo = "1001";
                //objJDBC.exportedWithPermissions = "false";
                //objJDBC.folder = "/organizations";
                //objJDBC.name = DBResourceName;
                //objJDBC.version = "0";
                //objJDBC.label = DBResourceName;
                //objJDBC.creationDate = DateTime.Now.ToString("O");
                //objJDBC.updateDate = DateTime.Now.ToString("O");
                //objJDBC.driver = "tibcosoftware.jdbc.oracle.OracleDriver";
                //objJDBC.connectionUrl = "jdbc:tibcosoftware:oracle://" + conn.Db_host + ";SID=" + conn.Db_name;
                //objJDBC.connectionUser = conn.Db_uid;
                //objJDBC.connectionPassword = conn.Db_pwd;
                //objJDBC.timezone = "";
                #endregion

                filePath = XmlCreater(obj, true, DBResourceName, orgName);
                return(filePath);
            }
            return(filePath);
        }