Beispiel #1
0
        public ActionResult Create([Bind(Include = "GenderId,GenderName")] Gender gender)
        {
            if (ModelState.IsValid)
            {
                db.Genders.Add(gender);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(gender));
        }
Beispiel #2
0
        public ActionResult Create([Bind(Include = "SpecialityId,SpecialityName")] Speciality speciality)
        {
            if (ModelState.IsValid)
            {
                db.Specialities.Add(speciality);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(speciality));
        }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "PriceId,Price1")] Price price)
        {
            if (ModelState.IsValid)
            {
                db.Prices.Add(price);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(price));
        }
        public ActionResult Create([Bind(Include = "ProffesionId,ProffesionName")] Proffesion proffesion)
        {
            if (ModelState.IsValid)
            {
                db.Proffesions.Add(proffesion);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(proffesion));
        }
Beispiel #5
0
        public ActionResult Create([Bind(Include = "ClientId,ClientName,GenderID,CityID,Address,Billing,PhoneNumber,Image,ClientEmail")] Client client)
        {
            if (ModelState.IsValid)
            {
                db.Clients.Add(client);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CityID   = new SelectList(db.Cities, "CityId", "CityName", client.CityID);
            ViewBag.GenderID = new SelectList(db.Genders, "GenderId", "GenderName", client.GenderID);
            return(View(client));
        }
Beispiel #6
0
        public ActionResult Create([Bind(Include = "ProfileId,ProfileName,ProffesionID,CityID,PriceID,SpecialityID,GenderID,Bio,Image,Address,PhoneNumber,ProfileEmail")] Profile profile)
        {
            if (ModelState.IsValid)
            {
                db.Profiles.Add(profile);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CityID       = new SelectList(db.Cities, "CityId", "CityName", profile.CityID);
            ViewBag.GenderID     = new SelectList(db.Genders, "GenderId", "GenderName", profile.GenderID);
            ViewBag.PriceID      = new SelectList(db.Prices, "PriceId", "Price1", profile.PriceID);
            ViewBag.ProffesionID = new SelectList(db.Proffesions, "ProffesionId", "ProffesionName", profile.ProffesionID);
            ViewBag.SpecialityID = new SelectList(db.Specialities, "SpecialityId", "SpecialityName", profile.SpecialityID);
            return(View(profile));
        }