Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (dataGridView1.CurrentRow == null)
            {
                return;
            }

            DialogResult sonuc = MessageBox.Show("Seçili Kaydı Silmek İstiyormusunuz?",
                                                 "Satış Programı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (sonuc == DialogResult.Yes)
            {
                int id = Convert.ToInt32(dataGridView1.CurrentRow.Cells["KullanicilarID"].Value.ToString());
                DataLogic.KULLANICILAR m = new DataLogic.KULLANICILAR();
                int a = m.silKullanicilar(id);
                if (a == 1)
                {
                    MessageBox.Show("İşleminiz Gerçekleştirildi",
                                    "Satış Programı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    temizle();
                    tabloyuDoldur();
                }
                else
                {
                    MessageBox.Show("İşleminiz Yapılamadı",
                                    "Satış Programı", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Ejemplo n.º 2
0
        private void btnGiris_Click(object sender, EventArgs e)
        {
            DataLogic.KULLANICILAR kullanicilar = new DataLogic.KULLANICILAR();
            Entities.KULLANICILAR  d            = new Entities.KULLANICILAR();

            d.KullaniciAdi = textBox1.Text;
            d.Sifre        = textBox2.Text;

            int a = -1;

            a = kullanicilar.getirKullanicilarID(d);

            if (a == 0)
            {
                MessageBox.Show("Kullanıcı adı veya şifre yanlış.", "Satış Programı", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                AnaEkran f = new AnaEkran();
                f.kullaniciAdi = textBox1.Text;
                f.sorumluID    = a;
                f.Show();
                this.Hide();
                //MessageBox.Show("Başarılı.", "Satış Programı", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 3
0
        void tabloyuDoldur()
        {
            DataLogic.KULLANICILAR kullanicilar = new DataLogic.KULLANICILAR();
            dt = new DataTable();

            dt = kullanicilar.getirKullanicilar();
            dataGridView1.DataSource = dt;
        }
Ejemplo n.º 4
0
        private void AnaEkran_Load(object sender, EventArgs e)
        {
            DataLogic.KULLANICILAR k = new DataLogic.KULLANICILAR();
            label1.Text = "Hoş Geldiniz: " + k.getirKullanicilarAdiSoyadi(kullaniciAdi);

            if (k.getirKullanicilarTuru(kullaniciAdi) == "True")
            {
                button1.Enabled = true;
            }
            else
            {
                button1.Enabled = false;
            }
        }
Ejemplo n.º 5
0
        private void button5_Click(object sender, EventArgs e)
        {
            DataLogic.KULLANICILAR kullanicilar = new DataLogic.KULLANICILAR();
            Entities.KULLANICILAR  d            = new Entities.KULLANICILAR();

            d.AdSoyad      = textBox1.Text;
            d.KullaniciAdi = textBox2.Text;
            d.Sifre        = textBox3.Text;

            if (comboBox1.SelectedIndex == 0)
            {
                d.KullaniciTuru = true;
            }
            else
            {
                d.KullaniciTuru = false;
            }

            int a = -1;

            if (textBoxID.Text != "") //ID nin tutulduğu textBox
            {
                d.KullanicilarID = Convert.ToInt32(textBoxID.Text);
                a = kullanicilar.guncelleKullanicilar(d);
            }
            else
            {
                a = kullanicilar.kaydetKullanicilar(d);
            }

            if (a == 2 || a == 3)
            {
                MessageBox.Show("İşleminiz Gerçekleştirildi", "Satış Programı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                temizle();
            }
            else
            {
                MessageBox.Show("İşleminiz Yapılamadı", "Satış Programı", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            tabloyuDoldur();
        }