예제 #1
0
        /// <summary>
        /// Yeni Kategori Ekler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonKategoriEkle_Click(object sender, EventArgs e)
        {
            string catName = txtBox_yeniKategoriName.Text;
            string response;

            if (catName != null)
            {
                response = BLL.Category.kategoriEkle(catName);

                if (response.Equals("True"))
                {
                    showMessage = new UyariPenceresi("Kategori Ekleme Başarılı");
                    showMessage.ShowDialog();
                    txtBox_yeniKategoriName.Text = "";
                    dataGridViewsUpdate();
                }
                else
                {
                    showMessage = new UyariPenceresi("Kategori Ekleme Başarısız");
                    showMessage.ShowDialog();
                }
            }
            else
            {
                showMessage = new UyariPenceresi("Kategori İsmi Boş Bırakılamaz");
                showMessage.ShowDialog();
            }
        }
예제 #2
0
        private void buttonGuncelle_Click(object sender, EventArgs e)
        {
            string ad     = textBoxAD.Text;
            string tcno   = textBoxTCNO.Text;
            string soyad  = textBoxSoyad.Text;
            string mail   = textBoxMil.Text;
            string sifre  = textBoxSifre.Text;
            string adres  = richTextBoxAdres.Text;
            string telno  = maskedTextBoxTelNO.Text;
            int    gender = 0;

            if (radioButton1.Checked.Equals(true))
            {
                gender = 1;
            }
            string response = BLL.Users.kullaniciGuncelle(ad, soyad, tcno, sifre, gender, mail, telno, adres, 1, this.userID);

            if (response.Equals("True"))
            {
                UyariPenceresi pencere = new UyariPenceresi("Bilgileriniz Güncellendi");
                pencere.ShowDialog();
            }
            else
            {
                UyariPenceresi pencere = new UyariPenceresi("Güncelleme Başarısız");
                pencere.ShowDialog();
            }
        }
예제 #3
0
        private void buttonKategoriGuncelle_Click(object sender, EventArgs e)
        {
            catIDGuncelle = Convert.ToInt32(dataGridView_Guncelle.CurrentRow.Cells["catID"].Value);
            int    control     = 0;
            string mesaj       = "";
            string yenicatName = txtBoxKategoriGuncelle.Text;

            if (label11.Text.Equals(""))
            {
                control++;
                mesaj += "Kategori Seçiniz";
            }
            if (yenicatName.Equals(""))
            {
                control++;
                mesaj += "\n\nKategori İsmi Giriniz";
            }
            if (control == 0)
            {
                string response = BLL.Category.kategoriGuncelle(yenicatName, catIDGuncelle);
                if (response.Equals("True"))
                {
                    mesaj = "Kategori Güncellendi";
                    dataGridViewsUpdate();
                }
                else
                {
                    mesaj = "Kategori Güncelleme Başarısız";
                }
            }
            showMessage = new UyariPenceresi(mesaj);
            showMessage.ShowDialog();
        }
