-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rezarvasyon.cs
78 lines (57 loc) · 2.76 KB
/
Rezarvasyon.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.Sql;
using System.Data.SqlClient;
namespace cafeotomasyon
{
public partial class Rezarvasyon : Form
{
public Rezarvasyon()
{
InitializeComponent();
}
SqlConnection baglanti = new SqlConnection("Data Source=DESKTOP-25U6SKM\\SQLEXPRESS;Initial Catalog=cafe;Integrated Security=True");
private void Rezarvasyon_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'cafeDataSet11.masalar' table. You can move, or remove it, as needed.
this.masalarTableAdapter.Fill(this.cafeDataSet11.masalar);
// TODO: This line of code loads data into the 'cafeDataSet10.masa' table. You can move, or remove it, as needed.
this.masaTableAdapter2.Fill(this.cafeDataSet10.masa);
// TODO: This line of code loads data into the 'cafeDataSet9.masa' table. You can move, or remove it, as needed.
this.masaTableAdapter1.Fill(this.cafeDataSet9.masa);
// TODO: This line of code loads data into the 'cafeDataSet8.masa' table. You can move, or remove it, as needed.
this.masaTableAdapter.Fill(this.cafeDataSet8.masa);
}
private void btnGeri_Click(object sender, EventArgs e)
{
Menü menü = new Menü();
menü.Show();
this.Hide();
}
private void btnRezarvasyon_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("insert into rezarvasyon(ad,soyad,tarih,saat,masaID) values ('"+txtAdRezarvasyon.Text+"','"+txtSoyadRezarvasyon.Text+"','"+txtTarihRezarvasyon.Text+"','"+txtSaatRezarvasyon.Text+"','"+cmbMasaRezarvasyon.Text+"')",baglanti);
komut.ExecuteNonQuery();
Masalar masalar = new Masalar();
if (cmbMasaRezarvasyon.Text=="Masa 1")
{
masalar.btnMasa1.BackgroundImage = Image.FromFile("C:\\Users\\adem\\Desktop\\cafeotomasyon\\cafeotomasyon\\cafeotomasyon\\resimler\\masarezarvasyon.png");
//masalar.btnMasa1.Text = "("+txtSaatRezarvasyon.Text+")"+" "+txtAdRezarvasyon.Text+" "+txtSoyadRezarvasyon.Text;
masalar.Show();
this.Hide();
}
baglanti.Close();
}
private void cmbMasaRezarvasyon_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}