public MainForm() { InitializeComponent(); //Registry key if (initiate.KeyExists()) { if (!initiate.Initiated()) { initiate.SetKey(true); } } else { HotelInitiate hotelInitiate = new HotelInitiate(); hotelInitiate.ShowDialog(); } CreateHotel(); //Pre-defined properties: MoreValuesGbx.Visible = false; BackgroundImage = null; Text = hotel.HotelName; //dbCon.Update("INSERT INTO travelagency(name, phone) VALUES('test', '100')"); //List<String>[] allTravelAngencies = dbCon.Select("SELECT * FROM travelagency", "id", "name"); //MessageBox.Show(dbCon.StringOut(allTravelAngencies, 1)); }
public void CheckFirstTimeUse() { RegistryKey key = Registry.CurrentUser.OpenSubKey(subkey, true); if (key != null) { //Exists if (!key.GetValue("Initiated").ToString().Equals("true")) { //Set to true key.SetValue("Initiated", "true"); key.Close(); } } else { //Doesn't exist, create HotelInitiate hotelInitiate = new HotelInitiate(); hotelInitiate.ShowDialog(); RegistryKey keys = Registry.CurrentUser.CreateSubKey(subkey); keys.SetValue("Initiated", "true"); keys.Close(); } }