예제 #4
0
        private void buttonKategoriSil_Click(object sender, EventArgs e)
        {
            int sil_catID = Convert.ToInt32(dataGridView_Sil.CurrentRow.Cells["catID"].Value);

            if (sil_catID != -1)
            {
                string response = BLL.Category.kategoriSil(sil_catID);
                if (response.Equals("True"))
                {
                    showMessage = new UyariPenceresi("Kategori Silindi");
                }
                else
                {
                    showMessage = new UyariPenceresi("Kategori Silinemiyor");
                }
            }
            else
            {
                showMessage = new UyariPenceresi("Kategori Seçimi Yapmadınız");
            }

            if (showMessage != null)
            {
                showMessage.ShowDialog();
            }
        }
        private void button_guncelleMasa_Click(object sender, EventArgs e)
        {
            string bildirim = "";
            int    tableID  = Convert.ToInt32(dataGridView_Guncelle.CurrentRow.Cells["tableID"].Value);
            string tableNo  = textBox_guncelleName.Text;
            int    capacity = Convert.ToInt32(numericUpDown_guncelleKapasite.Value);

            if (tableNo == "")
            {
                bildirim += "Masa Adı Boş Bırakılamaz \n";
            }
            else if (capacity < 2)
            {
                bildirim += "Kapasite 2'den Küçük Olamaz";
            }
            else
            {
                string response = BLL.Tables.masaGuncelle(tableNo, capacity, tableID);
                if (response.Equals("True"))
                {
                    bildirim = "Masa Güncelleme Başarılı";

                    updateDataGridViews();
                }
                else
                {
                    bildirim = "Masa Güncelleme Başarısız";
                }
            }
            UyariPenceresi uyari = new UyariPenceresi(bildirim);

            uyari.ShowDialog();
        }
        private void button_newMasaEkle_Click(object sender, EventArgs e)
        {
            string tableName     = textBox_newMasaName.Text;
            int    tableCapacity = Convert.ToInt32(numericUpDown_newMasaKapasite.Value);

            if (tableName.Equals(""))
            {
                UyariPenceresi bildir = new UyariPenceresi("Masa No Giriniz");
                bildir.ShowDialog();
            }
            else if (tableCapacity < 2)
            {
                UyariPenceresi bildir = new UyariPenceresi("Kapasite 2 de küçük olamaz");
                bildir.ShowDialog();
            }
            else
            {
                string response = BLL.Tables.masaEkle(tableName, tableCapacity);
                if (response.Equals("True"))
                {
                    UyariPenceresi bildir = new UyariPenceresi("Masa Başarıyla Eklendi\n Masa Adı: " + tableName + "\n Kapasite: " + tableCapacity);
                    bildir.ShowDialog();
                    updateDataGridViews();
                    textBox_newMasaName.Text            = "";
                    numericUpDown_newMasaKapasite.Value = 2;
                }
                else
                {
                    UyariPenceresi bildir = new UyariPenceresi("Masa Ekleme Başarısız");
                    bildir.ShowDialog();
                }
            }
        }
        private void button_silMasaEvet_Click(object sender, EventArgs e)
        {
            string bildirim  = "";
            string tableName = dataGridView_Sil.CurrentRow.Cells["tableID"].Value.ToString();
            int    tableID   = Convert.ToInt32(tableName);

            if (label_silMasaName.Text.Equals(""))
            {
                bildirim = "Masa Seçmediniz";
            }
            else
            {
                bool response = BLL.Tables.masaSil(tableID);
                if (response.Equals(true))
                {
                    bildirim = "Masa Silindi";
                    updateDataGridViews();
                }
                else
                {
                    bildirim = "Masa Silinemiyor";
                }
            }

            UyariPenceresi pencere = new UyariPenceresi(bildirim);

            pencere.ShowDialog();
        }
 private void button_yeniUrunEkle_Click(object sender, EventArgs e)
 {
     if (comboBox_yeni_kategori.SelectedIndex == 0)
     {
         UyariPenceresi pencere = new UyariPenceresi("Kategori Seçmediniz");
         pencere.ShowDialog();
     }
     else
     {
         int    catID       = -1;
         string productName = txtbox_yeniUrun.Text;
         string name        = comboBox_yeni_kategori.SelectedItem.ToString();
         foreach (Category cat in kategoriList)
         {
             if (name.Equals(cat.catName))
             {
                 catID = cat.catID;
             }
         }
         string fiyat    = Convert.ToString(numericUpDown_yeniFiyat.Value);
         string aciklama = richTextBox_yeniAciklama.Text;
         if (catID == -1 && numericUpDown_yeniFiyat.Value < 0 && productName.Equals(""))
         {
             UyariPenceresi pencere = new UyariPenceresi("Alanlar Boş Bırakılamaz");
             pencere.ShowDialog();
         }
         else
         {
             string response = BLL.Product.urunEkle(catID, productName, fiyat, aciklama);
             if (response.Equals(true))
             {
                 UyariPenceresi pencere = new UyariPenceresi("Ürün Başarıyla Eklendi");
                 pencere.ShowDialog();
                 dataGridViewsUpdater();
             }
             else
             {
                 UyariPenceresi pencere = new UyariPenceresi("Ürün Ekleme Başarısız");
                 pencere.ShowDialog();
             }
         }
     }
 }
        /// <summary>
        /// Tablodan Seçilen Kullanıcıyı Id sine göre Siler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonSilEvet_Click(object sender, EventArgs e)
        {
            int  userid   = Convert.ToInt32(dataGridViewSil.CurrentRow.Cells["userID"].Value);
            bool response = BLL.Users.kullaniciSil(userid);

            if (response == true)
            {
                UyariPenceresi bildir = new UyariPenceresi(labelKullaniciadsoyad.Text + " kullanıcısı silinmiştir");
                bildir.ShowDialog();
                DataTable table = BLL.Users.garsonlariGetir();
                dataGridView_Guncelle.DataSource = table;
                dataGridViewSil.DataSource       = table;
            }
            else
            {
                UyariPenceresi bildir = new UyariPenceresi(labelKullaniciadsoyad.Text + " kullanıcısı silinemiyor");
                bildir.ShowDialog();
            }
        }
        private void button_Guncelle_Click(object sender, EventArgs e)
        {
            string bildirim    = "";
            int    control     = 0;
            string productName = dataGridView_Guncelle.CurrentRow.Cells["productName"].Value.ToString();

            if (productName.Equals(""))
            {
                bildirim += "Ürün İsmi Boş Bırakılamaz";
                control++;
            }
            string price = numericUpDown2.Value.ToString();

            if (price.Equals("0"))
            {
                bildirim += "Fiyat 0 olamaz";
                control++;
            }
            if (control == 0)
            {
                string description = richTextBox_Guncelle.Text;
                int    catID       = Convert.ToInt32(dataGridView_Guncelle.CurrentRow.Cells["catID"].Value);
                int    productID   = Convert.ToInt32(dataGridView_Guncelle.CurrentRow.Cells["productID"].Value);
                string response    = BLL.Product.urunGuncelle(productName, price, 1, description, catID, productID);
                if (response.Equals("True"))
                {
                    UyariPenceresi pencere = new UyariPenceresi("Ürün Güncelleme Başarılı");
                    pencere.ShowDialog();
                    dataGridViewsUpdater();
                }
                else
                {
                    UyariPenceresi pencere = new UyariPenceresi("Ürün Güncelleme Başarısız");
                    pencere.ShowDialog();
                }
            }
            else
            {
                UyariPenceresi pencere = new UyariPenceresi(bildirim);
                pencere.ShowDialog();
            }
        }
