/// <summary>
 /// Function creates an instance of the Static class
 /// for the first time.  But for the subsequent times
 /// existing instance is returned.
 /// </summary>
 /// <returns>DatabaseServiceHandler</returns>
 public static DataBaseServiceHandler createinstance()
 {
     if (Obj == null)
     {
         Obj = new DataBaseServiceHandler();
     }
     return(Obj);
 }
Exemplo n.º 2
0
        public static void InsertExportHistory(string Reference, string Type)
        {
            SqlConnection SqlConn = null;

            try
            {
                SqlConn = new SqlConnection(ExchangeConfigRegistryEntities.ExchangeConnectionString);
                SqlConn.Open();
                var userCount = SqlHelper.ExecuteNonQuery(SqlConn, CommandType.StoredProcedure, "usp_Export_History",
                                                          DataBaseServiceHandler.AddParameter <string>("@Reference1", DbType.String, Reference),
                                                          DataBaseServiceHandler.AddParameter <string>("@Reference2", DbType.String, ""),
                                                          DataBaseServiceHandler.AddParameter <string>("@Type", DbType.String, Type),
                                                          DataBaseServiceHandler.AddParameter <string>("@Status", DbType.String, ""));
            }
            catch (Exception Ex)
            {
                ExceptionManager.Publish(Ex);
            }
            finally
            {
                SqlConn.Close();
            }
        }