public ActionResult KayitSil(int id)
        {
            Kullanici k = db.Kullanici.Where(x => x.ID == id).FirstOrDefault();

            if (k != null)
            {
                Basvuru  b = db.Basvuru.Where(x => x.kullanıcıID == k.ID).SingleOrDefault();
                Guncelle g = db.Guncelle.Where(x => x.kullanıcıID == k.ID).SingleOrDefault();

                if (b != null)
                {
                    db.Danisman.RemoveRange(db.Danisman.Where(x => x.basvuruID == b.ID).ToList());
                    db.FaliyetPlani.RemoveRange(db.FaliyetPlani.Where(x => x.faliyetID == b.ID).ToList());
                    db.OgrenciListesi.RemoveRange(db.OgrenciListesi.Where(x => x.basvuruID == b.ID).ToList());
                    db.DenetimKurulu.RemoveRange(db.DenetimKurulu.Where(x => x.basvuruID == b.ID).ToList());
                    db.YonetimKurulu.RemoveRange(db.YonetimKurulu.Where(x => x.basvuruID == b.ID).ToList());
                    db.Basvuru.Remove(b);
                    db.SaveChanges();
                }
                if (g != null)
                {
                    db.GDanisman.RemoveRange(db.GDanisman.Where(x => x.GuncelleID == g.ID).ToList());
                    db.GFaliyetPlani.RemoveRange(db.GFaliyetPlani.Where(x => x.faliyetID == g.ID).ToList());
                    db.GOgrenciListesi.RemoveRange(db.GOgrenciListesi.Where(x => x.GuncelleID == g.ID).ToList());
                    db.GDenetimKurulu.RemoveRange(db.GDenetimKurulu.Where(x => x.GuncelleID == g.ID).ToList());
                    db.GYonetimKurulu.RemoveRange(db.GYonetimKurulu.Where(x => x.GuncelleID == g.ID).ToList());
                    db.Guncelle.Remove(g);
                    db.SaveChanges();
                }
                db.Kullanici.Remove(k);
                db.SaveChanges();
                return(Json(true));
            }
            return(Json(false));
        }
Ejemplo n.º 2
0
        public ActionResult form2(Guncelle guncelle)
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  b = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            if (b.GOgrenciListesi.Count < 20)
            {
                List <GOgrenciListesi> ol = db.GOgrenciListesi.Where(x => x.GuncelleID == b.ID).ToList();
                ViewBag.ol   = ol;
                ViewBag.hata = "Bu formu kaydetmek için en az 20 kişi eklemelisiniz.";
                return(View(b));
            }
            else
            {
                b.akademikYıl = DateTime.Now.Year.ToString() + " - " + DateTime.Now.AddYears(+1).Year.ToString();
                if (b.adimNo == 2)
                {
                    b.adimNo = 3;
                    db.SaveChanges();
                }
                List <GOgrenciListesi> ol = db.GOgrenciListesi.Where(x => x.GuncelleID == b.ID).ToList();
                ViewBag.ol = ol;
                return(View(b));
            }
        }
Ejemplo n.º 3
0
        public ActionResult OgrenciListesiEkle(GOgrenciListesi ol)
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  g = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            if (g.GOgrenciListesi.Count != 20)
            {
                if (Functions.OgrenciSorgula(ol.ogrNo) == true)
                {
                    GOgrenciListesi ogrenciL = db.GOgrenciListesi.Where(x => x.ogrNo == ol.ogrNo && x.GuncelleID == g.ID).FirstOrDefault();
                    if (ogrenciL != null)
                    {
                        return(Json("hata0"));
                    }
                    ol.GuncelleID = g.ID;
                    db.GOgrenciListesi.Add(ol);
                    db.SaveChanges();
                    GOgrenciListesi o     = db.GOgrenciListesi.Where(x => x.ogrNo == ol.ogrNo).FirstOrDefault();
                    int             ogrno = o.ID;
                    return(Json(ogrno));
                }
                else
                {
                    return(Json("hata1"));
                }
            }
            return(Json("hata2"));
        }