예제 #11
0
        public void masaAramaveGoruntuleme(string masaAd)
        {
            int control = 0;

            foreach (Masalar masa in masaListesi)
            {
                if (masa.masaAd.Equals(masaAd) || masa.masaId.Equals(masaAd))
                {
                    control++;
                    panel_Tables.Controls.Clear();
                    Label label = new Label();
                    label.Text = masa.masaAd;
                    label.Name = masa.masaId;
                    ListViewSiparisAdapter(Convert.ToInt32(masa.masaId));
                    if (masa.masaDurum.Equals("True"))
                    {
                        label.Image     = acikMasa;
                        label.ForeColor = Color.Green;
                    }
                    else
                    {
                        label.Image     = kapaliMasa;
                        label.ForeColor = Color.Red;
                    }

                    label.ImageAlign = ContentAlignment.MiddleCenter;
                    label.TextAlign  = ContentAlignment.TopCenter;
                    label.Size       = new Size(150, 120); label.Margin = new Padding(10, 75, 0, 0);
                    label.Font       = new Font("Times New Roman", 12, FontStyle.Bold);

                    panel_Tables.Controls.Add(label);
                    label.Click += Label_Click;
                }
            }
            if (control < 1)
            {
                UyariPenceresi pencere = new UyariPenceresi("Böyle Bir Masa Bulunmamaktadır");
                pencere.ShowDialog();
                butunMasalar();
            }
        }
