Esempio n. 1
0
        public ActionResult faaliyetPlaniEkle(GFaliyetPlani fp)
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  g = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();

            if (g.GFaliyetPlani.Count != 5)
            {
                fp.faliyetID = g.ID;
                db.GFaliyetPlani.Add(fp);
                db.SaveChanges();
                return(Json(true));
            }
            else
            {
                return(Json(false)); // 5 faaliyetten fazla eklenemez.
            }
        }
Esempio n. 2
0
        public ActionResult faaliyetSil(int id)
        {
            Kullanici k = (Kullanici)Session["Kullanici"];
            Guncelle  g = db.Guncelle.Where(x => x.kullanıcıID == k.ID).FirstOrDefault();


            GFaliyetPlani ol = db.GFaliyetPlani.Where(x => x.ID == id).FirstOrDefault();

            if (ol == null)
            {
                return(Json(false));
            }
            else
            {
                db.GFaliyetPlani.Remove(ol);
                db.SaveChanges();
                return(Json(true));
            }
        }