示例#1
0
        private void btnCalcikar_Click(object sender, EventArgs e)
        {
            lblcalerror.Visible = false;
            int calid             = Convert.ToInt32(txtkullid.Text);
            List <Calisanlar> cal = db.Calisanlars.Where(c => c.id == calid).ToList();

            if (txtkullid.Text != "" && cal.Count() != 0)
            {
                DialogResult res = MessageBox.Show("Bu Çalışanı İşten Çıkarmak İstediğinize Emin Misiniz ?", "Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (res == DialogResult.Yes)
                {
                    Calisanlar calisan  = db.Calisanlars.Where(c => c.id == calid).First();
                    ACalisan   acalisan = db.ACalisans.Where(c => c.id == calid).First();
                    db.Calisanlars.Remove(calisan);
                    db.ACalisans.Remove(acalisan);
                    db.SaveChanges();
                    FormYonFuncs.LogFonk(Form1.Yid, Form1.Yad, Form1.Ysoyad, calid + " ID'li, " + calisan.ad + " " + calisan.soyad + " İsimli Kullanıcı İşten Çıkarıldı !");
                    MessageBox.Show(calid + " ID'li Kullanıcı İşten Çıkarıldı !", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtkullid.Text = "";
                }
            }
            else
            {
                lblcalerror.Visible = true;
                lblcalerror.Text    = "Bu ID'de Bir Kullanıcı Yok";
            }
        }
示例#2
0
        private void btnGbDuzenle_Click(object sender, EventArgs e)
        {
            lbliderror.Visible = false;
            Kullanici kull   = db.Kullanicis.Where(c => c.id == id).First();
            string    updLog = id + " ID'li, " + kull.ad + " " + kull.soyad + " İsimli Kullanıcının Bilgilerini Güncelledi";

            if (txtSifre.Text != "")
            {
                kull.sifre = txtSifre.Text;
                updLog     = id + " ID'li, " + kull.ad + " " + kull.soyad + " İsimli Kullanıcının Bilgilerini ve Şifresini Güncelledi !";
            }
            if (txtAd.Text != "")
            {
                kull.ad = txtAd.Text;
            }
            if (txtSoyad.Text != "")
            {
                kull.soyad = txtSoyad.Text;
            }
            if (txtTelno.Text != "")
            {
                kull.telNo = txtTelno.Text;
            }
            if (txtMaas.Text != "")
            {
                kull.maas = Convert.ToInt32(txtMaas.Text);
            }
            if (txtAdres.Text != "")
            {
                kull.adres = txtAdres.Text;
            }
            if (txtSifre.Text == "" && txtAd.Text == "" && txtSoyad.Text == "" && txtTelno.Text == "" && txtMaas.Text == "" && txtAdres.Text == "")
            {
                lblkullduzerror.Visible = true;
                lblkullduzerror.Text    = "En Az Bir Alan Doldurulmalıdır !";
            }
            else
            {
                lblkullduzerror.Visible = false;
            }
            db.SaveChanges();
            FormYonFuncs.LogFonk(Form1.Yid, Form1.Yad, Form1.Ysoyad, updLog);
            gbKullDuzenle.Visible = false;
            txtSifre.Text         = ""; txtAd.Text = ""; txtSoyad.Text = ""; txtTelno.Text = ""; txtMaas.Text = ""; txtAdres.Text = ""; txtId.Text = "";
            MessageBox.Show("İşlem Başarıyla Gerçekleşti", "Onay", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#3
0
 private void grid_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (calisanController == 1 || calisanController == 2)
     {
         int b = grid.CurrentCell.RowIndex;
         gbCalisanGuncelle.Visible = true;
         gbCalisanGuncelle.BringToFront();
         string kulAd    = grid[1, b].Value.ToString();
         string kulSoyad = grid[2, b].Value.ToString();
         if (calisanController == 1)
         {
             cal = db.Calisanlars.Where(c => c.ad == kulAd && c.soyad == kulSoyad).Select(c => c.id).First();
         }
         else if (calisanController == 2)
         {
             izi = db.Izinlilers.Where(c => c.ad == kulAd && c.soyad == kulSoyad).Select(c => c.id).First();
         }
     }
     else if (calisanController == 3)
     {
         int          b        = grid.CurrentCell.RowIndex;
         string       dilTarih = grid[0, b].Value.ToString();
         string       dilAd    = grid[1, b].Value.ToString();
         string       dilSoyad = grid[2, b].Value.ToString();
         Dilekceler   dilekce  = db.Dilekcelers.Where(c => c.tarih == dilTarih && c.ad == dilAd && c.soyad == dilSoyad).First();
         DialogResult result   = MessageBox.Show(dilTarih + " Tarihli Dilekçeyi Gerçekten Kaldırmak İstiyor Musunuz ?", "Dilekçe Kaldırma", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
         if (result == DialogResult.Yes)
         {
             db.Dilekcelers.Remove(dilekce);
             db.SaveChanges();
             grid.Refresh();
             FormYonFuncs.LogFonk(Form1.Yid, Form1.Yad, Form1.Ysoyad, dilTarih + " Tarihli, " + dilAd + " " + dilSoyad + " Tarafından Yazılan Dilekçeyi Kaldırdı");
         }
     }
     else if (calisanController == 4)
     {
         int b = grid.CurrentCell.RowIndex;
         BKad    = grid[1, b].Value.ToString();
         BKsoyad = grid[2, b].Value.ToString();
         BKtel   = grid[3, b].Value.ToString();
         BKadres = grid[5, b].Value.ToString();
         BKcins  = grid[9, b].Value.ToString();
         BasvuruKabul BK = new BasvuruKabul();
         BK.Show();
     }
 }
示例#4
0
        //KULLANICI İŞTEN ÇIKAR
        private void btnKullcikar_Click(object sender, EventArgs e)
        {
            id = Convert.ToInt32(txtId.Text);
            List <Kullanici> kull = db.Kullanicis.Where(c => c.id == id).ToList();

            if (txtId.Text != "" && kull.Count() != 0)
            {
                DialogResult res = MessageBox.Show("Bu Kullanıcıyı İşten Çıkarmak İstediğinize Emin Misiniz ?", "Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (res == DialogResult.Yes)
                {
                    Kullanici kullanici = db.Kullanicis.Where(c => c.id == id).First();
                    db.Kullanicis.Remove(kullanici);
                    db.SaveChanges();
                    FormYonFuncs.LogFonk(Form1.Yid, Form1.Yad, Form1.Ysoyad, id + " ID'li Kullanıcı İşten Çıkarıldı !");
                    MessageBox.Show(id + " ID'li Kullanıcı İşten Çıkarıldı !", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                lbliderror.Visible = true;
                lbliderror.Text    = "Bu ID'de Bir Kullanıcı Yok";
            }
        }
 private void btnAdmin_Click(object sender, EventArgs e)
 {
     using (var db = new IKYSEntities())
     {
         var admins  = db.Yoneticis.ToList();
         int control = 1;
         if (txtAd.Text == "" || txtSifre.Text == "")
         {
             MessageBox.Show("Alanlar Boş Bırakılamaz", "Hatalı Giriş", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             foreach (var admin in admins)
             {
                 if (Convert.ToInt32(txtAd.Text) == admin.id && txtSifre.Text == admin.sifre)
                 {
                     Yad = admin.ad; Ysoyad = admin.soyad; Yid = admin.id; Yfoto = admin.foto;
                     FormYonFuncs.LogFonk(admin.id, admin.ad, admin.soyad, "Sisteme Giriş Yaptı");
                     FormY f = new FormY();
                     f.Show();
                     this.Hide();
                     control = 1;
                     break;
                 }
                 else
                 {
                     control = 0;
                 }
             }
             if (control == 0)
             {
                 MessageBox.Show("Kullanıcı Adı veya Şifre Yanlış", "Hatalı Giriş", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 FormYonFuncs.LogFonk(404, "UYARI", "UYARI", txtAd.Text + " ID'li Yöneticinin Hesabına, Yanlış Şifreyle Giriş Denemesi Yapıldı !");
             }
         }
     }
 }
 private void btnApply_Click(object sender, EventArgs e)
 {
     using (IKYSEntities db = new IKYSEntities())
     {
         if (txtDpt.Text != "" && txtMail.Text != "" && txtSgk.Text != "")
         {
             int id1 = db.Calisanlars.Select(c => c.id).Max();
             int id2 = db.Izinlilers.Select(c => c.id).Max();
             int id;
             if (id1 > id2)
             {
                 id = id1;
             }
             else
             {
                 id = id2;
             }
             Calisanlar calis = new Calisanlar()
             {
                 id        = id + 1,
                 departman = txtDpt.Text,
                 ad        = label1.Text,
                 soyad     = label2.Text,
                 telNo     = label3.Text,
                 sgNo      = txtSgk.Text,
                 adres     = adres,
                 cinsiyet  = cinsiyet,
                 mail      = txtMail.Text
             };
             db.Calisanlars.Add(calis);
             if (FormY.BKad != "")
             {
                 ACalisan calisan = new ACalisan()
                 {
                     id   = id + 1,
                     maas = Convert.ToInt32(txtMaas.Text),
                     tcNo = txtTC.Text
                 };
                 db.ACalisans.Add(calisan);
             }
             else
             {
                 ACalisan calisan = new ACalisan()
                 {
                     id   = id + 1,
                     maas = null,
                     tcNo = null
                 };
                 db.ACalisans.Add(calisan);
             }
             Basvurular bas = db.Basvurulars.Where(c => c.basAd == label1.Text && c.basSoyad == label2.Text).First();
             db.Basvurulars.Remove(bas);
             db.SaveChanges();
             updLog = label1.Text + " " + label2.Text + " Adlı Kişinin İş Başvurusunu Kabul Etti ve " + txtDpt.Text + " Departmanında Göreve Aldı";
             if (FormK.BKad != "")
             {
                 FormKFunctions.LogFonk(Form1.id, Form1.ad, Form1.soyad, updLog);
             }
             else if (FormY.BKad != "")
             {
                 FormYonFuncs.LogFonk(Form1.Yid, Form1.Yad, Form1.Ysoyad, updLog);
             }
             this.Close();
         }
         else
         {
             label10.Visible = true;
             label10.Text    = "Tüm Alanların Doldurulması Zorunludur !";
         }
     }
 }