private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                string lvskey = Businessbp.executedb.paymentKey;
                string chuoidong;
                CheckMD5 a = new CheckMD5();
                string fromtime = dtFrom.Text + " " + tbFh.Text + ":" + tbFm.Text + ":" + tbFs.Text;
                string totime = dtTo.Text + " " + tbTh.Text + ":" + tbTm.Text + ":" + tbTs.Text;
                string userid = Businessbp.executedb.Usrid;
                string name = " " + Businessbp.executedb.owner + "proc_OutPayment";
                string[] InParaName = new string[3] { "infromdate", "intodate", "inuserid" };
                string[] OutParaName = new string[1] { "outret" };
                OleDbType[] InParaType = new OleDbType[3] { OleDbType.VarChar, OleDbType.VarChar, OleDbType.VarChar };
                OleDbType[] OutParaType = new OleDbType[1] { OleDbType.Numeric };

                string[] InParaValues = new string[3] { fromtime, totime, userid };
                string[] OutParaValues = new string[1];
                for (int i = 0; i < 1; i++)
                    OutParaValues[i] = "";
                int[] OutParaSize = new int[1] { 0 };
                string err = "";
                Businessbp.executedb.ExecuteProcELECTRA(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err);
                if (err != "")
                    MessageBox.Show(err);
                else
                {
                    if (OutParaValues[0].ToString() == "-2")
                    {
                        MessageBox.Show("File already extract.", "Error",
                        MessageBoxButtons.OK, MessageBoxIcon.Error);

                    }
                    else if (OutParaValues[0].ToString() == "-1")
                    {
                        MessageBox.Show("Extract file dispute unsuccessful.", "Error",
                        MessageBoxButtons.OK, MessageBoxIcon.Error);

                    }
                    else
                    {
                        string sql = "";
                        err = "";
                        //folder += DateTime.Now.Month.ToString()+ DateTime.Now.Day.ToString()+ DateTime.Now.Year.ToString() + "_ISS_DISP_NAB970428.dat";
                        folder += "I_" + DateTime.Now.ToString("yyyyMMdd") + "_970428_DISPUTE.dat";
                        sql = "select p.strdispute" +
                              " from  " + Businessbp.executedb.owner + "banknet_payment_dispute p" +
                            //" where p.transaction_local_date >= to_date('" + fromtime + "'," + "'mm/dd/yyyy hh24:mi:ss'" + ")" +
                            //" and p.transaction_local_date <= to_date('" + totime + "'," + "'mm/dd/yyyy hh24:mi:ss'" + ")" +
                              " where p.effdate = trunc(sysdate)" +
                              " order by p.record_seq";
                        DataTable dt = Businessbp.executedb.getTable(sql, ref err);
                        if (err != "")
                            MessageBox.Show(err);
                        else
                        {
                            if (dt.Rows.Count > 0)
                            {
                                FileStream ft = new FileStream(folder, FileMode.Create, FileAccess.Write, FileShare.None);
                                StreamWriter tw = new StreamWriter(ft);
                                for (int i = 0; i < dt.Rows.Count; i++)
                                {
                                    chuoidong = dt.Rows[i][0].ToString();
                                    // thuc hien cong checksum dong vao cuoi
                                    chuoidong += a.GetCS(chuoidong, lvskey);
                                    // ghi vao file
                                    tw.WriteLine(chuoidong);

                                }
                                tw.Flush();
                                ft.Close();
                            }
                            //-------- Successful
                            MessageBox.Show("Extract file dispute successful.", "Exclamation",
                            MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        button2.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 public static string GetMD5(string F64_Pri)
 {
     CheckMD5 a = new CheckMD5();
     return a.GetCS(F64_Pri, Key);
 }
Example #3
0
 public static string Get_F128_Hash(string F128_Pri)
 {
     CheckMD5 a = new CheckMD5();
     return a.GetCS(F128_Pri, Key);
 }