public string SOA_Misc_Credit(string source_chanel, string contract_number, string amount, string desc, string in_SS)
 {
     try
     {
         string result = "";
         TTTWebService.TrungTamThe soa = new TTTWebService.TrungTamThe ( );
         result = soa.SOA_Misc_Credit ( source_chanel, contract_number, amount, desc, in_SS );
         return result;
     }
     catch (Exception ex)
     {
         return ex.ToString ( );
     }
 }
 private void Authorize_MiscCredit_Prepaid ( string batch_id )
 {
     
     #region new
     string xml = "";
     string sql = "", err = "";
     TTTWebService.TrungTamThe ttt = new TTTWebService.TrungTamThe ( );
     try
     {
         for (int i = 0; i < dgv_authorize_data.Rows.Count; i++)
         {
             xml = ttt.SOA_Misc_Credit ( "FORM", dgv_authorize_data.Rows[i].Cells["account_number"].Value.ToString ( ).Trim ( ), dgv_authorize_data.Rows[i].Cells["amount"].Value.ToString ( ).Trim ( ), "IBPS", "83" );
             ArrayList result = getxmlvalue ( xml );
             if (result[0].ToString ( ) != "0")
             {
                 sql = "        update NAB_BATCH_MICS t ";
                 sql += "           set t.processing_flag = 'Z', t.msg_error = '" + result[1].ToString ( ) + "'";
                 sql += "              ,t.user_modify=  '" + Businessbp.executedb.Usrid + "'";
                 sql += "              ,t.date_modify = sysdate";
                 sql += "        where t.batch_number = '" + batch_id + "'";
                 sql += "        and t.date_create = to_date('" + dgv_authorize_data.Rows[i].Cells["date_create"].Value.ToString ( ).Trim ( ) + "','dd/mm/yyyy')";
                 sql += "        and t.card_number = '" + dgv_authorize_data.Rows[i].Cells["card_number"].Value.ToString ( ).Trim ( ) + "'";
                 sql += "        and t.trn_ref_no  = '" + dgv_authorize_data.Rows[i].Cells["trn_ref_no"].Value.ToString ( ).Trim ( ) + "'";
                 if (!Businessbp.executedb.ExecuteDML ( sql, ref err ))
                 {
                     MessageBox.Show ( " Update Mics To Z Fail" + err );
                     return;
                 };
             }
             if (result[0].ToString ( ) == "0")
             {
                 sql = "        update NAB_BATCH_MICS t ";
                 sql += "           set t.processing_flag = 'Y', t.msg_error = '" + result[1].ToString ( ) + "'";
                 sql += "              ,t.user_modify=  '" + Businessbp.executedb.Usrid + "'";
                 sql += "              ,t.date_modify = sysdate";
                 sql += "        where t.batch_number = '" + cb_src_batch_id.Text.Trim ( ) + "'";
                 sql += "        and trunc(t.date_create) = to_date('" + dgv_authorize_data.Rows[i].Cells["date_create"].Value.ToString ( ).Trim ( ) + "','dd/mm/yyyy')";
                 sql += "        and t.card_number = '" + dgv_authorize_data.Rows[i].Cells["card_number"].Value.ToString ( ).Trim ( ) + "'";
                 sql += "        and t.trn_ref_no  = '" + dgv_authorize_data.Rows[i].Cells["trn_ref_no"].Value.ToString ( ).Trim ( ) + "'";
                 if (!Businessbp.executedb.ExecuteDML ( sql, ref err ))
                 {
                     MessageBox.Show ( " Update Mics To Y Fail " + err );
                     return;
                 };
             }
         }
         sql = "update nab_balance_batch u ";
         sql += "    set u.status='Y' ";
         sql += "    where u.batch_id= '" + cb_src_batch_id.Text.Trim ( ) + "'";
         sql += "          and u.type_code= '3' ";
         sql += "          and u.type = 'PREPAID' ";
         if (!Businessbp.executedb.ExecuteDML ( sql, ref err ))
         {
             MessageBox.Show ( " Cannot Close Batch " + err );
             return;
         };
         MessageBox.Show ( "Authorize Successful" );
     #endregion
     }
     catch (Exception ex)
     {
         MessageBox.Show ( ex.ToString ( ) );
     }
 }