Ejemplo n.º 4
0
        public ActionResult form3(Guncelle gun)
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  g = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            ViewBag.Ogreciler = db.GOgrenciListesi.Where(x => x.GuncelleID == g.ID).ToList();
            if (g.adimNo < 3)
            {
                return(View());
            }

            if (g.GFaliyetPlani.Count < 5)
            {
                ViewBag.Hata = "En az 5 faaliyet eklemeniz gerekmektedir.";
                return(View(g));
            }
            g.toplantiNo     = gun.toplantiNo;
            g.toplantiTarihi = gun.toplantiTarihi;
            g.saat           = gun.saat;
            g.mekan          = gun.mekan;

            if (g.adimNo == 3)
            {
                g.adimNo = 4;
            }


            ViewBag.Ogreciler = db.GOgrenciListesi.Where(x => x.GuncelleID == g.ID).ToList();
            db.SaveChanges();
            return(View(g));
        }
Ejemplo n.º 5
0
        public ActionResult form8TBilg(Guncelle veri)
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  b = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            if (veri.kurulusTarihi != null)
            {
                b.kurulusTarihi = veri.kurulusTarihi;
            }

            if (veri.toplantiNiteligi != null)
            {
                b.toplantiNiteligi = veri.toplantiNiteligi;
            }

            if (veri.tuzukDegisikligi != null)
            {
                b.tuzukDegisikligi = veri.tuzukDegisikligi;
            }

            if (veri.gUyeSayisi != null)
            {
                b.gUyeSayisi = veri.gUyeSayisi;
            }

            db.SaveChanges();

            return(RedirectToAction("form8"));
        }
Ejemplo n.º 6
0
        public ActionResult etkButceKaydet(string etkinlik, string butce, string kurul, string kUyeSecimi)
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  b = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            if (etkinlik != "")
            {
                b.etkinlik = etkinlik;
            }

            if (butce != "")
            {
                b.butce = butce;
            }

            if (kurul != "")
            {
                b.baskaKurul = kurul;
            }

            if (kUyeSecimi != "")
            {
                b.bkUyeSecimi = kUyeSecimi;
            }

            db.SaveChanges();

            return(RedirectToAction("form7"));
        }
Ejemplo n.º 7
0
        public ActionResult form8Uye(GYonetimKurulu veri)
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  b = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            var uye = db.GYonetimKurulu.FirstOrDefault(x => x.ID == veri.ID && x.GuncelleID == b.ID);

            if (veri.bolum != null)
            {
                uye.bolum = veri.bolum;
            }

            if (veri.adres != null)
            {
                uye.adres = veri.adres;
            }

            if (veri.evTel != null)
            {
                uye.evTel = veri.evTel;
            }

            db.SaveChanges();

            return(RedirectToAction("form8"));
        }
Ejemplo n.º 8
0
        public ActionResult form8Kaydet()
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  b = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            int  sayac   = 0;
            bool gecis   = false;
            var  yonetim = db.GYonetimKurulu.Where(x => x.GuncelleID == b.ID).ToList();

            foreach (var item in yonetim)
            {
                if (item.adres != null && item.bolum != null)
                {
                    sayac++;
                }
            }

            if (b.kurulusTarihi != null && b.gUyeSayisi != null && b.toplantiNiteligi != null &&
                b.tuzukDegisikligi != null)
            {
                sayac++;
            }

            if (b.adimNo == 6 && sayac == 8)
            {
                b.adimNo = 7;
                db.SaveChanges();
            }
            else
            {
                TempData["YönetimHata"] = "Formda Eksik Bilgi Bulunmaktadır. Lütfen Aşağıdaki Formdan Kontrol Ediniz.";
            }

            return(RedirectToAction("form8"));
        }
Ejemplo n.º 9
0
        // Güncelleme Tamamlama
        public ActionResult guncellemeTamamla()
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  b = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            return(View(b));
        }
Ejemplo n.º 10
0
        private void GüncelleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Guncelle g1 = new Guncelle();

            g1.Show();
            this.Hide();
        }
        public ActionResult guncelleKapat(int id)
        {
            Guncelle b = db.Guncelle.Where(x => x.ID == id).SingleOrDefault();

            b.kapat = true;
            db.SaveChanges();
            return(RedirectToAction("Guncellemeler"));
        }
        public ActionResult GForm1_admin(int ID)
        {
            Guncelle g      = db.Guncelle.Where(x => x.kullanıcıID == ID).FirstOrDefault();
            var      report = new ViewAsPdf("GForm1_admin", g)
            {
            };

            return(report);
        }
