Ejemplo n.º 1
0
        private void btnBorcSorgula_Click(object sender, EventArgs e)
        {
            List <Decimal> pay = pr.PaymentTransBySalesId(sr.GetSaleIdByGuest(gr.GetGuestIdByTC(txtTKCNO.Text)));

            if (txtAdi.Text.Trim() != "" && txtSoyadi.Text.Trim() != "" && txtTKCNO.Text.Trim() != "" && txtOdaNo.Text.Trim() != "")
            {
                txtBorc.Text      = pay[0].ToString();
                txtKazanc.Text    = pay[1].ToString();
                txtKalanBorc.Text = pay[2].ToString();
            }
            else
            {
                MessageBox.Show("Eksik Bilgi Girdiniz");
            }
        }
Ejemplo n.º 2
0
        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ı");
        }