コード例 #1
0
        //private void btnOdaSec_Click(object sender, EventArgs e)
        //{
        //    frmOdaSec frm = new frmOdaSec();
        //    frm.ShowDialog();
        //    txtOdaNo.Text = OdaNo;
        //    txtGirisTarihi.Text = Giris.ToShortDateString();
        //    txtCikisTarihi.Text = Cikis.ToShortDateString();
        //    TimeSpan fark = Cikis - Giris;
        //    int gunsayisi = fark.Days;
        //    decimal OdaFiyat = Rp.GetRoomPrice(OdaNo);
        //    txtToplamTutar.Text = ((gunsayisi + 1) * OdaFiyat).ToString();
        //}

        private void btnOnayla_Click(object sender, EventArgs e)
        {
            //if (txtAdi.Text.Trim() == "" || txtSoyadi.Text == "" || txtTc.Text == "")
            //{
            //    MessageBox.Show("Zorunlu alanlar girilmedi.", "Dikkat Eksik Bilgi!");
            //}

            Sale sa = new Sale();

            sa.RoomId      = Rp.GetRoomId(OdaNo);
            sa.CheckIn     = Giris;
            sa.CheckOut    = Cikis;
            sa.NoOfGuests  = 1;
            sa.TotalPrice  = ToplamTutar;
            sa.PersonnelId = General.PersonelId;
            sa.GuestId     = Gid;
            if (Giris.Date == DateTime.Now.Date)
            {
                sa.Status = true;
            }
            else
            {
                sa.Status = false;
            }
            Sp.AddSales(sa);

            GuestTransaction gtrans = new GuestTransaction();

            gtrans.Date = DateTime.Now;
            /*if (Giris.Date == DateTime.Now.Date)*/ gtrans.TransType = "Konaklama Ücreti";
            //else { gtrans.TransType = "Rezervasyon Ücreti"; }

            gtrans.Debt    = ToplamTutar;
            gtrans.Credit  = 0;
            gtrans.GuestId = Gid;
            gtrans.Status  = true;
            if (Giris.Date == DateTime.Now.Date)
            {
                gtrans.Description = "Konaklama Açılış";
            }
            else
            {
                gtrans.Description = "Rezervasyon";
            }
            if (Gtp.AddGTrans(gtrans))
            {
                MessageBox.Show("Kayıt yapıldı");
            }
            else
            {
                MessageBox.Show("Kayıt yapılmadı");
            }
        }
コード例 #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ı");
        }
コード例 #3
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.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ı");
            }
        }