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));
        }
Beispiel #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));
        }
Beispiel #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"));
        }
Beispiel #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));
        }