예제 #1
0
        public ActionResult GirisYap(TBLUYELER t, TBLPERSONEL p)
        {
            var bilgiler  = db.TBLUYELER.FirstOrDefault(x => x.MAIL == t.MAIL && x.SIFRE == t.SIFRE);
            var bilgiler2 = db.TBLPERSONEL.FirstOrDefault(y => y.MAIL == p.MAIL && y.SIFRE == p.SIFRE);

            if (bilgiler != null)
            {
                FormsAuthentication.SetAuthCookie(bilgiler.MAIL, false);
                Session["Mail"]  = bilgiler.MAIL.ToString();
                Session["Ad"]    = bilgiler.AD.ToString();
                Session["Soyad"] = bilgiler.SOYAD.ToString();
                //TempData["Id"] = bilgiler.ID.ToString();
                //TempData["Ad"] = bilgiler.AD.ToString();
                //TempData["Soyad"] = bilgiler.SOYAD.ToString();
                //TempData["KullanıcıAdı"] = bilgiler.KULLANICIADI.ToString();
                //TempData["Sifre"] = bilgiler.SIFRE.ToString();
                //TempData["Okul"] = bilgiler.OKUL.ToString();
                return(RedirectToAction("Index", "Panelim"));
            }
            if (bilgiler2 != null)
            {
                FormsAuthentication.SetAuthCookie(bilgiler2.MAIL, false);
                Session["Mail"] = bilgiler2.MAIL.ToString();
                return(RedirectToAction("Index", "istatistik"));
            }
            else
            {
                return(View());
            }
        }
예제 #2
0
        public ActionResult PersonelEkle(TBLPERSONEL p)
        {
            if (!ModelState.IsValid)
            {
                return(View("PersonelEkle"));
            }

            db.TBLPERSONEL.Add(p);
            db.SaveChanges();
            return(RedirectToAction("Index"));


            /*if (string.IsNullOrEmpty(p.PERSONAL))
             * {
             *  ViewBag.mesaj = "Lütfen Personel Adı Giriniz.";
             *
             * }
             * else
             * {
             *  db.TBLPERSONEL.Add(p);
             *  db.SaveChanges();
             *  return RedirectToAction("Index");
             * }
             * return View();*/
        }
예제 #3
0
        public JsonResult PersonelTest()
        {
            var         routeValue = RouteData.Values["id"];
            TBLPERSONEL personel   = new TBLPERSONEL();

            SqlConnection conn = new SqlConnection("Data Source=ESRA\\SQLEXPRESS; Initial Catalog=isTakip;integrated security=True;MultipleActiveResultSets=True;");

            conn.Open();
            SqlCommand command = new SqlCommand("SELECT  PERSONEL_KOD, PERSONEL_ADI, PERSONEL_SOYADI,TEL_NO FROM " +
                                                "TBLPERSONEL WHERE PERSONEL_KOD ='" + routeValue + "'", conn);

            DataTable      dataTable      = new DataTable();
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(command);

            sqlDataAdapter.Fill(dataTable);
            sqlDataAdapter.Dispose();

            if (command != null)
            {
                for (int i = 0; i < dataTable.Rows.Count; i++)
                {
                    personel.PERSONEL_KOD    = dataTable.Rows[i]["PERSONEL_KOD"].ToString();
                    personel.PERSONEL_ADI    = dataTable.Rows[i]["PERSONEL_ADI"].ToString();
                    personel.PERSONEL_SOYADI = dataTable.Rows[i]["PERSONEL_SOYADI"].ToString();
                    personel.TEL_NO          = dataTable.Rows[0]["TEL_NO"].ToString();
                }
            }
            return(Json(personel, JsonRequestBehavior.AllowGet));

            //count = Convert.ToInt16(command.ExecuteScalar());
        }
