public static int Update_Merchant(DataTable table)
        {
            int count_ter = 0;
            int count_mer = 0;

            try
            {
                foreach (DataRow row in table.Rows)
                {
                    if (dataAccess.CHECK_USED_MER(row.ItemArray[0].ToString()) <= 0) // merchant ko duoc gan voi terminal
                    {
                        dataAccess.insert_merchant_from_fcc(row.ItemArray[0].ToString(), row.ItemArray[1].ToString(), row.ItemArray[2].ToString(),
                                                            row.ItemArray[4].ToString(), row.ItemArray[5].ToString(), row.ItemArray[3].ToString());
                        count_mer++;
                    }
                    else // merchant dang su dung
                    {
                        DataTable ter_update = dataAccess.GET_INF_TERMINAL_FROM_MER(row.ItemArray[0].ToString());
                        Update_Terminal(ter_update, "(Mer)");

                        dataAccess.insert_merchant_from_fcc(row.ItemArray[0].ToString(), row.ItemArray[1].ToString(), row.ItemArray[2].ToString(),
                                                            row.ItemArray[4].ToString(), row.ItemArray[5].ToString(), row.ItemArray[3].ToString());
                        count_ter++;
                        classUpdateTerminalLogWriter.WriteLog("Update Merchant: " + row.ItemArray[0].ToString() + " " + DateTime.Now.ToString());
                    }
                }
                //if(count_mer > 0)
                //classUpdateTerminalLogWriter.WriteLog("Insert " + count_mer + " Merchant :" + DateTime.Now.ToString());
                //if (count_ter > 0)

                //classUpdateTerminalLogWriter.WriteLog("Update " + count_ter + " Terminal from Merchant :" + DateTime.Now.ToString());


                return(count_ter);
            }
            catch (Exception ex)
            {
                classUpdateTerminalLogWriter.WriteLog("Error Update_Merchant(), " + ex.Message);
                return(0);
            }
        }