void save_solve() { string sql = @"insert into solve(id_session,time,scramble) values({0},{1},""{2}"")"; con.open(); string tmp = string.Format(sql, id_session, total_ms, current_scramble); con.command(tmp); con.close(); update_solves(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); sqlite_connector con = new sqlite_connector(); con.open(); int amount_users = Convert.ToInt32( con.select(@"select count(id_user) from users;") .Tables[0].Rows[0].ItemArray[0].ToString()); con.close(); string registered_user; //if we have 0 users, then prompt the user to generate the root account User.Login u_login = new User.Login(); if (amount_users < 1) { if (first_time_run()) { registered_user = u_login.username; Application.Run(new User.Register(u_login, true)); if (u_login.username != null) { Application.Run(u_login); if (u_login.login_ok) { Application.Run(new MainMenu.MainMenu(u_login.login_id)); } } } } else { Application.Run(u_login); if (u_login.login_ok) { Application.Run(new MainMenu.MainMenu(u_login.login_id)); } } }