예제 #12
0
        private void button_yeniEkle_Click(object sender, EventArgs e)
        {
            string ad     = textBox_yeniAd.Text;
            string tcno   = textBoxt_yeniTc.Text;
            string soyad  = textBox_yeniSoyad.Text;
            string mail   = textBox_yeniMail.Text;
            string sifre  = textBox_yeniSifre.Text;
            string adres  = richTextBox_yeniAdres.Text;
            string telno  = maskedTextBox_yeniTel.Text;
            int    gender = 0;

            if (radioButton_YeniErk.Checked.Equals(true))
            {
                gender = 1;
            }
            string response = BLL.Users.kullaniciEkle(ad, soyad, tcno, sifre, 1, mail, telno, adres, gender);

            if (response.Equals("True"))
            {
                UyariPenceresi pencere = new UyariPenceresi("Yeni Yönetici Oluşturuldu");
                pencere.ShowDialog();
                tabControl1.SelectTab(0);
                textBox_yeniAd.Text        = "";
                textBoxt_yeniTc.Text       = "";
                textBox_yeniSoyad.Text     = "";
                textBox_yeniMail.Text      = "";
                textBox_yeniSifre.Text     = "";
                richTextBox_yeniAdres.Text = "";
                maskedTextBox_yeniTel.Text = "";
            }
            else
            {
                UyariPenceresi pencere = new UyariPenceresi("Alanlar Boş Bırakılamaz");
                pencere.ShowDialog();
            }
        }
 private void button_ProductSil_Click(object sender, EventArgs e)
 {
     if (label5.Text.Equals(""))
     {
         UyariPenceresi penc = new UyariPenceresi("Tabloda Ürün Seçiniz");
         penc.ShowDialog();
     }
     else
     {
         int  productID = Convert.ToInt32(dataGridView_Sil.CurrentRow.Cells["productID"].Value);
         bool response  = BLL.Product.urunSiparisleriyleSil(productID);
         if (response.Equals(true))
         {
             UyariPenceresi penc = new UyariPenceresi("Ürün Başarıyla Silindi");
             penc.ShowDialog();
             dataGridViewsUpdater();
         }
         else
         {
             UyariPenceresi penc = new UyariPenceresi("Ürüne Dair Sipariş Bulunmaktadır \n Silinemiyor");
             penc.ShowDialog();
         }
     }
 }
        /// <summary>
        /// Kullanıcı Bilgilerini Güncelle Eventi
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonGuncelle_Click(object sender, EventArgs e)
        {
            int    userid = Convert.ToInt32(dataGridView_Guncelle.CurrentRow.Cells["userID"].Value);
            string ad     = textBox_guncelleAd.Text;

            this.ad = ad;
            int    control = 0;
            string message = "";

            if (ad == "")
            {
                control++; message += control + "- Ad alanı boş bırakılamaz \n";
            }
            string soyad = textBox_guncelleSoyad.Text;

            this.soyad = soyad;
            if (soyad == "")
            {
                control++; message += control + "- Soyad alanı boş bırakılamaz \n";
            }
            string mail = textBox_GuncelleMail.Text;

            this.mail = mail;
            if (mail == "")
            {
                control++; message += control + "- Mail alanı boş bırakılamaz \n";
            }
            string tcno = textBox_GuncelleTc.Text;

            this.tcno = tcno;
            if (tcno == "")
            {
                control++; message += control + "- Tc No alanı boş bırakılamaz \n";
            }
            string telno = maskedTextBox_guncelleTel.Text;

            this.telno = telno;
            if (telno == "")
            {
                control++; message += control + "- Telefon Numarası alanı boş bırakılamaz \n";
            }
            string adres = richTextBox_guncelleAdres.Text;

            this.adres = adres;
            string sifre = textBox_GuncelleSifre.Text;

            this.sifre = sifre;
            if (sifre == "")
            {
                control++; message += control + "- Şifre alanı boş bırakılamaz \n";
            }
            int role = 0;
            int cinsiyet;

            if (radioButton_guncelleErkek.Checked != false)
            {
                cinsiyet = 1;
            }
            else
            {
                cinsiyet = 0;
            }
            this.cinsiyet = cinsiyet;
            if (control == 0)
            {
                if (guncelleDegisiklikKontrol().Equals(false))
                {
                    UyariPenceresi showmes = new UyariPenceresi("Kullanıcı Bilgilerinde Değişiklik Yapmadınız \n\nGüncelleme İşlemi İçin Kullanıcı Bilgilerini \nDeğiştirmeniz Gerekiyor");
                    showmes.ShowDialog();
                }
                else
                {
                    string response = BLL.Users.kullaniciGuncelle(ad, soyad, tcno, sifre, role, mail, telno, adres, cinsiyet, userid);

                    if (response.Equals("True"))
                    {
                        UyariPenceresi showmes = new UyariPenceresi("Kullanıcı Başarıyla Güncellendi");
                        showmes.Show();
                        updateDataGridViews();
                    }
                    else
                    {
                        UyariPenceresi showmes = new UyariPenceresi("Kullanıcı Güncelleme Başarısız");
                        showmes.Show();
                    }
                }
            }
            else
            {
                UyariPenceresi showmes = new UyariPenceresi(message);
                showmes.Show();
            }
        }
        /// <summary>
        /// Yeni Kullanıcı Ekleme Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_Kullanici_Ekle_Click(object sender, EventArgs e)
        {
            string ad      = textBox_newUserAd.Text;
            int    control = 0;
            string message = "";

            if (ad == "")
            {
                control++;
                message += control + "- Ad alanı boş bırakılamaz \n";
            }
            string soyad = textBox_newUserSoyad.Text;

            if (soyad == "")
            {
                control++; message += control + "- Soyad alanı boş bırakılamaz \n";
            }
            string mail = textBox_newUserMail.Text;

            if (mail == "")
            {
                control++; message += control + "- Mail alanı boş bırakılamaz \n";
            }
            string tcno = textBox_newUserTc.Text;

            if (tcno == "")
            {
                control++;  message += control + "- Tc No alanı boş bırakılamaz \n";
            }
            string telno = maskedTextBox_newUserTel.Text;

            if (telno == "")
            {
                control++;    message += control + "- Telefon Numarası alanı boş bırakılamaz \n";
            }
            string adres = richTextBoxAdresBilgisi.Text;
            string sifre = textBox_newUserSifre.Text;

            if (sifre == "")
            {
                control++;    message += control + "- Şifre alanı boş bırakılamaz \n";
            }
            int role = 0;
            int cinsiyet;

            if (radioButtonErkek.Checked != false)
            {
                cinsiyet = 1;
            }
            else
            {
                cinsiyet = 0;
            }

            if (control == 0)
            {
                string response = BLL.Users.kullaniciEkle(ad, soyad, tcno, sifre, role, mail, telno, adres, cinsiyet);

                if (response.Equals("True"))
                {
                    UyariPenceresi showmes = new UyariPenceresi("Kullanıcı Başarıyla Eklendi");
                    showmes.Show();
                    updateDataGridViews();
                    button_Kullanici_Ekle.Enabled = false;
                }
                else
                {
                    UyariPenceresi showmes = new UyariPenceresi("Kullanıcı Ekleme Başarısız");
                    showmes.Show();
                }
            }
            else
            {
                UyariPenceresi showmes = new UyariPenceresi(message);
                showmes.Show();
            }
        }