private static void set_app_data_directory() { string path = string.Format(@"{0}\App_data\", WebSiteFileLocation.get_physical_path()); var absoluteDataDirectory = Path.GetFullPath(path); AppDomain.CurrentDomain.SetData("DataDirectory", absoluteDataDirectory); }
public static void Init() { set_app_data_directory(); Configuration config = new Configuration(); config.Configure(String.Format(@"{0}\web.config", WebSiteFileLocation.get_physical_path())); config.AddAssembly("KojackGames.Blackjack.Acceptance.Tests"); _SessionFactory = config.BuildSessionFactory(); }
public static void InitializeBrowser() { WebServer = new Server(Port, "/", WebSiteFileLocation.get_physical_path()); WebServer.Start(); }
public static Guid get_user_id_from_membership_table_by(string email) { Guid user_id; using (var conn = new SqlConnection(String.Format(@"Data Source=.\SQLEXPRESS;AttachDbFilename={0}\App_Data\ASPNETDB.mdf;Integrated Security=True;User Instance=True", WebSiteFileLocation.get_physical_path()))) { using (var cmd = conn.CreateCommand()) { conn.Open(); cmd.CommandText = "SELECT UserId " + "FROM aspnet_Membership " + "WHERE Email = @email"; cmd.Parameters.AddWithValue("email", email); cmd.CommandType = CommandType.Text; user_id = new Guid(cmd.ExecuteScalar().ToString()); } } return(user_id); }
public static void clear_db() { using (var conn = new SqlConnection(String.Format(@"Data Source=.\SQLEXPRESS;AttachDbFilename={0}\App_Data\Blackjack.mdf;Integrated Security=True;User Instance=True", WebSiteFileLocation.get_physical_path()))) { using (var cmd = conn.CreateCommand()) { conn.Open(); cmd.CommandText = "delete Decks;" + "delete CardsInHand;" + "delete Hands;" + "delete BlackJackTables;" + "delete Players;" + "delete MembershipEvents;"; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } } using (var conn = new SqlConnection(String.Format(@"Data Source=.\SQLEXPRESS;AttachDbFilename={0}\App_Data\ASPNETDB.mdf;Integrated Security=True;User Instance=True", WebSiteFileLocation.get_physical_path()))) { using (var cmd = conn.CreateCommand()) { conn.Open(); cmd.CommandText = "delete dbo.aspnet_Membership;" + "delete aspnet_Users;"; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } } }