Example #1
0
        public ActionResult Edit(MENADZER men)
        {
            if (ModelState.IsValid)
            {
                db.Entry(men).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("ProfilMenadzera"));
            }

            return(View(men));
        }
Example #2
0
        public ActionResult Edit(ModelView.Profil prof)
        {
            GOST gost = db.GOSTs.Find(prof.Email);

            if (ModelState.IsValid)
            {
                gost.IME_GOSTA       = prof.ime;
                gost.PREZIME_GOSTA   = prof.prezime;
                gost.EMAIL_GOSTA     = prof.Email;
                gost.PASS_GOSTA      = prof.pass;
                gost.CPASS_GOSTA     = prof.cpass;
                db.Entry(gost).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Profil"));
            }

            return(View(gost));
        }
Example #3
0
        public ActionResult EditRestoran(RESTORAN rest)
        {
            var restarauntWithSameID = db.RESTORANs.Where(m => m.NAZIV_RESTORANA == rest.NAZIV_RESTORANA).SingleOrDefault();

            if (ModelState.IsValid)
            {
                if (restarauntWithSameID == null)
                {
                    db.Entry(rest).State = EntityState.Modified;
                    db.SaveChanges();
                    return(RedirectToAction("ProfilAdmina"));
                }
                else
                {
                    ViewBag.Message = "Postoji restoran sa ovim nazivom!";
                }
                return(View(rest));
            }
            return(View(rest));
        }
Example #4
0
        public ActionResult ConfirmEmail(string Token)
        {
            GOST gost = db.GOSTs.Find(Token);


            gost.MAIL_POTVRA = true;
            db.GOSTs.Attach(gost);
            var entry = db.Entry(gost);

            entry.Property(e => e.MAIL_POTVRA).IsModified = true;
            db.SaveChanges();

            return(View());
        }