public ActionResult Create([Bind(Include = "CustomerID,CustomerFirstName,CustomerLastName,Email,PhoneNumber,Password,Age")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                db.Customers.Add(customer);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(customer));
        }
Esempio n. 2
0
        public ActionResult Create([Bind(Include = "BrokerID,Name")] Broker broker)
        {
            if (ModelState.IsValid)
            {
                db.Brokers.Add(broker);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(broker));
        }
        public ActionResult Create([Bind(Include = "DealID,PropertyID,CustomerID,BrokerID,Price,Commition,Categorty")] Deal deal)
        {
            if (ModelState.IsValid)
            {
                db.Deals.Add(deal);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(deal));
        }
        public ActionResult Create([Bind(Include = "PropertyID,Adresse,NumOfRooms,Price,Type,Elevator,Balcony,Parking,Category,SQfeet,About")] Property property)
        {
            if (ModelState.IsValid)
            {
                db.Properties.Add(property);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(property));
        }
Esempio n. 5
0
        public ActionResult Create([Bind(Include = "PropertyID,PropertyName,PropertyType,Stock,NumofRooms,city,Feautres,price")] Property property)
        {
            if (ModelState.IsValid)
            {
                db.Properties.Add(property);
                db.SaveChanges();
                return(RedirectToAction("Home"));
            }

            return(RedirectToAction("Home"));
        }
Esempio n. 6
0
        public ActionResult Create([Bind(Include = "DealID,CustomerID,PropertyID,Active")] Deal deal)
        {
            if (ModelState.IsValid)
            {
                db.Deals.Add(deal);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "CustomerFirstName", deal.CustomerID);
            ViewBag.PropertyID = new SelectList(db.Properties, "PropertyID", "PropertyName", deal.PropertyID);
            return(View(deal));
        }