private void btnEkle_Click(object sender, EventArgs e) { if (txtMisafirAdi.Text.Trim() != "" && txtMisafirSoyadi.Text.Trim() != "" && txtMisafirTC.Text.Trim() != "") { Guest gst = new Guest(); gst.FirstName = txtMisafirAdi.Text; gst.LastName = txtMisafirSoyadi.Text; gst.IdentificationNo = txtMisafirTC.Text; gst.RoomId = OdaId; gst.ContactNo = txtTelefon.Text; gst.Email = txtMail.Text; gst.Gender = cbMisafirCinsiyet.SelectedItem.ToString(); gst.Status = true; gst.Adress = txtAdres.Text; gst.Birthday = dtpMisafirDogumTarihi.Value; gst.Deleted = false; if (Gr.AddGuest(gst)) { GridDuzenle(Gr.GetGuestsInRoom(OdaId)); Temizle(); } } else { MessageBox.Show("Eksik bilgi girdiniz."); } }
public static void AddGuest(int year, GuestModel guest) { GuestRepository.AddGuest(year, guest); }
private void btnOnayla_Click(object sender, EventArgs e) { if (txtAdi.Text.Trim() == "" || txtSoyadi.Text == "" || txtTc.Text == "") { MessageBox.Show("Zorunlu alanlar girilmedi.", "Dikkat Eksik Bilgi!"); } Guest gue = new Guest(); gue.FirstName = txtAdi.Text; gue.LastName = txtSoyadi.Text; gue.IdentificationNo = txtTc.Text; gue.RoomId = Rp.GetRoomId(OdaNo); gue.Adress = txtAdres.Text; gue.Gender = cbCinsiyet.SelectedText; gue.Birthday = dtpDogumTarihi.Value; gue.ContactNo = txtTelefon.Text; gue.Email = txtEmail.Text; if (Giris.Date == DateTime.Now.Date) { gue.Status = true; } else { gue.Status = false; } Gp.AddGuest(gue); Sale sa = new Sale(); sa.RoomId = Rp.GetRoomId(OdaNo); sa.CheckIn = Giris; sa.CheckOut = Cikis; sa.NoOfGuests = 1; sa.TotalPrice = Convert.ToDecimal(txtToplamTutar.Text); sa.PersonnelId = General.PersonelId; sa.GuestId = Gp.GetGuestIdByTC(txtTc.Text); if (Giris.Date == DateTime.Now.Date) { sa.Status = true; } else { sa.Status = false; } Sp.AddSales(sa); Payment pay = new Payment(); pay.Date = DateTime.Now; if (Giris.Date == DateTime.Now.Date) { pay.TransType = "Konaklama Ücreti"; pay.Status = true; } else { pay.TransType = "Rezervasyon Ücreti"; pay.Status = false; } pay.Debt = Convert.ToDecimal(txtToplamTutar.Text); pay.Credit = 0; pay.SalesId = Sp.GetSaleIdByGuest(sa.GuestId); pay.Description = "Konaklama Açılış"; Pp.PaymentsAdd(pay); MessageBox.Show("Kayıt yapıldı"); }
public void AddGuestFor29(Guest guest) { _guestRepo.AddGuest(guest, "29thFeb"); }
private void btnOnayla_Click(object sender, EventArgs e) { if (txtAdi.Text.Trim() == "" || txtSoyadi.Text == "" || txtTc.Text == "") { MessageBox.Show("Zorunlu alanlar girilmedi.", "Dikkat Eksik Bilgi!"); } Guest gue = new Guest(); gue.FirstName = txtAdi.Text; gue.LastName = txtSoyadi.Text; gue.IdentificationNo = txtTc.Text; gue.RoomId = Rp.GetRoomId(OdaNo); gue.Adress = txtAdres.Text; gue.Gender = cbCinsiyet.SelectedItem.ToString(); gue.Birthday = dtpDogumTarihi.Value; gue.ContactNo = txtTelefon.Text; gue.Email = txtEmail.Text; if (Giris.Date == DateTime.Now.Date) { gue.Status = true; } else { gue.Status = false; } if (Gp.AddGuest(gue)) { Guest gst = Gp.GetGuest(); Sale sa = new Sale(); sa.RoomId = gst.RoomId; sa.CheckIn = Giris; sa.CheckOut = Cikis; sa.NoOfGuests = Convert.ToInt32(cbMisafirSayisi.SelectedItem.ToString()); try { sa.TotalPrice = ToplamTutar; } catch (FormatException) { throw; } if (Giris.Date == DateTime.Now.Date) { sa.Status = true; } else { sa.Status = false; } sa.PersonnelId = General.PersonelId; sa.GuestId = gst.Id; if (Sp.AddSales(sa)) { GuestTransaction Gtr = new GuestTransaction(); Gtr.Date = DateTime.Now; /*if (Giris.Date == DateTime.Now.Date)*/ Gtr.TransType = "Konaklama Ücreti"; //else { gtrans.TransType = "Rezervasyon Ücreti"; } try { Gtr.Debt = ToplamTutar; } catch (FormatException) { throw; } Gtr.Credit = 0; Gtr.GuestId = gst.Id; Gtr.Status = true; if (Giris.Date == DateTime.Now.Date) { Gtr.Description = "Konaklama Açılış"; } else { Gtr.Description = "Rezervasyon"; } if (GTrans.AddGTrans(Gtr)) { MessageBox.Show("Kayıt yapıldı"); } else { MessageBox.Show("Misafir harekeleri oluşturulamadı"); } } else { MessageBox.Show("Satış Yapılamadı"); } } else { MessageBox.Show("Yapılmadı"); } }