private void button1_Click(object sender, EventArgs e)
 {
     //pv_InputDir   IN VARCHAR2, --NAB_RECON_MC_INPUT
     //              pv_FileName   IN VARCHAR2,
     //              pv_ProcDir    IN VARCHAR2, --NAB_RECON_MC_PRO
     //              pv_user_create IN VARCHAR2,
     //              pv_Error_Desc OUT VARCHAR2
     this.Cursor = Cursors.WaitCursor;
     string[] InParaName = new string[4] { "pv_InputDir", "pv_FileName", "pv_ProcDir", "pv_user_create" };
     OracleType[] InParaType = new OracleType[4] { OracleType.VarChar, OracleType.VarChar, OracleType.VarChar, OracleType.VarChar };
     string[] InParaValues = new string[4] { patch, tbFileName.Text, proc, Businessbp.executedb.Usrid };
     string[] OutParaName = new string[1] { "pv_Error_Desc" };
     OracleType[] OutParaType = new OracleType[1] { OracleType.VarChar };
     int[] OutParaSize = new int[1] { 200 };
     OracleType reParaType = OracleType.Number;
     int reParaSize = 1;
     string[] OutParaValues = new string[1];
     string returnValue = "";
     string err = "";
     Businessbp.executedb.ExecuteFunc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, reParaType, reParaSize, ref OutParaValues, ref returnValue, ref err);
     this.Cursor = Cursors.Default;
     if (err != "")
         MessageBox.Show(err);
     else
     {
         if (returnValue == "1")
             tbStatus.Text = "Successfully .........";
         else
             tbStatus.Text = OutParaValues[0].ToString();
     }
 }
        internal OciLobLocator(OracleConnection connection, OracleType lobType)
        {
            this._connection = connection;
            this._connectionCloseCount = connection.CloseCount;
            this._lobType = lobType;
            this._cloneCount = 1;
            switch (lobType)
            {
                case OracleType.BFile:
                    this._descriptor = new OciFileDescriptor(connection.ServiceContextHandle);
                    break;

                case OracleType.Blob:
                case OracleType.Clob:
                case OracleType.NClob:
                    this._descriptor = new OciLobDescriptor(connection.ServiceContextHandle);
                    return;

                case OracleType.Char:
                    break;

                default:
                    return;
            }
        }
Beispiel #3
0
 public static OracleParameter AddOutParamToSqlCommand(OracleCommand comm, string pName, OracleType pType)
 {
     OracleParameter param = new OracleParameter(pName, pType);
     param.Direction = ParameterDirection.Output;
     comm.Parameters.Add(param);
     return param;
 }
 private void button1_Click(object sender, EventArgs e)
 {
     string name = "";
     this.Cursor = Cursors.WaitCursor;
     name = Businessbp.executedb.owner + "MASTER_UPLOAD_BI.PROCESSING_MASTER_ISSUER_BI";
     //PROCESSING_MASTER_ISSUER_BI(p_Processing_Date varchar2)  RETURN NUMBER;
     string date_process = "", u_create = "";
     date_process = dateTimePicker1.Text;
     //daily(date_process in date, u_create varchar2, Emsg_out out varchar2) return number
     string[] InParaName = new string[1] { "p_Processing_Date"};
     OracleType[] InParaType = new OracleType[1] { OracleType.VarChar};
     string[] InParaValues = new string[1] { date_process };
     string[] OutParaName = new string[0] { };
     OracleType[] OutParaType = new OracleType[0] { };
     int[] OutParaSize = new int[0] {  };
     OracleType reParaType = OracleType.Number;
     int reParaSize = 1;
     string[] OutParaValues = new string[0];
     string returnValue = "";
     string err = "";
     Businessbp.executedb.ExecuteFunc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, reParaType, reParaSize, ref OutParaValues, ref returnValue, ref err);
     this.Cursor = Cursors.Default;
     if (err != "")
         MessageBox.Show(err);
     else
     {
         if (returnValue == "0")
           MessageBox.Show("Successfully .........");
         else
             MessageBox.Show("Not successfull. returnValue=" + returnValue);
     }
 }
    public static void Process(string in_type, string in_parameter,
        ref string Result_out, ref string Emsg_out, ref string out_parameter)
    {
        string err = "";
        const int count_inval = 2;
        const int count_outval = 3;
        string name = executedb.owner + "NAB_PROCESS_QUERY.Proc_Update_VIP_Flag";

        string[] InParaName = new string[count_inval] { "in_type", "in_parameter" };
        OracleType[] InParaType = new OracleType[count_inval] { OracleType.VarChar, OracleType.VarChar };
        string[] InParaValues = new string[count_inval] { in_type, in_parameter.ToString() };
        string[] OutParaName = new string[count_outval] { "Result_out", "Emsg_out", "out_parameter" };
        OracleType[] OutParaType = new OracleType[count_outval] { OracleType.VarChar, OracleType.VarChar, OracleType.VarChar };
        int[] OutParaSize = new int[count_outval] { 1, 1000, 9999 };
        string[] OutParaValues = new string[count_outval];
        err = "";

        executedb.ExecuteProc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err);
        //Businessbp.executedb.ExecuteFunc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, reParaType, reParaSize, ref OutParaValues, ref returnValue, ref err);
        if (err != "")
        {
            #region logError
            Result_out = "3";
            Emsg_out += "Error when call procedure:" + err;
            out_parameter = "";
            #endregion logError
        }
        else
        {
            Result_out = OutParaValues[0].ToString();
            Emsg_out = OutParaValues[1].ToString().ToString();
            out_parameter = OutParaValues[2].ToString();

        }
    }
        private void bt_Process_Click(object sender, EventArgs e)
        {
            string out_rc = "", out_msg_err = "";

            string name = Businessbp.executedb.owner + "nab_NQH.process_af_autopayment";
            string u_create = "";
            u_create = Businessbp.executedb.Usrid;
            string[] InParaName = new string[1] { "u_create" };
            OracleType[] InParaType = new OracleType[2] { OracleType.VarChar, OracleType.VarChar };
            string[] InParaValues = new string[1] { u_create };
            string[] OutParaName = new string[1] { "Emsg_out" };
            OracleType[] OutParaType = new OracleType[1] { OracleType.VarChar };
            int[] OutParaSize = new int[1] { 200 };
            OracleType reParaType = OracleType.Number;
            int reParaSize = 1;
            string[] OutParaValues = new string[1];
            string returnValue = "";
            string err = "";
            Businessbp.executedb.ExecuteFunc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, reParaType, reParaSize, ref OutParaValues, ref returnValue, ref err);
            if (err != "")
            {

                tbstatus.Text = err.ToString();
            }
            else
            {
                out_rc = OutParaValues[0].ToString();
                tbstatus.Text = out_rc;
            }
        }