Ejemplo n.º 13
0
        // form2
        public PartialViewResult ogrenciListesiWidget()
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  g = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();
            List <GOgrenciListesi> ol = db.GOgrenciListesi.Where(x => x.GuncelleID == g.ID).ToList();

            ViewBag.ol = ol;
            return(PartialView());
        }
        public ActionResult Kayit(Kullanici k, string tel, string fak)
        {
            Kullanici us = db.Kullanici.Where(x => x.ogrMail == k.ogrMail).FirstOrDefault();

            if (us != null)
            {
                ViewBag.Hata = "Bu mail adresi ile bir kayıt bulunmaktadır.";
                return(View());
            }

            k.adi         = Functions.IlkHarfleriBuyut(k.adi);
            k.soyadi      = Functions.IlkHarfleriBuyut(k.soyadi);
            k.kayitTarihi = DateTime.Now;

            Basvuru b = new Basvuru();

            b.kullanıcıID = k.ID;
            b.kapat       = false;
            b.adimNo      = 1;

            Guncelle g = new Guncelle();

            g.kullanıcıID = k.ID;
            g.kapat       = false;
            g.adimNo      = 1;

            GOgrenciListesi gol = new GOgrenciListesi();

            gol.adi        = k.adi;
            gol.soyadi     = k.soyadi;
            gol.tc         = k.tc;
            gol.ogrNo      = k.ogrNo;
            gol.tel        = tel;
            gol.GuncelleID = g.ID;
            gol.mail       = k.ogrMail;
            gol.fak        = fak;

            OgrenciListesi ol = new OgrenciListesi();

            ol.adi       = k.adi;
            ol.soyadi    = k.soyadi;
            ol.tc        = k.tc;
            ol.ogrNo     = k.ogrNo;
            ol.tel       = tel;
            ol.basvuruID = b.ID;
            ol.mail      = k.ogrMail;
            ol.fak       = fak;


            db.Kullanici.Add(k);
            db.Guncelle.Add(g);
            db.GOgrenciListesi.Add(gol);
            db.Basvuru.Add(b);
            db.OgrenciListesi.Add(ol);
            db.SaveChanges();
            return(RedirectToAction("GirisYap", "Kullanici", k));
        }
Ejemplo n.º 15
0
        public static Guncelle guncelle(int KullaniciID)
        {
            CommunityContext db = new CommunityContext();
            Kullanici        k  = db.Kullanici.Where(x => x.ID == KullaniciID).FirstOrDefault();

            Guncelle g = db.Guncelle.Where(x => x.kullanıcıID == KullaniciID).FirstOrDefault();

            return(g);
        }
Ejemplo n.º 16
0
        public PartialViewResult faaliyetPlaniWidget()
        {
            Kullanici            k  = (Kullanici)Session["Kullanici"];
            Guncelle             g  = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();
            List <GFaliyetPlani> fp = db.GFaliyetPlani.Where(x => x.faliyetID == g.ID).ToList();

            ViewBag.fp = fp;
            return(PartialView());
        }
Ejemplo n.º 17
0
        public ActionResult form1()
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  g = new Guncelle();

            g = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();


            return(View(g));
        }
Ejemplo n.º 18
0
        public PartialViewResult dKuruluListesiWidget()
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  b = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            var dk = db.GDenetimKurulu.Where(x => x.GuncelleID == b.ID).ToList();

            ViewBag.dk = dk;
            return(PartialView());
        }
        // Güncelleme Print

        public ActionResult GForm1()
        {
            Kullanici k      = (Kullanici)Session["Kullanici"];
            Guncelle  g      = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();
            var       report = new ViewAsPdf("GForm1", g)
            {
            };

            return(report);
        }
