public ActionResult Create([Bind(Include = "PlaceId,City")] InfecPlaces infecPlaces)
        {
            if (ModelState.IsValid)
            {
                db.infectedlaces.Add(infecPlaces);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(infecPlaces));
        }
        public ActionResult Create([Bind(Include = "IsolatedId,PlaceOfIsolation")] Isolated isolated)
        {
            if (ModelState.IsValid)
            {
                db.isolateds.Add(isolated);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(isolated));
        }
示例#3
0
        public ActionResult Create([Bind(Include = "HealthyId")] Healty healty)
        {
            if (ModelState.IsValid)
            {
                db.healties.Add(healty);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(healty));
        }
        public ActionResult Create([Bind(Include = "RecoveringId,PeoplesId")] Recovering recovering)
        {
            if (ModelState.IsValid)
            {
                db.recoverings.Add(recovering);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(recovering));
        }
示例#5
0
        public ActionResult Create([Bind(Include = "PeoplesId,places,Placeid")] Sick sick)
        {
            if (ModelState.IsValid)
            {
                string place = sick.places.City;
                sick.Place = place;
                db.sicks.Add(sick);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sick));
        }
示例#6
0
        public ActionResult Create([Bind(Include = "PeoplesId,FirstName,LastName,Identification,Password,PhoneNumber,Address,Email,City,BirthDate,IsAdmin")] Peoples peoples)
        //Password field removed
        {
            bool userExists = db.peoples.FirstOrDefault(x => x.Identification == peoples.Identification) == null;

            if (!userExists)
            {
                ModelState.AddModelError("UserName", "UserName taken");
                Session["usertaken"] = "true";
                return(View(peoples));
            }

            if (ModelState.IsValid)
            {
                db.peoples.Add(peoples);
                db.SaveChanges();
                Session["usertaken"] = "false";
                return(RedirectToAction("Index", "Home"));
            }

            return(View(peoples));
        }