-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFrmRezGoster.cs
69 lines (62 loc) · 2.33 KB
/
FrmRezGoster.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
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.SqlClient;
namespace TatilRez
{
public partial class FrmRezGoster : Form
{
public FrmRezGoster()
{
InitializeComponent();
}
int SecilenRezId;
public void VeriGetir()
{
SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM tblRezBilgileri", Datacon.baglanti());
DataSet ds = new DataSet();
adapter.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
private void FrmRezGoster_Load(object sender, EventArgs e)
{
VeriGetir();
}
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
int secilen = dataGridView1.SelectedCells[0].RowIndex;
SecilenRezId = Convert.ToInt16(dataGridView1.Rows[secilen].Cells[0].Value);
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
int secilen = dataGridView1.SelectedCells[0].RowIndex;
SecilenRezId = Convert.ToInt16(dataGridView1.Rows[secilen].Cells[0].Value);
}
Iptal _iptal = new Iptal();
private void btnRezIptal_Click(object sender, EventArgs e)
{
_iptal.RezIptal(SecilenRezId);
VeriGetir();
}
private void btnUlasimIptal_Click(object sender, EventArgs e)
{
DialogResult diaRes=MessageBox.Show("Ulaşım iptal ediliyor Konaklamayıda iptal etmek ister misiniz", "Rezervasyon", MessageBoxButtons.YesNo);
if(diaRes==DialogResult.Yes) _iptal.RezIptal(SecilenRezId);
else _iptal.UlasimIptal(SecilenRezId);
VeriGetir();
}
private void btnKonaklamaIptal_Click(object sender, EventArgs e)
{
DialogResult diaRes = MessageBox.Show("Konaklama iptal ediliyor Ulaşımıda iptal etmek ister misiniz", "Rezervasyon", MessageBoxButtons.YesNo);
if (diaRes == DialogResult.Yes) _iptal.RezIptal(SecilenRezId);
else _iptal.KonaklamaIptal(SecilenRezId);
VeriGetir();
}
}
}