Example #1
0
        public JsonResult Dissmis(int notifikaceId = 0)
        {
            KnihovnaUserDao d = new KnihovnaUserDao();
            KnihovnaUser    u = d.GetByLogin(User.Identity.Name);

            KnihovnaNotifikaceDao dao = new KnihovnaNotifikaceDao();
            KnihovnaNotifikace    n   = dao.GetbyId(notifikaceId);

            d.Update(u);
            dao.Delete(n);

            return(Json(new { }));
        }
Example #2
0
        public JsonResult AcceptFriend(int id = 0, int notifikaceId = 0)
        {
            General.ConfirmFriendShip(id);

            KnihovnaUserDao d = new KnihovnaUserDao();
            KnihovnaUser    u = d.GetByLogin(User.Identity.Name);

            KnihovnaNotifikaceDao dao = new KnihovnaNotifikaceDao();
            KnihovnaNotifikace    n   = dao.GetbyId(notifikaceId);

            d.Update(u);
            dao.Delete(n);

            return(Json(new { }));
        }
        public JsonResult Dismiss(int notifikaceId)
        {
            KnihovnaUserDao d = new KnihovnaUserDao();
            KnihovnaUser    u = d.GetByLogin(User.Identity.Name);

            KnihovnaNotifikaceDao dao = new KnihovnaNotifikaceDao();
            KnihovnaNotifikace    n   = dao.GetbyId(notifikaceId);

            if (n.RewardType == 1)
            {
                u.Money += 10;
            }

            d.Update(u);
            dao.Delete(n);
            TempData["Message"] = "Your Order";

            return(Json(new { }));
        }