Exemplo n.º 1
0
        public static List <KnihovnaOceneni> GetUserOceneni(string username)
        {
            KnihovnaOceneniDao     d = new KnihovnaOceneniDao();
            List <KnihovnaOceneni> l = d.GetUserAchievements(new KnihovnaUserDao().GetByLogin(username).Id) as List <KnihovnaOceneni>;

            return(l);
        }
Exemplo n.º 2
0
        public ActionResult CreateOdznak(KnihovnaOceneni book)
        {
            if (ModelState.IsValid)
            {
                KnihovnaOceneni b = new KnihovnaOceneni()
                {
                    Name         = book.Name,
                    Id           = Books.Counter(),
                    OdznakId     = book.OdznakId,
                    Text         = book.Text,
                    UserId       = book.UserId,
                    DatumZiskani = DateTime.Now,
                    Image        = book.Image,
                    Venovani     = ""
                };

                KnihovnaOceneniArchetypDao a = new KnihovnaOceneniArchetypDao();
                KnihovnaOceneniArchetyp    o = a.GetbyId(b.OdznakId);

                b.Image = o.Image;


                KnihovnaOceneniDao bookDao = new KnihovnaOceneniDao();
                bookDao.Create(b);

                // Notifikace
                TempData["scs"] = "V pořádku";
            }
            else
            {
                return(View("AddOdznak", book)); // Vrátím vstupní data
            }

            return(Redirect(Request.UrlReferrer.ToString()));
        }
Exemplo n.º 3
0
        public ActionResult Test(int id)
        {
            KnihovnaOceneniDao d = new KnihovnaOceneniDao();
            KnihovnaOceneni    o = d.GetbyId(id);



            ViewBag.Id   = id;
            ViewBag.Text = o.Text;

            return(PartialView());
        }