public VisitorVideos(visitor guest) { InitializeComponent(); axWindowsMediaPlayer1.URL = @"Videos\lefkadaintro.mp4"; bool alreadyBeen = guest.Visited(this.Name.ToString()); if (alreadyBeen) { this.toolStripVisited.Visible = true; } Guest = guest; Guest.UpdHist("VisitorVideos"); }
public VisitorAbout(visitor guest) { InitializeComponent(); label1.Text = File.ReadAllText("Texts/about.txt"); bool alreadyBeen = guest.Visited(this.Name.ToString()); if (alreadyBeen) { this.toolStripVisited.Visible = true; } Guest = guest; Guest.UpdHist("VisitorAbout"); }
public VisitorHome(visitor guest) { InitializeComponent(); timer1.Enabled = true; timer1.Interval = 4000; timer1.Start(); timer1.Tick += new System.EventHandler(timer1_Tick); Slideshow.ImageLocation = "Images/1.jpg"; Slideshow.SizeMode = PictureBoxSizeMode.StretchImage; label1.Text = File.ReadAllText(path1); label5.Text = File.ReadAllText(path2); bool alreadyBeen = guest.Visited(this.Name.ToString()); if (alreadyBeen) { this.toolStripVisited.Visible = true; } Guest = guest; Guest.UpdHist("VisitorHome"); }
public VisitorPicture(visitor guest) { InitializeComponent(); pictureBox1.ImageLocation = "Gallery/1.jpg"; pictureBox2.ImageLocation = "Gallery/2.jpg"; pictureBox3.ImageLocation = "Gallery/3.jpeg"; pictureBox4.ImageLocation = "Gallery/4.jpg"; pictureBox5.ImageLocation = "Gallery/5.jpg"; pictureBox6.ImageLocation = "Gallery/6.jpg"; pictureBox7.ImageLocation = "Gallery/7.jpg"; pictureBox8.ImageLocation = "Gallery/8.jpg"; pictureBox9.ImageLocation = "Gallery/9.jpg"; pictureBox10.ImageLocation = "Gallery/10.jpg"; pictureBox11.ImageLocation = "Gallery/1.jpg"; label1.Text = "Άγιος Νικήτας"; pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox3.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox4.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox5.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox6.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox7.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox8.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox9.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox10.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox11.SizeMode = PictureBoxSizeMode.StretchImage; bool alreadyBeen = guest.Visited(this.Name.ToString()); if (alreadyBeen) { this.toolStripVisited.Visible = true; } Guest = guest; Guest.UpdHist("VisitorPicture"); }
public VisitorSites(visitor guest) { InitializeComponent(); label5.Text = File.ReadAllText("Texts/kastro.txt"); label1.Text = File.ReadAllText("Texts/gefura.txt"); label8.Text = File.ReadAllText("Texts/iera_monh.txt"); pictureBox1.ImageLocation = "Sites/kastro.jpg"; pictureBox2.ImageLocation = "Sites/gefira.jpg"; pictureBox3.ImageLocation = "Sites/monastiri.jpg"; pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox3.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox5.Hide(); bool alreadyBeen = guest.Visited(this.Name.ToString()); if (alreadyBeen) { this.toolStripVisited.Visible = true; } Guest = guest; Guest.UpdHist("VisitorSites"); }
private void Button1_Click(object sender, EventArgs e) { if (radioButton1.Checked == true) { connection.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Users.mdb;"; connection.Open(); // Create a command object, give it a connection object, give it a query to update our database OleDbCommand command = new OleDbCommand(); command.Connection = connection; command.CommandText = "SELECT * FROM guest ;"; // Now simply execute it! OleDbDataAdapter da = new OleDbDataAdapter(command); DataSet dt = new DataSet(); da.Fill(dt); try { visitor vistr = new visitor(); vistr.Username = dt.Tables[0].Rows[0]["Username"].ToString(); vistr.Visits = dt.Tables[0].Rows[0]["Visits"].ToString(); vistr.orderId = "VON" + vistr.Visits.ToString(); int visitcount = Convert.ToInt32(vistr.Visits); // Create a command object, give it a connection object, give it a query to update our database OleDbCommand command2 = new OleDbCommand(); command2.Connection = connection; visitcount++; command2.CommandText = "UPDATE guest SET Visits=" + visitcount + " WHERE Username='******';"; // Now simply execute it! command2.ExecuteNonQuery(); connection.Close(); globalusername = vistr.Username; VisitorHome VHF = new VisitorHome(vistr); VHF.Show(); this.Hide(); } catch { System.Windows.Forms.MessageBox.Show("Login failed! User or Guest are not found!"); connection.Close(); } } else if (radioButton2.Checked == true) { connection.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Users.mdb;"; connection.Open(); // Create a command object, give it a connection object, give it a query to update our database OleDbCommand command = new OleDbCommand(); command.Connection = connection; command.CommandText = "SELECT * FROM users WHERE Username='******';"; // Now simply execute it! OleDbDataAdapter da = new OleDbDataAdapter(command); DataSet dt = new DataSet(); da.Fill(dt); try { user usr = new user(); usr.Username = dt.Tables[0].Rows[0]["Username"].ToString(); usr.Password = dt.Tables[0].Rows[0]["Password"].ToString(); usr.Visits = dt.Tables[0].Rows[0]["Visits"].ToString(); usr.ID = Convert.ToInt32(dt.Tables[0].Rows[0]["UserID"]); int visitcount = Convert.ToInt32(usr.Visits); connection.Close(); if (usr.Password == PswdBox.Text) { connection.Open(); // Create a command object, give it a connection object, give it a query to update our database OleDbCommand command2 = new OleDbCommand(); command2.Connection = connection; visitcount++; command2.CommandText = "UPDATE users SET Visits=" + visitcount + " WHERE UserID=" + usr.ID + ";"; // Now simply execute it! command2.ExecuteNonQuery(); connection.Close(); globalusername = usr.Username; Home HF = new Home(usr); HF.Show(); this.Hide(); } else { System.Windows.Forms.MessageBox.Show("Wrong Password ! Try again."); } } catch { System.Windows.Forms.MessageBox.Show("Wrong Username! Try again."); connection.Close(); } } }