예제 #4
0
        public ActionResult PersonelGuncelle(TBLPERSONEL p)
        {
            var prs = db.TBLPERSONEL.Find(p.ID);

            prs.PERSONEL = p.PERSONEL; // diğer taraftan guncelle komutu ile gelen adı ktg ya-e attık
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #5
0
        public ActionResult Guncelle(TBLPERSONEL p)
        {
            var deger = db.TBLPERSONEL.Find(p.ID);

            deger.PERSONEL = p.PERSONEL;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult PersonelGuncelle(TBLPERSONEL p)
        {
            var prs = db.TBLPERSONEL.Find(p.ID);

            prs.PERSONEL = p.PERSONEL;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #7
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            TBLPERSONEL t = new TBLPERSONEL();

            t.PERSONELID      = byte.Parse(TextBox1.Text);
            t.PERSONELADSOYAD = TextBox2.Text;
            db.TBLPERSONEL.Add(t);
            db.SaveChanges();
        }
예제 #8
0
 public ActionResult PersonelEkle(TBLPERSONEL per)
 {
     if (!ModelState.IsValid)
     {
         return(View("PersonelEkle"));
     }
     db.TBLPERSONEL.Add(per);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public ActionResult PersonelEkle(TBLPERSONEL p)
 {
     if (!ModelState.IsValid)
     {
         return(View("PersonelEkle"));
     }
     db.TBLPERSONEL.Add(p);
     db.SaveChanges();
     return(View());
 }
예제 #10
0
 [HttpPost]                                      //sayfaya veri gönderme işlemi gerçekleşince burası çalışsın
 public ActionResult PersonelEkle(TBLPERSONEL p) //p yi kategoriyi eklerken göndereceğimiz değer
 {
     if (!ModelState.IsValid)
     {
         return(View("PersonelEkle"));
     }
     db.TBLPERSONEL.Add(p);
     db.SaveChanges();
     return(View());//sayfayı geri döndürüyor
 }
예제 #11
0
        public ActionResult PersonelEkle(TBLPERSONEL tblprEkle)
        {
            if (!ModelState.IsValid)
            {
                return(View("PersonelEkle"));
            }
            db.TBLPERSONEL.Add(tblprEkle);//Personel tablomuza ekleme yaptık
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
예제 #12
0
 public ActionResult YeniPersonel(TBLPERSONEL p)
 {
     if (!ModelState.IsValid)
     {
         return(View("YeniPersonel"));
     }
     db.TBLPERSONEL.Add(p);
     db.SaveChanges();
     MessageBox.Show("Ekleme İşlemi Tamamlandı!", "Bilgilendirme Penceresi");
     return(View());
 }
예제 #13
0
        //seçilen personelin bilgilerini güncelleme
        public ActionResult Guncelle(TBLPERSONEL per)
        {
            if (!ModelState.IsValid)
            {
                return(View("PersonelGetir"));
            }
            var k = db.TBLPERSONEL.Find(per.ID);

            k.PERSONEL = per.PERSONEL;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            TBLPERSONEL p = new TBLPERSONEL();

            p.ID        = short.Parse(txtID.Text);
            p.AD        = txtAd.Text;
            p.SOYAD     = txtSoyad.Text;
            p.TELEFON   = txtTelefon.Text;
            p.DEPARTMAN = byte.Parse(lookUpEdit1.EditValue.ToString());
            db.TBLPERSONEL.Add(p);
            db.SaveChanges();
            MessageBox.Show("Personel Başarıyla Kaydedildi.");
        }
예제 #15
0
        public ActionResult AdminGirisYap(TBLPERSONEL P)
        {
            var bilgiler = db.TBLPERSONEL.FirstOrDefault(x => x.PERSONEL == P.PERSONEL && x.SIFRE == P.SIFRE);

            if (bilgiler != null)
            {
                FormsAuthentication.SetAuthCookie(bilgiler.PERSONEL, false);
                return(RedirectToAction("Index", "istatistik"));
            }
            else
            {
                return(View());
            }
        }
예제 #16
0
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            TBLPERSONEL t = new TBLPERSONEL();

            t.AD        = TxtAd.Text;
            t.SOYAD     = TxtSoyad.Text;
            t.DEPARTMAN = byte.Parse(lookUpEdit1.EditValue.ToString());
            t.MAIL      = TxtMail.Text;
            t.TELEFON   = TxtTelefon.Text;

            db.TBLPERSONEL.Add(t);
            db.SaveChanges();
            MessageBox.Show("Personel Sisteme Eklendi");
            liste();
        }
예제 #17
0
        //Güncelleme işlemi
        public ActionResult PersonelGuncelle(TBLPERSONEL tblprGuncelle)
        {
            if (!ModelState.IsValid)
            {
                return(View("PersonelGetir"));
            }

            var prs = db.TBLPERSONEL.Find(tblprGuncelle.ID); //personel tablosundaki ID ye göre güncelleyeceğiz.

            prs.PERSONELAD    = tblprGuncelle.PERSONELAD;    //Adı Güncelle
            prs.PERSONELSOYAD = tblprGuncelle.PERSONELSOYAD; //Adı Güncelle

            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #18
0
        public ActionResult personelDüzenle(string id)
        {
            TBLPERSONEL personeller = new TBLPERSONEL();

            personeller = entities.TBLPERSONEL.Find(id);

            if (String.IsNullOrEmpty(id))
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(personeller));
            }
        }
예제 #19
0
 public ActionResult personelDüzenle(TBLPERSONEL model)
 {
     if (ModelState.IsValid)
     {
         model.REC_UPDATE            = DateTime.Now;
         model.REC_UPUSERNAME        = (String)Session["UserName"];
         model.REC_UPUSERNO          = (int)Session["UserId"];
         model.REC_CHANGED           = "1";
         model.REC_VERSION           = CreateCommon.REC_VERSION;
         entities.Entry(model).State = EntityState.Modified;
         entities.SaveChanges();
         return(RedirectToAction("personelListele"));
     }
     return(RedirectToAction("personelListele"));
 }
예제 #20
0
        //personeli pasif yap!!!!!!!!!!!!!!!!!!!!!!!!!!!
        public ActionResult personelPasif(string id)
        {
            TBLPERSONEL personeller = new TBLPERSONEL();

            personeller                       = entities.TBLPERSONEL.Find(id);
            personeller.REC_UPDATE            = DateTime.Now;
            personeller.REC_UPUSERNAME        = (String)Session["UserName"];
            personeller.REC_UPUSERNO          = (int)Session["UserId"];
            personeller.REC_CHANGED           = "1";
            personeller.REC_VERSION           = CreateCommon.REC_VERSION;
            personeller.DURUM                 = "0";
            entities.Entry(personeller).State = EntityState.Modified;
            entities.SaveChanges();

            return(RedirectToAction("PersonelListesi"));
        }
        private void bynKaydet_Click(object sender, EventArgs e)
        {
            TBLPERSONEL p = new TBLPERSONEL();

            if (txtAd.Text.Length >= 0 && txtSoyad.Text.Length >= 0 && txtMail.Text.Length >= 0 && txtTel.Text.Length >= 0 && txtId.Text.Length >= 0 && lookUpEdit1.Text.Length >= 0)
            {
                p.AD        = txtAd.Text;
                p.SOYAD     = txtSoyad.Text;
                p.TELEFON   = txtTel.Text;
                p.MAİL      = txtMail.Text;
                p.DEPARTMAN = byte.Parse(lookUpEdit1.EditValue.ToString());
            }

            db.TBLPERSONEL.Add(p);
            db.SaveChanges();
            MessageBox.Show("Personel Başarıyla Kaydedildi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
            listele();
        }
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            TBLPERSONEL t = new TBLPERSONEL();

            t.AD        = TxtAd.Text;
            t.SOYAD     = TxtSoyad.Text;
            t.DEPARTMAN = byte.Parse(lookUpEdit1.EditValue.ToString());
            t.FOTOGRAF  = TxtFotograf.Text;
            t.MAIL      = TxtMail.Text;
            t.TELEFON   = TxtTelefon.Text;

            db.TBLPERSONEL.Add(t);
            db.SaveChanges();

            MessageBox.Show("Personel Başarıyla Kaydedildi", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PubPesonelListesiTimer.Enabled = true;
        }
예제 #23
0
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            TBLPERSONEL t = new TBLPERSONEL();

            t.AD        = TxtAd.Text;
            t.SOYAD     = TxtSoyad.Text;
            t.DEPARTMAN = byte.Parse(lookUpEdit1.EditValue.ToString());
            t.FOTOGRAF  = TxtFotograf.Text;
            t.MAIL      = TxtMail.Text;
            t.TELEFON   = TxtTelefon.Text;

            db.TBLPERSONEL.Add(t);
            db.SaveChanges();

            MessageBox.Show("Personel Başarıyla Kaydedildi", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);

            YeniPersonelDegisiklikSayac++;                                    //Diger formda burda değişiklik yapılmışmı kontrol etmek icins sayac
            Formlar.FrmPersonelListesi.PubPesonelListesiTimer.Enabled = true; //UrunListesi fomrundaki timerı calıştırıyor ki çalışınca liste guncellensin
        }
예제 #24
0
        public ActionResult GirisYap(TBLUYELER u, TBLPERSONEL p)
        {
            var bilgiler = db.TBLUYELER.FirstOrDefault(x => x.MAIL == u.MAIL && x.SIFRE == u.SIFRE);
            var degerler = db.TBLPERSONEL.FirstOrDefault(x => x.MAIL == p.MAIL && x.SIFRE == p.SIFRE);

            if (bilgiler != null)
            {
                FormsAuthentication.SetAuthCookie(bilgiler.MAIL, false);
                return(RedirectToAction("Index", "Vitrin"));
            }
            else if (degerler != null)
            {
                FormsAuthentication.SetAuthCookie(degerler.MAIL, false);
                return(RedirectToAction("Index", "Diyetler"));
            }
            else
            {
                return(View());
            }
        }
예제 #25
0
 private void BtnKaydet_Click(object sender, EventArgs e)
 {
     try
     {
         TBLPERSONEL k = new TBLPERSONEL();
         k.AD        = TxtAdi.Text.ToUpper();
         k.SOYAD     = TxtSoyadi.Text.ToUpper();
         k.DEPARTMAN = byte.Parse(lookUpEdit1.EditValue.ToString());
         k.FOTOGRAF  = TxtFotograf.Text.ToUpper();
         k.MAIL      = TxtMail.Text.ToUpper();
         k.TELEFON   = TxtTelefon.Text.ToUpper();
         db.TBLPERSONEL.Add(k);
         db.SaveChanges();
         MessageBox.Show("Personel Ekleme İşlemi Başarılı", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
         metot();
     }
     catch (Exception)
     {
         MessageBox.Show("Personel Ekleme İşlemi İçin Gerekli Yerleri Doldurunuz!", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
예제 #26
0
        public ActionResult GirisYap(TBLUYELER p, TBLPERSONEL d)
        {
            var bilgiler = db.TBLUYELER.FirstOrDefault(x => x.MAIL == p.MAIL && x.SIFRE == p.SIFRE && x.YETKİ == null);
            var admin    = db.TBLUYELER.FirstOrDefault(x => x.MAIL == p.MAIL && x.SIFRE == p.SIFRE && x.YETKİ == 1);
            var sef      = db.TBLUYELER.FirstOrDefault(x => x.MAIL == p.MAIL && x.SIFRE == p.SIFRE && x.YETKİ == 3);
            var garson   = db.TBLUYELER.FirstOrDefault(x => x.MAIL == p.MAIL && x.SIFRE == p.SIFRE && x.YETKİ == 4);

            //şartlı döngüler

            if (bilgiler != null)
            {
                FormsAuthentication.SetAuthCookie(bilgiler.MAIL, true);
                Session["Mail"] = bilgiler.MAIL.ToString();
                return(RedirectToAction("Index", "Panelim"));
            }
            else if (admin != null)
            {
                FormsAuthentication.SetAuthCookie(admin.MAIL, true);
                Session["Mail"] = admin.MAIL.ToString();
                return(RedirectToAction("Index", "Kategori"));
            }
            else if (sef != null)
            {
                FormsAuthentication.SetAuthCookie(sef.MAIL, true);
                Session["Mail"] = sef.MAIL.ToString();
                return(RedirectToAction("Index", "Sefmenu"));
            }
            else if (garson != null)
            {
                FormsAuthentication.SetAuthCookie(garson.MAIL, true);
                Session["Mail"] = garson.MAIL.ToString();
                return(RedirectToAction("Index", "garsonpanel"));
            }
            else
            {
                return(View());
            }
        }
예제 #27
0
        public ActionResult personelEkle(TBLPERSONEL model)
        {
            model.REC_DATE       = DateTime.Now;
            model.REC_UPDATE     = DateTime.Now;
            model.REC_UPUSERNAME = (String)Session["UserName"];
            model.REC_UPUSERNO   = (int)Session["UserId"];
            model.REC_USERNAME   = (String)Session["UserName"];
            model.REC_USERNO     = (int)Session["UserId"];
            model.REC_CHANGED    = "0";
            model.REC_VERSION    = CreateCommon.REC_VERSION;
            model.DURUM          = "1";
            entities.TBLPERSONEL.Add(model);

            TBLKULLANICI kullaniciModel = new TBLKULLANICI();

            kullaniciModel.REC_DATE       = DateTime.Now;
            kullaniciModel.REC_UPDATE     = DateTime.Now;
            kullaniciModel.REC_UPUSERNAME = (String)Session["UserName"];
            kullaniciModel.REC_UPUSERNO   = (int)Session["UserId"];
            kullaniciModel.REC_USERNAME   = (String)Session["UserName"];
            kullaniciModel.REC_USERNO     = (int)Session["UserId"];
            kullaniciModel.REC_CHANGED    = "0";
            kullaniciModel.REC_VERSION    = CreateCommon.REC_VERSION;
            kullaniciModel.PERSONEL_KOD   = model.PERSONEL_KOD;
            kullaniciModel.SIFRE          = CreateCommon.ilkSifre;
            kullaniciModel.KULLANICI_ADI  = model.PERSONEL_KOD;
            entities.TBLKULLANICI.Add(kullaniciModel);
            entities.SaveChanges();



            ViewBag.Messsage = "kayıdınız başarılı bir şekilde oluşturuldu";
            return(RedirectToAction("Index"));

            //return RedirectToAction("kullanıcıEkle", new { personel_kod = model.PERSONEL_KOD });
        }
예제 #28
0
 public ActionResult PersonelEkle(TBLPERSONEL p)
 {
     db.TBLPERSONEL.Add(p);
     db.SaveChanges();
     return(View());
 }