private void OdalarForm_Load(object sender, EventArgs e) { dataGridView1.DataSource = oOrm.Select(); cmbOdaTuru.DataSource = oTOrm.Select(); cmbOdaTuru.DisplayMember = "Adi"; cmbOdaTuru.ValueMember = "Id"; }
private void btn_OdaEkle_Click(object sender, EventArgs e) { Odalar oda = new Odalar { Aciklama = txt_Aciklama.Text, OdaTurID = (int)cmb_OdaTuru.SelectedValue, Aktif = true }; if (!string.IsNullOrEmpty(txt_OdaAdi.Text)) { oda.Adi = txt_OdaAdi.Text; } bool snc = odaORM.Insert(oda); if (snc) { MessageBox.Show("Oda Başarıyla Eklendi"); dataGridView1.DataSource = odaORM.Select(); } else { MessageBox.Show("HATA"); } }
private void SatisForm_Load(object sender, EventArgs e) { Text = "Satis Formu"; MusteriORM mOrm = new MusteriORM(); cmbMusteri.DataSource = mOrm.Select(); cmbMusteri.DisplayMember = "Adi"; cmbMusteri.ValueMember = "Id"; KasaORM kasaOrm = new KasaORM(); cmbKasaOdemeTip.DataSource = kasaOrm.Select(); cmbKasaOdemeTip.DisplayMember = "Adi"; cmbKasaOdemeTip.ValueMember = "Id"; cmbOda.DataSource = odaOrm.Select(); cmbOda.DisplayMember = "Adi"; cmbOda.ValueMember = "Id"; UrunORM uOrm = new UrunORM(); dataGridView1.DataSource = uOrm.Select(); dataGridView1.Columns[0].Visible = false; dataGridView1.Columns[6].Visible = false; dataGridView1.Columns[7].Visible = false; dataGridView1.Columns[8].Visible = false; }
private void SatisFORM_Load(object sender, EventArgs e) { MusteriORM mORM = new MusteriORM(); cmb_Müsteri.DataSource = mORM.Select(); cmb_Müsteri.DisplayMember = "Adi"; cmb_Müsteri.ValueMember = "Id"; KasaORM korm = new KasaORM(); cmbKasaTip.DataSource = korm.Select(); cmbKasaTip.DisplayMember = "Adi"; cmbKasaTip.ValueMember = "Id"; OdalarORM oORM = new OdalarORM(); DataRow[] rows = oORM.Select().Select("Aktif='True'"); if (rows.Length > 0) { cmb_Oda.DataSource = rows.CopyToDataTable(); } cmb_Oda.DisplayMember = "Adi"; cmb_Oda.ValueMember = "Id"; SatisORM s = new SatisORM(); dataGridView1.DataSource = s.Select(); }
private void OdalarForm_Load(object sender, EventArgs e) { Text = "Tanımlar - Odalar"; btnGuncelle.Visible = false; btnIptal.Visible = false; OdaTurleriORM oturOrm = new OdaTurleriORM(); cmbOdaTuru.DataSource = oturOrm.Select(); cmbOdaTuru.DisplayMember = "Adi"; cmbOdaTuru.ValueMember = "Id"; dataGridView1.DataSource = odaOrm.Select(); dataGridView1.Columns[0].Visible = false; dataGridView1.Columns[3].Visible = false; dataGridView1.Columns[4].Visible = false; }
private void OdaOzellikForm_Load(object sender, EventArgs e) { OdalarORM odaORM = new OdalarORM(); cmb_Odalar.DataSource = odaORM.Select(); cmb_Odalar.DisplayMember = "Adi"; cmb_Odalar.ValueMember = "Id"; OzellikORM ozORM = new OzellikORM(); list_Ozellikler.DataSource = ozORM.Select(); list_Ozellikler.DisplayMember = "Adi"; list_Ozellikler.ValueMember = "Id"; }
private void OdaOzelliklerForm_Load(object sender, EventArgs e) { Text = "Oda Özellikleri Ekle"; OdalarORM odaOrm = new OdalarORM(); cmbOdalar.DataSource = odaOrm.Select(); cmbOdalar.DisplayMember = "Adi"; cmbOdalar.ValueMember = "Id"; OzelliklerORM ozeOrm = new OzelliklerORM(); listOzellikler.DataSource = ozeOrm.Select(); listOzellikler.DisplayMember = "Adi"; listOzellikler.ValueMember = "Id"; //BackgroundImage = Properties.Resources.OtelOdasi; }
private void SatisForm_Load(object sender, EventArgs e) { MusteriORM mOrm = new MusteriORM(); cmbMusteri.DataSource = mOrm.Select(); cmbMusteri.DisplayMember = "Adi"; cmbMusteri.ValueMember = "Id"; OdalarORM oOrm = new OdalarORM(); cmbOda.DataSource = oOrm.Select(); cmbOda.DisplayMember = "Adi"; cmbOda.ValueMember = "Id"; UrunlerORM uOrm = new UrunlerORM(); dataGridView1.DataSource = uOrm.Select(); }
private void btn_Kaydet_Click(object sender, EventArgs e) { try { SatisORM s = new SatisORM(); Satis satisEntity = new Satis(); satisEntity.MusteriID = (int)cmb_Müsteri.SelectedValue; satisEntity.OdaFiyati = nmr_OdaFiyatı.Value; int OdaID; bool kontrolOda = int.TryParse(cmb_Oda.SelectedValue.ToString(), out OdaID); if (kontrolOda == true) { satisEntity.OdaID = OdaID; } satisEntity.KasaID = (int)cmbKasaTip.SelectedValue; satisEntity.PersonelID = PersonellerORM.aktifKullanici.Id; bool kontrol = s.Insert(satisEntity); if (kontrol == true) { MessageBox.Show("Oda Satıldı"); dataGridView1.DataSource = s.Select(); OdalarORM oORM = new OdalarORM(); cmb_Oda.DataSource = oORM.Select(); PersonellerORM porm = new PersonellerORM(); Personeller p = PersonellerORM.aktifKullanici; Personeller aktif = porm.GirisYap(p); ControlCollection mdiControls = (ControlCollection)this.MdiParent.Controls; mdiControls["lblSatis"].Text = aktif.SatisSayisi.ToString(); mdiControls["lblSatisFiyat"].Text = aktif.SatisFiyati.ToString(); } } catch (Exception) { MessageBox.Show("Satış sırasında bir hata meydana geldi"); } }