Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "SednicaID,Datum,VrstaSednice,Ucionica,Zapisnik,Poziv")] Sednice sednice)
        {
            if (ModelState.IsValid)
            {
                db.Sednice.Add(sednice);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sednice));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "ClanID,Ime,Prezime,ImePrezime,Email,Status,KorisnickoIme,Lozinka")] Clanovi clanovi)
        {
            if (ModelState.IsValid)
            {
                db.Clanovi.Add(clanovi);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(clanovi));
        }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "ClanID,SednicaID,Prisutan,Opravdano")] Prisustvo prisustvo)
        {
            if (ModelState.IsValid)
            {
                db.Prisustvo.Add(prisustvo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ClanID    = new SelectList(db.Clanovi, "ClanID", "Ime", prisustvo.ClanID);
            ViewBag.SednicaID = new SelectList(db.Sednice, "SednicaID", "VrstaSednice", prisustvo.SednicaID);
            return(View(prisustvo));
        }
Ejemplo n.º 4
0
        public ActionResult Index(HttpPostedFileBase postedFile, int?SednicaID)
        {
            //Extract Image File Name.
            string fileName = System.IO.Path.GetFileName(postedFile.FileName);

            //Set the Image File Path.
            string filePath = "~/UploadDokumenata/" + Guid.NewGuid() + "_" + fileName;

            //Save the Image File in Folder.
            postedFile.SaveAs(Server.MapPath(filePath));

            //Insert the Image File details in Table.
            NNVEntities entities = new NNVEntities();

            entities.Prilozi.Add
                (new Prilozi
            {
                NazivPriloga = fileName,
                Putanja      = filePath,
            }
                );
            entities.SaveChanges();

            //Redirect to Index Action.
            return(RedirectToAction("Index"));
        }