Ejemplo n.º 1
0
        public DTCBS_Switch ViewSwitch(string tungay,string denngay)
        {
            string strSQL,ConnectStr ;
            DTCBS_Switch DSWitch =new DTCBS_Switch();
            try
            {

                //----------------------------SQL truy van cac giao dich trong ngay tren tung may ATM-------------------------
                //a.processing_code as TypeTrans,
                strSQL="select to_char(a.card_number) as cardnbr, a.account_number as acctnbr, a.transaction_amount as tranamt,c.aut_iso_43 as ATM, a.transaction_local_date as localtime,a.trace_audit_number as systrace ";
                strSQL+=" from autho_activity a , pg_automates c";
                strSQL+=" where a.code_action ='000'";
                strSQL+=" and a.message_type = '1200'";
                strSQL+=" and substr(a.card_acceptor_term_id,1,4) = c.aut_numlogique";
                strSQL+=" and substr(a.processing_code,1,2) = '17'";
                strSQL+=" and a.date_create>= to_date('" + tungay + "','yyyy-mm-dd HH24:MI')";
                strSQL+=" and a.date_create <= to_date('" + denngay + "','yyyy-mm-dd HH24:MI')";
                strSQL+=" and not exists (select *";
                strSQL+=" from autho_activity b";
                strSQL+=" where b.card_number = a.card_number";
                strSQL+=" and b.reference_number = a.reference_number";
                strSQL+=" and b.code_action = '000'";
                strSQL+=" and b.message_type = '1420')";

                //-------------------------------End of SQL--------------------------------------------------------------------

                //oleDbConnection1.ConnectionString="Provider=OraOLEDB.Oracle.1;User ID=acbprod;Password=acbprod1;Data Source=Electra.world;Extended Properties=;Persist Security Info=False";

                System.IO.StreamReader str=new System.IO.StreamReader("ConnectStr.txt");
                ConnectStr=str.ReadLine();
                str.Close();
                ConnectStr = ConnectStr.Substring(0, 44) + FrmMain.pass + ConnectStr.Substring(44, 74);
                oleDbConnection1.ConnectionString=ConnectStr;
                oleDbConnection1.Open();
                oleDbDataAdapter1.SelectCommand.CommandText=strSQL;
                oleDbDataAdapter1.SelectCommand.ExecuteNonQuery();
                oleDbDataAdapter1.Fill(DSWitch.Tables["Switch"]);
                oleDbConnection1.Close();
                return DSWitch;
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return DSWitch;
        }
Ejemplo n.º 2
0
        public DTCBS_Switch ViewTCBS(string tungay,string denngay)
        {
            string strSQL,ConnectStr ;
            DTCBS_Switch DSTCBS =new DTCBS_Switch();
            try
            {

                //----------------------------SQL truy van cac giao dich trong ngay tren tung may ATM-------------------------
                strSQL="select a.cardnbr as cardnbr, a.fromacctnbr as acctnbr,a.tranamount as tranamt, a.merchantname as ATM, a.datelastmaint as localtime,substr(IN_MESSAGE,76,6) as systrace ";
                strSQL+=" from card_transaction_atm a";
                strSQL+=" where a.transactiontypcd='ACW'";
                strSQL+=" and a.currstatuscd = 'OK'";
                strSQL+=" and a.datelastmaint >=to_date('" + tungay + "','yyyy-mm-dd HH24:MI')";
                strSQL+=" and a.datelastmaint <= to_date('" + denngay + "','yyyy-mm-dd HH24:MI')";

                //-------------------------------End of SQL--------------------------------------------------------------------

                //oleDbConnection1.ConnectionString="Provider=OraOLEDB.Oracle.1;User ID=acbprod;Password=acbprod1;Data Source=Electra.world;Extended Properties=;Persist Security Info=False";

                System.IO.StreamReader str=new System.IO.StreamReader("ConnectStrTCBS.txt");
                ConnectStr=str.ReadLine();
                str.Close();

                oleDbConnection2.ConnectionString=ConnectStr;
                oleDbConnection2.Open();
                oleDbDataAdapter2.SelectCommand.CommandText=strSQL;
                oleDbDataAdapter2.SelectCommand.ExecuteNonQuery();
                oleDbDataAdapter2.Fill(DSTCBS.Tables["TCBS"]);
                oleDbConnection2.Close();
                return DSTCBS;
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return DSTCBS;
        }