Exemple #1
0
        public ActionResult Create([Bind(Include = "Id,Login,Email,Password,UserRoleId")] UserSys userSys)
        {
            if (ModelState.IsValid)
            {
                db.UserSys.Add(userSys);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(userSys));
        }
        public ActionResult Create([Bind(Include = "Id,Name")] Gender gender)
        {
            if (ModelState.IsValid)
            {
                db.Gender.Add(gender);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(gender));
        }
        public ActionResult Create([Bind(Include = "Id,Name")] Classification classification)
        {
            if (ModelState.IsValid)
            {
                db.Classification.Add(classification);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(classification));
        }
Exemple #4
0
        public ActionResult Create([Bind(Include = "Id,Name,Phone,GenderId,CityId,RegionId,LastPurchase,ClassificationId,UserId")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                db.Customer.Add(customer);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(customer));
        }
Exemple #5
0
        public ActionResult Create([Bind(Include = "Id,Name,RegionId")] City city)
        {
            if (ModelState.IsValid)
            {
                db.City.Add(city);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.RegionId = new SelectList(db.Region, "Id", "Name", city.RegionId);
            return(View(city));
        }