private void btnGiris_Click(object sender, EventArgs e) { if (txtUserNo.Text.Trim() == "") { MessageBox.Show("Kullanıcı No Boş"); } else if (txtPassword.Text.Trim() == "") { MessageBox.Show("Şifre boş"); } else { List <PERSONEL> list = PersonelBLL.PersonelGetir(Convert.ToInt32(txtUserNo.Text), txtPassword.Text); if (list.Count <= 0) { MessageBox.Show("Kullanıcı Adı ve şifre hatalı"); } else { PERSONEL per = list.First(); UserStatic.PersonelID = per.ID; UserStatic.isAdmin = per.isAdmin; UserStatic.UserNo = per.UserNo; FrmMain frm = new FrmMain(); this.Hide(); frm.ShowDialog(); } } }
public ActionResult CV(int?id) { PERSONEL p = new PERSONEL(); if (id != null) { p = db.PERSONELs.Find(id); if (p == null) { p = new PERSONEL(); } ViewData["calistigi_yer"] = db. CALISTIGI_YER.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO)).ToList(); ViewData["yabanci_dil"] = db. YABANCI_DIL.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO)).ToList(); ViewData["egitim"] = db. EGITIMs.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO)).ToList(); ViewData["kurs"] = db. KURS.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO)).ToList(); ViewData["sertifika"] = db. SERTIFIKAs.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO)).ToList(); } return(View(p));//model binding yapıyoruz. }
public ActionResult SaveRecord(PERSONEL model) { try { BasvuruEntities3 DB = new BasvuruEntities3(); PERSONEL pr = new PERSONEL(); pr.ADSOYAD = model.ADSOYAD; pr.ILID = model.ILID; pr.ILCEID = model.ILCEID; pr.DOGUMTARIHI = model.DOGUMTARIHI; pr.ACIKLAMA = model.ACIKLAMA; pr.CINSIYET = model.CINSIYET; DB.PERSONELs.Add(pr); DB.SaveChanges(); int latestPrId = pr.ID; ViewBag.Message = "Kişi Başarıyla Kaydedildi"; TempData["prid"] = latestPrId; } catch (Exception ex) { throw ex; } return(RedirectToAction("Job")); }
public ActionResult GÜNCELLE(PERSONEL p1) { var prs = db.PERSONEL.Find(p1.personelid); prs.personelad = p1.personelad; prs.personelsoyad = p1.personelsoyad; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult IzinKarti(int?id) { PERSONEL p = new PERSONEL(); if (id != null) { p = db.PERSONELs.Find(id); if (p == null) { p = new PERSONEL(); } ViewData["izin"] = db.IZINs.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO)).ToList(); ViewData["onayyoksa"] = db.IZINs.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO) && s.DURUM_REFNO == 1).Count(); var onayyoksa = ViewData["onayyoksa"]; if (Convert.ToInt32(onayyoksa) >= 1) { MessageBox.Show("Son izniniz henüz onaylanmadı. !", "Bilgilendirme Penceresi"); return(RedirectToAction("Index")); } ViewData["toplamgun"] = db.IZINs.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO) && s.DURUM_REFNO == 2).Sum(s1 => s1.GUN).ToString(); var toplamgun = ViewData["toplamgun"]; TimeSpan zaman = new TimeSpan(); DateTime d1, d2 = new DateTime(); d1 = p.ISE_BASLAMA_TARIHI; d2 = DateTime.Today; zaman = d2 - d1; int isebaslama = Math.Abs(zaman.Days); if (isebaslama < 365) { MessageBox.Show("Bir yıllık çalışma süreniz dolmadığı için izniniz kabul edilmemiştir. !", "Bilgilendirme Penceresi"); return(RedirectToAction("Index")); } if (Convert.ToInt32(toplamgun) > 15) { MessageBox.Show("Yıllık izniniz dolduğu için izniniz kabul edilmemiştir. !", "Bilgilendirme Penceresi"); return(RedirectToAction("Index")); } ViewData["isebaslama"] = isebaslama.ToString(); } return(View(p));//model binding yapıyoruz. }
public static void PersonelEkle(PERSONEL pr) { try { db.PERSONELs.InsertOnSubmit(pr); db.SubmitChanges(); } catch (Exception ex) { throw ex; } }
public ActionResult Delete(int?id) { if (id != null)//id istek içerisinde varsa { PERSONEL s = db.PERSONELs.Find(id); if (s != null)//id kullanıcılarda varsa { db.PERSONELs.Remove(s); db.SaveChanges(); } } return(RedirectToAction("Index")); }
public static void PersonelMaasGuncelle(MaasDetayDTO maas) { try { PERSONEL pr = db.PERSONELs.First(x => x.ID == maas.PersoneID); pr.Maas = maas.MaasMiktar; db.SubmitChanges(); } catch (Exception ex) { throw ex; } }
public static void PersonelSil(int personeID) { try { PERSONEL pr = db.PERSONELs.First(x => x.ID == personeID); db.PERSONELs.DeleteOnSubmit(pr); db.SubmitChanges(); } catch (Exception ex) { throw ex; } }
public ActionResult KalanGun(int?id) { PERSONEL p = new PERSONEL(); if (id != null) { p = db.PERSONELs.Find(id); if (p == null) { p = new PERSONEL(); } ViewData["izin"] = db.IZINs.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO)).ToList(); ViewData["onayyoksa"] = db.IZINs.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO) && s.DURUM_REFNO == 1).Count(); var onayyoksa = ViewData["onayyoksa"]; if (Convert.ToInt32(onayyoksa) >= 1) { MessageBox.Show("Son izniniz henüz onaylanmadı. !", "Bilgilendirme Penceresi"); return(RedirectToAction("Index")); } ViewData["toplamgun"] = db.IZINs.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO) && s.DURUM_REFNO == 2).Sum(s1 => s1.GUN).ToString(); var toplamgun = ViewData["toplamgun"]; var sayi = 15; if (Convert.ToInt32(toplamgun) > 15) { MessageBox.Show("Yıllık izniniz dolduğu için izniniz kabul edilmemiştir. !", "Bilgilendirme Penceresi"); return(RedirectToAction("Index")); } if (Convert.ToInt32(toplamgun) <= 15) { MessageBox.Show("Kullandığınız izin sayısı:" + toplamgun + " Kalan izin sayısı: " + (sayi - Convert.ToInt32(toplamgun)), "Bilgilendirme Penceresi"); return(RedirectToAction("Index")); } } return(View(p));//model binding yapıyoruz. }
public ActionResult Maas(int?id) { PERSONEL p = new PERSONEL(); if (id != null) { p = db.PERSONELs.Find(id); if (p == null) { return(Content("Personel Bulunamadı")); } } return(Content(p.AYLIK_UCRET.ToString())); }
public static void EditPersonel(string id, string fname, string lname, string password, string active) { //Create new Employee LINQDataContext db = new LINQDataContext(); PERSONEL Personel = db.PERSONEL.First(e => e.id_personel.Equals(id)); Personel.first_name = fname; Personel.last_name = lname; Personel.password = password; Personel.active = active; //Edit Employee to database db.SubmitChanges(); return; }
public ActionResult Create(int?id) { PERSONEL p = new PERSONEL(); if (id != null) { p = db.PERSONELs.Find(id); if (p == null) { p = new PERSONEL(); } } ViewData["departman"] = db.DEPARTMAN.ToList(); ViewData["kullanici"] = db.KULLANICIs.ToList(); return(View(p));//model binding yapıyoruz. }
public HttpResponseMessage Post([FromBody] PERSONEL per) { per.PERSONEL_AD = per.PERSONEL_AD.ToUpper(); per.PERSONEL_SOYAD = per.PERSONEL_SOYAD.ToUpper(); per.YAPTIGI_IS = per.YAPTIGI_IS.ToUpper(); db.PERSONEL.Add(per); if (db.SaveChanges() > 0) { return(Request.CreateResponse(HttpStatusCode.Created, per)); } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Uygunsuzluk Ekleme İşlemi Yapılamadı!")); } }
public ActionResult Index(string arama) { PERSONEL p = new PERSONEL(); List <IZIN> liste = db.IZINs.ToList(); if (arama == null) { arama = ""; liste = db.IZINs.ToList(); } else { liste = db.IZINs.Where(s => s.PERSONEL.ADI_SOYADI.Contains(arama)).ToList(); } ViewData["veri"] = arama; ViewData["onay"] = db.IZINs.Where(s => s.PERSONEL_REFNO.Equals(p.PERSONEL_REFNO) && s.DURUM_REFNO == 2).ToList(); return(View(liste)); }
public static void AddPersonel(string fname, string lname, string login, string role, string password, string active) { //Create new Employee LINQDataContext db = new LINQDataContext(); PERSONEL newPersonel = new PERSONEL(); newPersonel.first_name = fname; newPersonel.last_name = lname; newPersonel.login = login; newPersonel.password = password; newPersonel.role = role; newPersonel.active = active; //Add new Employee to database db.PERSONEL.InsertOnSubmit(newPersonel); //Save changes to Database. db.SubmitChanges(); return; }
public ActionResult AyniTarih(int?id, int ay, int yil) { PERSONEL p = new PERSONEL(); if (id != null) { var liste = db.MAAS.ToList(); var aynitarih = liste.Where(s => s.PERSONEL_REFNO == id && s.AY == ay && s.YIL == yil).FirstOrDefault <MAA>(); if (aynitarih == null) { return(Content(p.AYLIK_UCRET.ToString())); } return(Content("false")); } return(Content("id git")); }
public ActionResult Create(PERSONEL p, HttpPostedFileBase RESIM) { ViewData["departman"] = db.DEPARTMAN.ToList(); ViewData["kullanici"] = db.KULLANICIs.ToList(); if (RESIM != null) { p.RESIM = RESIM.FileName; } if (p.PERSONEL_REFNO == 0) { db.PERSONELs.Add(p); } else { db.Entry(p).State = System.Data.Entity.EntityState.Modified; } if (RESIM != null) { RESIM.SaveAs(Request.PhysicalApplicationPath + "/Images/" + RESIM.FileName); //resim yükleme } db.SaveChanges(); return(RedirectToAction("Index")); //listeleme yapılıyor. }
public ActionResult CheckUser(string KULLANICI_ADI, string PAROLA) { KULLANICI kullanici = db.KULLANICIs.Where(k => k.KULLANICI_ADI == KULLANICI_ADI && k.PAROLA == PAROLA).SingleOrDefault(); if (kullanici != null) { Helpers.SessionHelper <KULLANICI> .SetSessionItem("kullanici", kullanici); PERSONEL p = db.PERSONELs.Where(p1 => p1.KULLANICI_REFNO == kullanici.KULLANICI_REFNO).FirstOrDefault(); Helpers.SessionHelper <PERSONEL> .SetSessionItem("personel", p); FormsAuthentication.SetAuthCookie(KULLANICI_ADI, false);//session da değilde cookie de tutuyor false olanda pc bunu tutsun mu diye return(RedirectToAction("index", "home")); } else { ViewBag.LoginError = "Kullanıcı Adı veya Parola Yanlış"; } return(View("Index")); }
public ActionResult LogIn(UyeKayit u, PERSONEL p) { var bilgiler = db.UyeKayit.FirstOrDefault(x => x.KULLANICIADI == u.KULLANICIADI && x.SIFRE == u.SIFRE); var degerler = db.PERSONEL.FirstOrDefault(x => x.KULLANICIADI == p.KULLANICIADI && x.SIFRE == p.SIFRE); if (bilgiler != null) { Session["Kullanıcı"] = u.KULLANICIADI; FormsAuthentication.SetAuthCookie(bilgiler.SIFRE, false); return(RedirectToAction("GirisYap", "Home")); } else if (degerler != null) { Session["Kullanıcı"] = "Admin"; FormsAuthentication.SetAuthCookie(degerler.SIFRE, false); return(RedirectToAction("Index", "Uye")); } else { ViewBag.Message = "Kullanıcı adı veya Şifre hatalı.."; return(View()); } }
public static void PersonelGuncelle(PersonelDetayDTO pr) { try { PERSONEL per = db.PERSONELs.First(x => x.ID == pr.PersoneID); per.UserNo = pr.UserNo; per.Ad = pr.Ad; per.Adres = pr.Adres; per.DepartmanID = pr.DepartmanID; per.DogumGunu = pr.DogumTarihi; per.isAdmin = pr.isAdmin; per.Maas = pr.Maas; per.Password = pr.password; per.PozisyonID = pr.PozisyonID; per.Resim = pr.Resim; per.Soyad = pr.Soyad; db.SubmitChanges(); } catch (Exception ex) { throw ex; } }
public static void PersonelEkle(PERSONEL pr) { PersonelDAO.PersonelEkle(pr); }
private void btnKaydet_Click(object sender, EventArgs e) { if (txtUserNo.Text.Trim() == "") { MessageBox.Show("User No"); } else if (PersonelBLL.isUnique(Convert.ToInt32(txtUserNo.Text))) { MessageBox.Show("Lütfen userno değiştirin zaten bunu kullanan bir personel mevcut"); } else if (txtAd.Text.Trim() == "") { MessageBox.Show("Ad"); } else if (txtSoyad.Text.Trim() == "") { MessageBox.Show("SoyAd"); } else if (txtMaas.Text.Trim() == "") { MessageBox.Show("Maaş"); } else if (txtPassword.Text.Trim() == "") { MessageBox.Show("Şifre"); } else if (txtResim.Text.Trim() == "") { MessageBox.Show("resim"); } else if (cmbDepartman.SelectedIndex == -1) { MessageBox.Show("Departman"); } else if (cmbPozisyon.SelectedIndex == -1) { MessageBox.Show("Pozisyon"); } else { if (isUpdate) { DialogResult result = MessageBox.Show("Eminmisin?", "Dikkat", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { PersonelDetayDTO pr = new PersonelDetayDTO(); pr.PersoneID = detay.PersoneID; pr.UserNo = Convert.ToInt32(txtUserNo.Text); pr.Ad = txtAd.Text; pr.Soyad = txtSoyad.Text; pr.Maas = Convert.ToInt32(txtMaas.Text); pr.isAdmin = chisAdmin.Checked; pr.password = txtPassword.Text; pr.PozisyonID = Convert.ToInt32(cmbPozisyon.SelectedValue); pr.DepartmanID = Convert.ToInt32(cmbDepartman.SelectedValue); pr.DogumTarihi = dateTimePicker1.Value; pr.Adres = txtAdress.Text; if (resim2 != txtResim.Text) { pr.Resim = resimad; if (File.Exists(resim2)) { File.Delete(resim2); } File.Copy(txtResim.Text, @"resimler\\" + resimad); } else { pr.Resim = detay.Resim; } PersonelBLL.PersonelGuncelle(pr); MessageBox.Show("Güncellendi"); this.Close(); } } else { PERSONEL pr = new PERSONEL(); pr.UserNo = Convert.ToInt32(txtUserNo.Text); pr.Ad = txtAd.Text; pr.Soyad = txtSoyad.Text; pr.Maas = Convert.ToInt32(txtMaas.Text); pr.isAdmin = chisAdmin.Checked; pr.Password = txtPassword.Text; pr.PozisyonID = Convert.ToInt32(cmbPozisyon.SelectedValue); pr.DepartmanID = Convert.ToInt32(cmbDepartman.SelectedValue); pr.DogumGunu = dateTimePicker1.Value; pr.Adres = txtAdress.Text; pr.Resim = resimad; PersonelBLL.PersonelEkle(pr); File.Copy(txtResim.Text, @"resimler\\" + resimad); MessageBox.Show("PersonelEklendi"); txtUserNo.Clear(); txtAd.Clear(); txtSoyad.Clear(); txtMaas.Clear(); chisAdmin.Checked = false; txtPassword.Clear(); cmbDepartman.SelectedIndex = -1; cmbPozisyon.DataSource = dto.Pozisyonlar; cmbPozisyon.SelectedIndex = -1; dateTimePicker1.Value = DateTime.Today; txtAdress.Clear(); txtResim.Clear(); resimad = ""; } } }
public ActionResult YENİPERSONEL(PERSONEL p2) { db.PERSONEL.Add(p2); db.SaveChanges(); return(View()); }