Beispiel #7
0
        public static void AddParameter(string name, object value, OracleType oracleType, ParameterCollection parameters)
        {
            Parameter p = new Parameter("p" + name, oracleType);
            switch (oracleType)
            {
                case OracleType.DateTime:
                    p.ParameterValue = value == null ? DateTime.Now : value;
                    break;
                default:
                      if (value == null)
                    {
                        p.ParameterValue = string.Empty;
                    }
                    else
                    {
                        if (value.ToString() == "")
                        {
                            p.ParameterValue = string.Empty;
                        }
                        else
                        {
                            p.ParameterValue = value;
                        }
                    }

                    break;

            }
            parameters.Add(p);
        }
        //chuyển khoản từ thẻ prepaid sang prepaid
        public static string Transfer_P2P(string src_card_nbr, string dst_card_nbr, string amount, string narrative, string batch_nbr, string batch_date)
        {   //batch_date dd/MM/yyyy
            string type = "P2P";
            string result = "", msgstat = "TRUE", mcrrefnbr = "", err = "";
            const int count_inval = 6;
            const int count_outval = 1;
            string name = "nab_CNTT."+type;

            //P2P(from_card in varchar2, to_card varchar2, trn_amount number, content in varchar2, batch_number in varchar2, d_batch_dt varchar2, Emsg_out out varchar2) return number is
            string[] InParaName = new string[count_inval] { "from_card", "to_card", "trn_amount", "content", "batch_number", "d_batch_dt" };
            OracleType[] InParaType = new OracleType[count_inval] { OracleType.VarChar, OracleType.VarChar, OracleType.Number, OracleType.VarChar, OracleType.VarChar, OracleType.VarChar };
            string[] InParaValues = new string[count_inval] { src_card_nbr, dst_card_nbr, amount, narrative, batch_nbr, batch_date };
            string[] OutParaName = new string[count_outval] { "Emsg_out" };
            OracleType[] OutParaType = new OracleType[count_outval] { OracleType.VarChar };
            int[] OutParaSize = new int[count_outval] { 200 };

            OracleType reParaType = OracleType.Number;
            int reParaSize = 1;
            string[] OutParaValues = new string[1];
            string returnValue = "";
            err = "";
            Businessbp.executedb.ExecuteFunc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, reParaType, reParaSize, ref OutParaValues, ref returnValue, ref err);

            if (err != "")
            {
                msgstat = "FALSE";

                #region logError
                Businessbp.executedb.WriteLogERROR(HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"], MethodBase.GetCurrentMethod().DeclaringType.Name, System.Reflection.MethodBase.GetCurrentMethod().ToString(), "ExecuteFunc_" + type, "err --> " + err);
                #endregion logError
            }
            else
            {
                if (returnValue == "1")
                {
                    msgstat = "TRUE";
                    mcrrefnbr = OutParaValues[0].ToString();
                }
                else
                {
                    msgstat = "FALSE";
                    err = OutParaValues[0].ToString();

                    #region logError
                    Businessbp.executedb.WriteLogERROR(HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"], MethodBase.GetCurrentMethod().DeclaringType.Name, System.Reflection.MethodBase.GetCurrentMethod().ToString(), "ExecuteFunc_" + type, "err --> " + err);
                    #endregion logError
                }
            }

            result = "<msgstat>" + msgstat.Trim() + "</msgstat>";
            result += "<err>" + err.Trim() + "</err>";
            result += "<mcrrefnbr>" + mcrrefnbr.Trim() + "</mcrrefnbr>";

            #region logINFO
            Businessbp.executedb.WriteLogINFO(HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"], MethodBase.GetCurrentMethod().DeclaringType.Name, System.Reflection.MethodBase.GetCurrentMethod().ToString(), "Result --> " + result);
            #endregion logINFO

            return result;
        }
		public void AddParameter(OracleCommand command, string name, OracleType oracleType, int size,
			ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn,
			DataRowVersion sourceVersion, object value)
		{
			OracleParameter param = CreateParameter(name, DbType.AnsiString, size, direction, nullable, precision, scale, sourceColumn, sourceVersion, value) as OracleParameter;
			param.OracleType = oracleType;
			command.Parameters.Add(param);
		}
Beispiel #10
0
 /// <summary>
 /// 添加Oracle数据库存储过程的输出参数
 /// </summary>
 /// <param name="oracleType">数据类型</param>
 /// <param name="parameterName">参数名称</param>
 public void AddOutOracleCurSorPara(OracleType oracleType, string parameterName)
 {
     OutOracleCursorPara tt = new OutOracleCursorPara();
     tt.ParameterName = parameterName;
     tt.Oracletype = oracleType;
     tt.Parameterdirection = ParameterDirection.Output;
     cursorList.Add(tt);
 }
 public void AddParameter(string StrName, OracleType objType, ParameterDirection objDirection)
 {
     OracleParameter l_Param = new OracleParameter(StrName,objType);
     l_Param.ParameterName = StrName;
     l_Param.OracleType = objType;
     l_Param.Direction = objDirection;
     m_Command.Parameters.Add(l_Param);
 }
 internal OracleLob(OracleLob lob)
 {
     this._lobLocator = lob._lobLocator.Clone();
     this._lobType = lob._lobLocator.LobType;
     this._charsetForm = lob._charsetForm;
     this._currentPosition = lob._currentPosition;
     this._isTemporaryState = lob._isTemporaryState;
 }
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                string sql = "", err1 = "";
                DataTable dt;

                string name = Businessbp.executedb.owner + "proc_check88";

              //              proc_check88(
              //fromdate in varchar2,
              //todate in varchar2,
              //r_count out number,
              //Result_out out number,
              //Emsg_out out varchar2)
                string FromDate = "", ToDate = "";
                FromDate = dtFrom.Text + " " + tbFhh.Text + ":" + tbFmi.Text + ":" + tbFss.Text;
                ToDate = dtTo.Text + " " + tbThh.Text + ":" + tbTmi.Text + ":" + tbTss.Text;

                string[] InParaName = new string[2] { "fromdate", "todate" };
                string[] OutParaName = new string[3] { "r_count", "Result_out", "Emsg_out" };
                OracleType[] InParaType = new OracleType[2] { OracleType.VarChar, OracleType.VarChar };
                OracleType[] OutParaType = new OracleType[3] { OracleType.Number, OracleType.Number, OracleType.VarChar };

                string[] InParaValues = new string[2] { FromDate, ToDate };
                string[] OutParaValues = new string[3];
                for (int i = 0; i < 3; i++)
                    OutParaValues[i] = "";
                int[] OutParaSize = new int[3] { 0 , 0 , 300 };
                string err = "";
                Businessbp.executedb.ExecuteProcELECTRA(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err);
                if (err != "")
                    MessageBox.Show(err);
                else
                {
                    int r_count = Int32.Parse(OutParaValues[0].ToString());
                    int Result_out = Int32.Parse(OutParaValues[1].ToString());
                    string Emsg_out = OutParaValues[2].ToString();
                    if (Result_out != 1)
                    {
                        MessageBox.Show(Emsg_out);
                        return;
                    }
                    else
                    {
                        MessageBox.Show("Process successfull!!!");
                        LoadData();
                    }
                }
                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 public void AddParameter(string StrName, OracleType objType, ParameterDirection objDirection, int paramSize, object objValue)
 {
     OracleParameter l_Param = new OracleParameter(StrName, objType, paramSize);
     l_Param.ParameterName = StrName;
     l_Param.Size = paramSize;
     l_Param.OracleType = objType;
     l_Param.Direction = objDirection;
     m_Command.Parameters.Add(l_Param);
     ModifyParameter(StrName, objValue);
 }
        private void Process()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                string name = "";
                const int out_para = 2;
                name += "" + Businessbp.executedb.owner + "proc_nab_thucno";
                //string type = "Pre_Transaction_Upload";
                string in_parameter = "";

                string[] InParaName = new string[1] { "user_id" };
                string[] OutParaName = new string[out_para] { "Result_out", "Emsg_out" };
                OracleType[] InParaType = new OracleType[2] { OracleType.VarChar, OracleType.VarChar };
                OracleType[] OutParaType = new OracleType[out_para] { OracleType.Number, OracleType.VarChar};

                string[] InParaValues = new string[1] { Businessbp.executedb.Usrid };
                string[] OutParaValues = new string[out_para];
                for (int i = 0; i < out_para; i++)
                    OutParaValues[i] = "";
                int[] OutParaSize = new int[out_para] { 0, 500};
                string err = "";
                Businessbp.executedb.ExecuteProcELECTRA(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err);
                if (err != "")
                {
                    MessageBox.Show(err);
                    this.Cursor = Cursors.Default;
                    return;
                }
                else
                {
                    int Result_out = Int32.Parse(OutParaValues[0].ToString());
                    string Emsg_out = OutParaValues[1].ToString();
                    if (Result_out != 1)
                    {
                        MessageBox.Show(Emsg_out);
                        tbStatus.Text = Emsg_out;
                        this.Cursor = Cursors.Default;
                        return;
                    }
                    else
                    {
                        //Parse out_parameter nếu cần thiết
                        tbStatus.Text = "Successfull!!!";
                        MessageBox.Show("Successfull!!!");
                    }
                }
                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.Cursor = Cursors.Default;
            }
        }
        private void bt_Authorize_Click(object sender, EventArgs e)
        {
            string in_parameter = "";
            string err = "";
            string out_rc = "", out_msg_err = "", out_other_info = "";
            const int count_inval = 1;
            const int count_outval = 3;
            in_parameter = "";
            in_parameter += "<cr_account_number>" + acc.Trim() + "</cr_account_number>";
            in_parameter += "<user_id>" + Businessbp.executedb.Usrid + "</user_id>";

            string name = Businessbp.executedb.owner + "nab_installment.Abort_Installment";
            string[] InParaName = new string[count_inval] { "in_parameter" };
            OracleType[] InParaType = new OracleType[count_inval] { OracleType.VarChar };
            string[] InParaValues = new string[count_inval] { in_parameter };
            string[] OutParaName = new string[count_outval] { "out_rc", "out_msg_err", "out_other_info" };
            OracleType[] OutParaType = new OracleType[count_outval] { OracleType.VarChar, OracleType.VarChar, OracleType.VarChar };
            int[] OutParaSize = new int[count_outval] { 2, 100, 9999 };
            string[] OutParaValues = new string[count_outval];
            err = "";
            Businessbp.executedb.ExecuteProcELECTRA(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err);
            if (err != "")
            {
                MessageBox.Show(err);
            }
            else
            {
                out_rc = OutParaValues[0].ToString();
                out_msg_err = OutParaValues[1].ToString();
                out_other_info = OutParaValues[2].ToString();

                if (out_rc != "00")
                {
                    MessageBox.Show(out_msg_err);
                }
                else
                {
                    bt_Authorize.Enabled = false;
                    //Load_Data();
                    string batch_nbr = "";
                    batch_nbr = out_other_info.Substring(out_other_info.IndexOf("<batch_nbr>") + "<batch_nbr>".Length, out_other_info.IndexOf("</batch_nbr>") - (out_other_info.IndexOf("<batch_nbr>") + "<batch_nbr>".Length));
                    if (batch_nbr == "")
                    {
                        MessageBox.Show("No batch open!!");
                    }
                    else
                    {
                        Load_Data_After(batch_nbr);
                        lb_Success.Text = Count_Success_Fail(Int32.Parse(batch_nbr), "Y").ToString();
                        lb_Fail.Text = Count_Success_Fail(Int32.Parse(batch_nbr), "Z").ToString();
                        MessageBox.Show("Process Done!!!");
                    }
                }
            }
        }
        private void bt_Process_Click(object sender, EventArgs e)
        {
            string in_parameter = "";
            string err = "";
            string out_rc = "",out_msg_err="", out_other_info = "";
            const int count_inval = 1;
            const int count_outval = 3;
            //string transaction_amount = "", currency_code = "", billing_amount = "", periods = "", card_number = "", reference_number = "", trace = "", card_acceptor_term_id = "", user_id = "", transaction_local_date = "", content = "";
            #region Get_Parameter
            in_parameter = "";
            in_parameter += "<microfirm_ref_number>" + tb_Micro_Ref_No.Text.Trim() + "</microfirm_ref_number>";
            in_parameter += "<sequence_number>" + int.Parse(tb_Seq_No.Text.Trim()) + "</sequence_number>";
            in_parameter += "<client_code>" + tb_CIF.Text.Trim() + "</client_code>";
            in_parameter += "<user_id>" + user_id + "</user_id>";
            in_parameter += "<content>" + tb_Note.Text.Trim() + "</content>";
            in_parameter += "<periods>" + int.Parse(cb_Periods.Text.Trim()) + "</periods>";
            in_parameter += "<merchant>" + cbb_merchant.SelectedValue.ToString ( ).Trim ( ) + "</merchant><disrate>"; //2015-07-09 (1)
            in_parameter +=  tbDisrate.Text.Trim ( ) == "" ? "null" : tbDisrate.Text.Trim ( ) + "</disrate><disamt>";  //2016-07-27 (2)
            in_parameter +=  tbDisamt.Text.Trim ( ) == "" ? "null" : tbDisamt.Text.Trim ( ) + "</disamt>";  //2016-07-27 (2)

            #endregion Get_Parameter

            string name = Businessbp.executedb.owner + "nab_installment.Transfer_to_installment";
            string[] InParaName = new string[count_inval] { "in_parameter" };
            OracleType[] InParaType = new OracleType[count_inval] { OracleType.VarChar };
            string[] InParaValues = new string[count_inval] { in_parameter };
            string[] OutParaName = new string[count_outval] { "out_rc", "out_msg_err", "out_other_info" };
            OracleType[] OutParaType = new OracleType[count_outval] { OracleType.VarChar, OracleType.VarChar, OracleType.VarChar };
            int[] OutParaSize = new int[count_outval] { 2, 100, 9999 };
            string[] OutParaValues = new string[count_outval];
            err = "";
            Businessbp.executedb.ExecuteProcELECTRA(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err);
            if (err != "")
            {
                MessageBox.Show(err);
            }
            else
            {
                out_rc = OutParaValues[0].ToString();
                out_msg_err = OutParaValues[1].ToString();
                out_other_info = OutParaValues[2].ToString();

                if (out_rc != "00")
                {
                    MessageBox.Show(out_msg_err);
                }
                else
                {
                    MessageBox.Show("Process Successful!!!");
                    //string merchant_name = Get_Merchant_Name ( tb_Micro_Ref_No.Text.Trim ( ) );
                    //Send_SMS ( tb_CardNo.Text.Trim ( ), tb_AccNo.Text.Trim ( ), tb_Billing.Text.Trim ( ), merchant_name, cb_Periods.SelectedText.ToString ( ), tbDisamt.Text );
                }
            }
        }
 public static Type ToNetType(OracleType oracleType)
 {
     foreach (TypeMapping entry in _DbTypeMappings)
     {
         if (entry.OracleType == oracleType)
         {
             return entry.Type;
         }
     }
     throw new ApplicationException("Referenced an unsupported OracleType {" + Enum.GetName(typeof(OracleType), oracleType) + "}");
 }
        private void btBlock_Click ( object sender, EventArgs e )
        {
            try
            {
                if (cbbMerchant.SelectedIndex != -1)
                {
                    this.Cursor = Cursors.WaitCursor;

                    string name = "NAB_PCK_LOYALTY.block_installment";


                    string[] InParaName = new string[4] { "contract_nbr", "doc_id", "block_amount", "mer_id" };
                    string[] OutParaName = new string[2] { "emsg_out", "ref_out" };
                    OracleType[] InParaType = new OracleType[4] { OracleType.VarChar, OracleType.Number, OracleType.Number, OracleType.VarChar };
                    OracleType[] OutParaType = new OracleType[2] { OracleType.VarChar, OracleType.Number };

                    string[] InParaValues = new string[4] { lbcrd_number.Text.Trim ( ), lbdoc_id.Text.Trim ( ), tbAmount.Text.Trim ( ), cbbMerchant.SelectedValue.ToString ( ) };
                    string[] OutParaValues = new string[2];
                    for (int i = 0; i < 2; i++)
                        OutParaValues[i] = "";
                    int[] OutParaSize = new int[2] { 99999, 100 };
                    string err = "";
                    Businessbp.executedb.ExecuteProc ( name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err );
                    if (err != "")
                        MessageBox.Show ( err );
                    else
                    {
                        int Result_out = Int32.Parse ( OutParaValues[1].ToString ( ) );
                        string Emsg_out = OutParaValues[0].ToString ( );
                        if (Result_out == 0)
                        {
                            MessageBox.Show ( Emsg_out );
                            return;
                        }
                        else
                        {
                            MessageBox.Show ( "Block success!!!" );
                            this.Close ( );
                        }

                    }
                }
                else
                {
                    MessageBox.Show ( "Pls select at least one merchant!!!" );
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show ( ex.Message );
            }
            this.Cursor = Cursors.Default;
        }
        private void Process()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                string name = "";
                const int out_para = 1;
                name += "nab_pck_MASTERCARD_RECONS.LOAD_MC_PAYMENT"; 

                string[] InParaName = new string[2] { "pv_processing_dt", "pv_usrid" };
                string[] OutParaName = new string[out_para] { "pv_Error_Desc" };
                OracleType[] InParaType = new OracleType[2] { OracleType.VarChar, OracleType.VarChar };
                OracleType[] OutParaType = new OracleType[out_para] { OracleType.VarChar };

                string[] InParaValues = new string[2] { dtpkPdate.Text.Trim ( ), Businessbp.executedb.Usrid };
                string[] OutParaValues = new string[out_para];
                for (int i = 0; i < out_para; i++)
                    OutParaValues[i] = "";
                int[] OutParaSize = new int[out_para] { 9999 };
                OracleType reParaType = OracleType.VarChar;
                string returnValue = "";
                int reParaSize = 1;
                string err = "";
                Businessbp.executedb.ExecuteFunc ( name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, reParaType, reParaSize, ref OutParaValues, ref returnValue, ref err );
                if (err != "")
                {
                    MessageBox.Show(err);
                    this.Cursor = Cursors.Default;
                    return;
                }
                else
                {
                    string Emsg_out = OutParaValues[0].ToString();
                    if (returnValue != "1")
                    {
                        MessageBox.Show(Emsg_out);
                        this.Cursor = Cursors.Default;
                        return;
                    }
                    else
                    {
                        //Parse out_parameter nếu cần thiết
                        MessageBox.Show("Successfull!!!");
                    }
                }
                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.Cursor = Cursors.Default;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                string sql = "", err1 = "";
                DataTable dt;

                string cycle = cbCycle.SelectedValue.ToString().Trim();
                string date_process = dateTimePicker1.Text;
                string name = Businessbp.executedb.owner + "nab_proc_printbillcr";
               // (cycle in varchar2, indate in varchar2, Result_out out number,
              //Emsg_out out varchar2) is

                string[] InParaName = new string[2] { "cycle", "indate" };
                string[] OutParaName = new string[2] { "Result_out", "Emsg_out" };
                OracleType[] InParaType = new OracleType[2] { OracleType.VarChar, OracleType.VarChar };
                OracleType[] OutParaType = new OracleType[2] { OracleType.Number, OracleType.VarChar };

                string[] InParaValues = new string[2] { cycle, date_process };
                string[] OutParaValues = new string[2];
                for (int i = 0; i < 2; i++)
                    OutParaValues[i] = "";
                int[] OutParaSize = new int[2] { 0, 300 };
                string err = "";
                Businessbp.executedb.ExecuteProcELECTRA(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err);
                if (err != "")
                {
                    MessageBox.Show(err);
                    this.Cursor = Cursors.Default;
                }
                else
                {
                    int Result_out = Int32.Parse(OutParaValues[0].ToString());
                    string Emsg_out = OutParaValues[1].ToString();
                    if (Result_out != 1)
                    {
                        MessageBox.Show(Emsg_out);
                        this.Cursor = Cursors.Default;
                        return;
                    }
                    else
                    {
                        MessageBox.Show("Process successful");
                    }
                }
                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void bt_Process_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                string sql = "", err1 = "";
                DataTable dt;

                string name = Businessbp.executedb.owner + "pro_auto_payment";
                string[] InParaName = new string[1] { "u_create" };
                string[] OutParaName = new string[2] { "Result_out", "Msg_out" };
                OracleType[] InParaType = new OracleType[1] { OracleType.VarChar };
                OracleType[] OutParaType = new OracleType[2] { OracleType.Number, OracleType.VarChar };

                string[] InParaValues = new string[1] { Businessbp.executedb.Usrid};// 2015-10-20 (1)
                string[] OutParaValues = new string[2];
                for (int i = 0; i < 2; i++)
                    OutParaValues[i] = "";
                int[] OutParaSize = new int[2] { 0, 300 };
                string err = "";
                Businessbp.executedb.ExecuteProcELECTRA(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err);
                if (err != "")
                {
                    MessageBox.Show(err);
                    this.Cursor = Cursors.Default;
                }
                else
                {
                    int Result_out = Int32.Parse(OutParaValues[0].ToString());
                    string Emsg_out = OutParaValues[1].ToString();
                    if (Result_out != 1)//Lỗi
                    {
                        MessageBox.Show(Emsg_out);
                        this.Cursor = Cursors.Default;
                        return;
                    }
                    else
                    {
                        //Xu ly hach toan
                        HachToan();
                        LoadData();
                       MessageBox.Show( "Process successfull!!!");
                        this.Cursor = Cursors.Default;
                    }
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 internal OracleLob(OracleConnection connection, OracleType oracleType)
 {
     this._lobLocator = new OciLobLocator(connection, oracleType);
     this._lobType = oracleType;
     this._charsetForm = (OracleType.NClob == this._lobType) ? OCI.CHARSETFORM.SQLCS_NCHAR : OCI.CHARSETFORM.SQLCS_IMPLICIT;
     this._isTemporaryState = 1;
     OCI.LOB_TYPE lobtype = (OracleType.Blob == oracleType) ? OCI.LOB_TYPE.OCI_TEMP_BLOB : OCI.LOB_TYPE.OCI_TEMP_CLOB;
     int rc = TracedNativeMethods.OCILobCreateTemporary(connection.ServiceContextHandle, connection.ErrorHandle, this._lobLocator.Descriptor, 0, this._charsetForm, lobtype, 0, OCI.DURATION.OCI_DURATION_BEGIN);
     if (rc != 0)
     {
         connection.CheckError(this.ErrorHandle, rc);
     }
 }
		internal OracleLob (OciLobLocator locator, OciDataType ociType)
		{
			notNull = true;
			this.locator = locator;

			switch (ociType) {
			case OciDataType.Blob:
				type = OracleType.Blob;
				break;
			case OciDataType.Clob:
				type = OracleType.Clob;
				break;
			}
		}
        private void btUpdate_Click ( object sender, EventArgs e )
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                string err = "";
                const int count_inval = 2;
                const int count_outval = 3;
                string doc = doc_id;
                string merchant_id = cbbMerchant.SelectedValue.ToString ( );
                string name = "NAB_PCK_INSTALLMENT.NAB_PRC_UPDATE_MERCHANT";

                string[] InParaName = new string[count_inval] { "DOC_ID", "MERCHANT_ID" };
                OracleType[] InParaType = new OracleType[count_inval] { OracleType.VarChar, OracleType.VarChar };
                string[] InParaValues = new string[count_inval] { doc, merchant_id };
                string[] OutParaName = new string[count_outval] { "RESULT_MSG", "ERR_FLAG", "ERR_MSG" };
                OracleType[] OutParaType = new OracleType[count_outval] { OracleType.VarChar, OracleType.Number, OracleType.VarChar };
                int[] OutParaSize = new int[count_outval] { 99999, 200, 9999 };

                string[] OutParaValues = new string[3];
                string returnValue = "";
                err = "";
                Businessbp.executedb.ExecuteProc ( name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref OutParaValues, ref err );

                if (err != "")
                {
                    MessageBox.Show ( "Process NAB_PRC_UPDATE_MERCHANT Fail --->" + err );
                }
                else
                {
                    returnValue = OutParaValues[1].ToString ( );
                    if (returnValue == "1")
                    {
                        MessageBox.Show ( "Done!!! --> " + OutParaValues[0].ToString ( ));
                    }
                    else
                    {
                        err = OutParaValues[2].ToString ( );
                        MessageBox.Show ( "Process NAB_PRC_UPDATE_MERCHANT Fail --->" + err );
                    }
                }
                this.Cursor = Cursors.Default;

            }
            catch (Exception ex)
            {
                MessageBox.Show ( ex.ToString ( ) );
                this.Cursor = Cursors.Default;
            }
        }
        private void btProcess_Click ( object sender, EventArgs e )
        {

            try
            {
                this.Cursor = Cursors.WaitCursor;

                string date_process = dtpkProcessDate.Text;
                string name = "nab_pck_billing.fnc_process_bill_data";

                string[] InParaName = new string[1] { "in_stat_date" };
                string[] OutParaName = new string[1] { "out_Emsg" };
                OracleType[] InParaType = new OracleType[1] { OracleType.VarChar };
                OracleType[] OutParaType = new OracleType[1] {  OracleType.VarChar };

                string[] InParaValues = new string[1] {  date_process };
                string[] OutParaValues = new string[1];
                for (int i = 0; i < 1; i++)
                    OutParaValues[i] = "";
                int[] OutParaSize = new int[1] { 10 };
                OracleType reParaType = OracleType.Number;
                int reParaSize = 1;
                string returnValue = "";
                string err = "";
                Businessbp.executedb.ExecuteFunc ( name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, reParaType, reParaSize, ref  OutParaValues, ref returnValue, ref  err );
                if (err != "")
                {
                    MessageBox.Show ( err );
                    this.Cursor = Cursors.Default;
                }
                else
                {
                    if (returnValue != "1")
                    {
                        MessageBox.Show ( "Process Fail" );
                        this.Cursor = Cursors.Default;
                        return;
                    }
                    else
                    {
                        MessageBox.Show ( "Process successful" );
                    }
                }
                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show ( ex.Message );
            }
        }
        private void btProcess_Click ( object sender, EventArgs e )
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                string date_process = dtProcess.Text;
                string name = "NAB_PCK_PROCESS_DATA.LOAD_ACCOUNTING";


                string[] InParaName = new string[2] { "doing_dt_T_1", "user_create" };
                string[] OutParaName = new string[2] { "Result_out", "Emsg_out" };
                OracleType[] InParaType = new OracleType[2] { OracleType.VarChar, OracleType.VarChar };
                OracleType[] OutParaType = new OracleType[2] { OracleType.Number, OracleType.VarChar };

                string[] InParaValues = new string[2] { date_process, Businessbp.executedb.Usrid };
                string[] OutParaValues = new string[2];
                for (int i = 0; i < 2; i++)
                    OutParaValues[i] = "";
                int[] OutParaSize = new int[2] { 0, 300 };
                string err = "";
                Businessbp.executedb.ExecuteProc ( name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err );
                if (err != "")
                    MessageBox.Show ( err );
                else
                {
                    int Result_out = Int32.Parse ( OutParaValues[0].ToString ( ) );
                    string Emsg_out = OutParaValues[1].ToString ( );
                    if (Result_out == 0)
                    {
                        MessageBox.Show ( Emsg_out );
                        return;
                    }
                    else
                    {
                        MessageBox.Show ( "Process Done!!!" );
                    }

                }
               
            }
            catch (Exception ex)
            {
                MessageBox.Show ( ex.Message );
            }
            this.Cursor = Cursors.Default;
            btSum.Enabled = true;

        }
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                string txn_amount = tb_Amount.Text.Trim().Replace(",", "");
                string note = tb_Note.Text.Trim();

                string type = "XL_DP";
                string err = "";
                const int count_inval = 4;
                const int count_outval = 1;
                string name = Businessbp.executedb.owner + "nab_NQH." + type;

                string[] InParaName = new string[count_inval] { "account_nbr", "txn_amount", "note_pay", "u_create" };
                OracleType[] InParaType = new OracleType[count_inval] { OracleType.VarChar, OracleType.Number, OracleType.VarChar, OracleType.VarChar };
                string[] InParaValues = new string[count_inval] { tb_accountnumber.Text.Trim(), txn_amount, note, Businessbp.executedb.Usrid };
                string[] OutParaName = new string[count_outval] { "Emsg_out" };
                OracleType[] OutParaType = new OracleType[count_outval] { OracleType.VarChar };
                int[] OutParaSize = new int[count_outval] { 200 };

                OracleType reParaType = OracleType.Number;
                int reParaSize = 1;
                string[] OutParaValues = new string[1];
                string returnValue = "";
                err = "";
                Businessbp.executedb.ExecuteFunc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, reParaType, reParaSize, ref OutParaValues, ref returnValue, ref err);

                if (err != "")
                {
                    MessageBox.Show("Err XL_DP: \n" + err);
                }
                else
                {
                    if (returnValue == "1")
                    {
                        MessageBox.Show("Done successfully!!!");
                    }
                    else
                    {
                        err = OutParaValues[0].ToString();
                        MessageBox.Show("Err XL_DP: \n" + err);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void btStart_Click ( object sender, EventArgs e )
        {
            try
            {
                string in_parameter1 = "", in_parameter2 = "";
                string err = "";
                string out_rc = "", out_msg_err = "";
                const int count_inval = 2;
                const int count_outval = 2;
                //
                in_parameter1 = dtProcess.Text.Trim ( );//2015-12-22 (1)
                in_parameter2 = Businessbp.executedb.Usrid;

                //
                string name = "NAB_PCK_MERCHANT.PROCESS_MERCHANT_STATEMENT";
                string[] InParaName = new string[count_inval] { "d_processing", "user_id" };
                OracleType[] InParaType = new OracleType[count_inval] { OracleType.VarChar, OracleType.VarChar };
                string[] InParaValues = new string[count_inval] { in_parameter1, in_parameter2 };
                string[] OutParaName = new string[count_outval] { "ref_out", "Emsg" };
                OracleType[] OutParaType = new OracleType[count_outval] { OracleType.Number, OracleType.VarChar };
                int[] OutParaSize = new int[count_outval] { 999, 9999 };
                string[] OutParaValues = new string[count_outval];
                err = "";
                Businessbp.executedb.ExecuteProcELECTRA ( name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err );
                if (err != "")
                {
                    MessageBox.Show ( err );
                }
                else
                {
                    out_rc = OutParaValues[0].ToString ( );
                    out_msg_err = OutParaValues[1].ToString ( );

                    if (out_rc == "1")
                    {
                        MessageBox.Show ( "Process Successful" );
                        btProcessS.Enabled = true;
                        btStart.Enabled = false;
                    }
                    else
                        MessageBox.Show ( "PROCESS_MERCHANT_STATEMENT --> " + out_msg_err );
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show ( ex.ToString ( ) );
            }
        }
        private void btn_Process_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                string name = "nab_proc_update_target_time";
                //string[] InParaName = new string[1] { "in_from_time" }; //OLD 2015-04-03 (1)
                string[] InParaName = new string[2] {"in_user", "in_from_time" }; //2015-04-03 (1)
                string[] OutParaName = new string[2] { "out_result", "out_msg_err" };

                //OracleType[] InParaType = new OracleType[1] { OracleType.VarChar };//OLD 2015-04-03 (1)
                OracleType[] InParaType = new OracleType[2] { OracleType.VarChar, OracleType.VarChar };//2015-04-03 (1)
                OracleType[] OutParaType = new OracleType[2] { OracleType.Number, OracleType.VarChar };

                string target_time = cb_month.Text + "/" + cb_year.Text;
                //string[] InParaValues = new string[1] { target_time };//OLD 2015-04-03 (1)
                string[] InParaValues = new string[2] { Businessbp.executedb.Usrid.Trim(),target_time };//2015-04-03 (1)
                string[] OutParaValues = new string[2];
                for (int i = 0; i < 2; i++)
                    OutParaValues[i] = "";
                int[] OutParaSize = new int[2] { 100, 100 };
                string err = "";
                Businessbp.executedb.ExecuteProc(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref  OutParaValues, ref  err);
                if (err != "")
                    MessageBox.Show(err);
                else
                {
                    int out_result = Int32.Parse(OutParaValues[0].ToString());
                    string out_msg_err = OutParaValues[1].ToString();
                    if (out_result != 1)
                    {
                        MessageBox.Show(out_msg_err);
                        this.Cursor = Cursors.Default;
                        return;
                    }
                    else
                    {
                        MessageBox.Show("Process successfull!!!");
                        tb_Status.Text = "Successfull";
                    }
                }
                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Err Process_Data \n" + ex.Message);
            }
        }
Beispiel #31
0
        DataTable GetSchemaTable()
        {
            StringCollection keyinfo = null;

            if (schemaTable.Rows != null && schemaTable.Rows.Count > 0)
            {
                return(schemaTable);
            }

            string owner = String.Empty;
            string table = String.Empty;

            if ((behavior & CommandBehavior.KeyInfo) != 0)
            {
                keyinfo = GetKeyInfo(out owner, out table);
            }

            dataTypeNames = new ArrayList();

            for (int i = 0; i < statement.ColumnCount; i += 1)
            {
                DataRow row = schemaTable.NewRow();

                OciParameterDescriptor parameter = statement.GetParameter(i);

                dataTypeNames.Add(parameter.GetDataTypeName());

                row["ColumnName"]       = parameter.GetName();
                row["ColumnOrdinal"]    = i + 1;
                row["ColumnSize"]       = parameter.GetDataSize();
                row["NumericPrecision"] = parameter.GetPrecision();
                row["NumericScale"]     = parameter.GetScale();

                string sDataTypeName = parameter.GetDataTypeName();
                row["DataType"] = parameter.GetFieldType(sDataTypeName);

                OciDataType ociType = parameter.GetDataType();
                OracleType  oraType = OciParameterDescriptor.OciDataTypeToOracleType(ociType);
                row["ProviderType"] = (int)oraType;

                if (ociType == OciDataType.Blob || ociType == OciDataType.Clob)
                {
                    row["IsLong"] = true;
                }
                else
                {
                    row["IsLong"] = false;
                }

                row["AllowDBNull"] = parameter.GetIsNull();

                row["IsAliased"]    = DBNull.Value; // TODO:
                row["IsExpression"] = DBNull.Value; // TODO:

                if ((behavior & CommandBehavior.KeyInfo) != 0)
                {
                    if (keyinfo.IndexOf((string)row["ColumnName"]) >= 0)
                    {
                        row["IsKey"] = true;
                    }
                    else
                    {
                        row["IsKey"] = false;
                    }

                    row["IsUnique"]       = DBNull.Value; // TODO: only set this if CommandBehavior.KeyInfo, otherwise, null
                    row["BaseSchemaName"] = owner;
                    row["BaseTableName"]  = table;
                    row["BaseColumnName"] = row["ColumnName"];
                }
                else
                {
                    row["IsKey"]          = DBNull.Value;
                    row["IsUnique"]       = DBNull.Value;
                    row["BaseSchemaName"] = DBNull.Value;
                    row["BaseTableName"]  = DBNull.Value;
                    row["BaseColumnName"] = DBNull.Value;
                }

                schemaTable.Rows.Add(row);
            }

            return(schemaTable);
        }