Exemplo n.º 1
0
 public void Manage_HLR_MSC_ASSO_DEST_Backup(string circleName)
 {
     try
     {
         List <MySqlParameter> pList = new List <MySqlParameter>();
         MySqlParameter        p     = new MySqlParameter();
         p.ParameterName = "@circle";
         p.Value         = circleName;
         pList.Add(p);
         string procedureName = string.Empty;
         procedureName = "Manage_HLR_MSC_ASSO_DEST_Backup";
         if (ExecuteMySqlStoredProcedure(procedureName, pList) == false)
         {
             ErrorMsg = "@" + System.DateTime.Now.ToString() + ":SP of Updation to Backup got failed.";
             oExceptionLog.WriteExceptionErrorToFile("Manage_HLR_MSC_ASSO_DEST_Backup()", ErrorMsg, "", ref FileError);
         }
     }
     catch (Exception ex)
     {
         ErrorMsg = "@" + System.DateTime.Now.ToString() + ":" + ex.Message.ToString();
         oExceptionLog.WriteExceptionErrorToFile("Manage_HLR_MSC_ASSO_DEST_Backup()", ErrorMsg, "", ref FileError);
     }
 }
Exemplo n.º 2
0
 private void DoSend(string strText)
 {
     try
     {
         //here we are setting working data to "" 
         this.strWorkingData.Length = 0;
         this.client.SendText(strText);
     }
     catch (Exception ers)
     {
         //MessageBox.Show("ERROR IN RESPOND OPTIONS");
         ErrorMsg = "@" + System.DateTime.Now.ToString() + ":["+ strText + "]" + ers.Message.ToString();
         oExceptionLog.WriteExceptionErrorToFile("DoSend()", ErrorMsg, "", ref FileError);
     }
 }
Exemplo n.º 3
0
        public bool ExecuteSQLQuery(ref MySqlConnection MYSQL_connection, string querystr)
        {
            int          retrycount    = 0;
            MySqlCommand mMySqlCommand = new MySqlCommand();

            mMySqlCommand.CommandText    = querystr;
            mMySqlCommand.CommandType    = CommandType.Text;
            mMySqlCommand.Connection     = MYSQL_connection;
            mMySqlCommand.CommandTimeout = 900000;

retry:
            if (MYSQL_connection.State != ConnectionState.Open)
            {
                conn.Open();
            }

            //if (MYSQL_connection.State != ConnectionState.Open)
            //{
            //    conn.Open();
            //}

            try
            {
                if (retrycount <= 4)
                {
                    mMySqlCommand.ExecuteNonQuery();
                }
                return(true);
            }
            catch (Exception ex)
            {
                retrycount = retrycount + 1;
                if (retrycount == 5)
                {
                    ErrorMsg = "@" + System.DateTime.Now.ToString() + ": " + ex.Message.ToString() + ".Query:" + querystr;
                    oExceptionLog.WriteExceptionErrorToFile("ExecuteSQLQueryMain()", ErrorMsg, "", ref FileError);
                    return(false);
                }
                goto retry;
            }
            finally
            {
                conn.Close();
            }
        }