Exemple #1
0
        private void btnRez_Click(object sender, EventArgs e)
        {
            string   RezAd      = txtRezAd.Text;
            string   RezSoyad   = txtRezSoyad.Text;
            string   RezNomre   = txtRezNomre.Text;
            string   MeydanAd   = CmbMeydan.Text;
            string   MeydanNomr = cmbRezMeydanNomr.Text;
            string   OtaqNomre  = cmbRezOtaqNomre.Text;
            DateTime DateFrom   = dateFrom.Value;
            DateTime DateTo     = dateToo.Value;
            int      phoneNumber;

            if (Extension.isNotEmpty(new string[] {
                RezAd, RezSoyad, RezNomre, MeydanAd, MeydanNomr, OtaqNomre
            }, string.Empty))
            {
                ;
            }
            {
                if (db.tbl_Otag.Any(otg => otg.Musteri_sayi <= 12))
                {
                    if (int.TryParse(RezNomre, out phoneNumber))
                    {
                        tbl_Otag   selectedOtaq  = db.tbl_Otag.First(ot => ot.OtagNomre == OtaqNomre);
                        tbl_Meydan selectedMeydn = db.tbl_Meydan.First(myd => myd.Meydan_nomresi == MeydanNomr);

                        tbl_Musteri selectClient = null;
                        int         ClientId     = 0;

                        selectClient = db.tbl_Musteri.Add(new tbl_Musteri
                        {
                            Ad      = RezAd,
                            Soyad   = RezSoyad,
                            Telefon = RezNomre
                        });
                        db.SaveChanges();
                        MessageBox.Show("ELAVE OLDU");
                    }
                }
            }
        }
Exemple #2
0
        private void btnOtagElaveEt_Click(object sender, EventArgs e)
        {
            string number      = txtOtagNomresi.Text;
            int    clientCount = (int)numMusteriSay.Value;

            if (number != string.Empty && clientCount != 0)
            {
                tbl_Otag otg = null;
                otg = new tbl_Otag
                {
                    OtagNomre    = number,
                    Musteri_sayi = clientCount
                };
                db.tbl_Otag.Add(otg);
                db.SaveChanges();
                MessageBox.Show(otg.OtagNomre + "" + "nomreli" + "" + "Otaq əlavə edildi", "OTAQ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                FillDataGrid();
            }
            else
            {
                lblerror.Visible = true;
                MessageBox.Show("Xahis olunur butun setirleri doldurun", "SEHV", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }