Ejemplo n.º 1
0
        public ActionResult SignatureIndex(int?id, PetitionModel sign)
        {
            if (id == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            PetitionSignatureModel model = new PetitionSignatureModel();


            var property = Db.PetitionInfoes.Where(x => x.PetitionId == id).SingleOrDefault();

            ViewBag.PetTitle = property.Title;
            ViewBag.Petition = property.WhySign;
            ViewBag.Image    = property.NameOfFile;

            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult SignatureIndex(PetitionSignatureModel model, int id)

        {
            PetitionSignature petitionSignature = new PetitionSignature();

            petitionSignature.SignAdd       = model.SignAdd;
            petitionSignature.SignCity      = model.SignCity;
            petitionSignature.SignCountry   = model.SignCountry;
            petitionSignature.SignEmail     = model.SignEmail;
            petitionSignature.SignFirstName = model.SignFirstName;
            petitionSignature.SignId        = model.SignId;
            petitionSignature.SignLastName  = model.SignLastName;
            petitionSignature.SignState     = model.SignState;
            petitionSignature.SignWord      = model.SignWord;
            petitionSignature.PetitionId    = id;
            Db.PetitionSignatures.Add(petitionSignature);
            Db.SaveChanges();

            return(RedirectToAction("SignatureIndex"));
        }