Ejemplo n.º 20
0
        public ActionResult dUyeListesiSil(int id)
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  b = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            GDenetimKurulu ul = db.GDenetimKurulu.Where(x => x.ID == id).FirstOrDefault();

            db.GDenetimKurulu.Remove(ul);
            db.SaveChanges();
            return(RedirectToAction("form7"));
        }
        public ActionResult GForm4_admin(int ID)
        {
            Guncelle         g  = db.Guncelle.Where(x => x.kullanıcıID == ID).FirstOrDefault();
            List <GDanisman> DL = db.GDanisman.Where(x => x.GuncelleID == g.ID).ToList();

            ViewBag.DL = DL;
            var report = new ViewAsPdf("GForm4_admin", g)
            {
            };

            return(report);
        }
        public ActionResult GForm8_admin(int ID)
        {
            Guncelle g = db.Guncelle.Where(x => x.ID == ID).FirstOrDefault();

            ViewBag.yonetimKurulu = db.GYonetimKurulu.Where(x => x.GuncelleID == g.ID).ToList();

            var report = new ViewAsPdf("GForm8_Admin", g)
            {
            };

            return(report);
        }
        public ActionResult GForm4()
        {
            Kullanici        k  = (Kullanici)Session["Kullanici"];
            Guncelle         g  = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();
            List <GDanisman> DL = db.GDanisman.Where(x => x.GuncelleID == g.ID).ToList();

            ViewBag.DL = DL;
            var report = new ViewAsPdf("GForm4", g)
            {
            };

            return(report);
        }
        public ActionResult GForm8()
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  g = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            ViewBag.yonetimKurulu = db.GYonetimKurulu.Where(x => x.GuncelleID == g.ID).ToList();

            var report = new ViewAsPdf("GForm8", g)
            {
            };

            return(report);
        }
Ejemplo n.º 25
0
        public ActionResult form3()
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  g = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            ViewBag.Ogreciler = db.GOgrenciListesi.Where(x => x.GuncelleID == g.ID).ToList();
            if (g.adimNo < 3)
            {
                return(View());
            }

            return(View(g));
        }
        public ActionResult GForm2_admin(int ID)
        {
            Guncelle g = db.Guncelle.Where(x => x.kullanıcıID == ID).FirstOrDefault();
            List <GOgrenciListesi> ol = db.GOgrenciListesi.Where(x => x.GuncelleID == g.ID).ToList();

            ViewBag.ol = ol;
            var report = new ViewAsPdf("GForm2_admin", g)
            {
                PageMargins     = { Left = 20, Bottom = 20, Right = 20, Top = 20 },
                PageOrientation = Rotativa.Options.Orientation.Landscape,
            };

            return(report);
        }
        public ActionResult GForm3_admin(int ID)
        {
            Guncelle             g  = db.Guncelle.Where(x => x.kullanıcıID == ID).FirstOrDefault();
            List <GFaliyetPlani> fp = db.GFaliyetPlani.Where(x => x.faliyetID == g.ID).ToList();

            ViewBag.fp = fp;
            var report = new ViewAsPdf("GForm3_admin", g)
            {
                PageMargins     = { Left = 20, Bottom = 20, Right = 20, Top = 20 },
                PageOrientation = Rotativa.Options.Orientation.Landscape,
            };

            return(report);
        }
Ejemplo n.º 28
0
        public ActionResult form8()
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  b = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            if (b.adimNo < 6)
            {
                ViewBag.Hata = "İlk Önce Diğer Formları Doldurmanız Gerekmektedir.";
                return(View());
            }

            ViewBag.yonetimKurulu = db.GYonetimKurulu.Where(x => x.GuncelleID == b.ID).ToList();
            return(View(b));
        }
Ejemplo n.º 29
0
        public ActionResult form4()
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  g = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            if (g.adimNo < 4)
            {
                return(View());
            }
            List <GDanisman> DL = db.GDanisman.Where(x => x.GuncelleID == g.ID).ToList();

            ViewBag.DL = DL;
            return(View(g));
        }
Ejemplo n.º 30
0
        public PartialViewResult uyeListesiWidget()
        {
            Kullanici             k  = (Kullanici)Session["Kullanici"];
            Guncelle              b  = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();
            List <GYonetimKurulu> yk = db.GYonetimKurulu.Where(x => x.unvan == "Üye").ToList();

            ViewBag.yk = yk;

            var yk1 = db.GYonetimKurulu.Where(x => x.GuncelleID == b.ID).ToList();

            ViewBag.yk1 = yk1;

            var dk = db.GDenetimKurulu.Where(x => x.GuncelleID == b.ID).ToList();

            ViewBag.dk = dk;
            return(PartialView());
        }