public ActionResult addprop(PropertyDetail pa)
        {
            if (ModelState.IsValid)
            {
                db.PropertyDetails.Add(pa);

                db.SaveChanges();
                return(RedirectToAction("upload", new { propid = pa.PropertyID }));
            }

            return(View(pa));
        }
Exemplo n.º 2
0
        public ActionResult AddBroker(Broker k)
        {
            if (ModelState.IsValid)
            {
                db.Brokers.Add(k);

                db.SaveChanges();
                ViewBag.message = "Broker added sucessfully";
                return(RedirectToAction("Index"));
            }



            return(View(k));
        }
Exemplo n.º 3
0
        public ActionResult bookprop(BiddingProperty bidquest)
        {//here we put it only if the value is greater than the percentage
            //we dont have records yet
            int f = bidquest.PropertyId;


            int count = 0;

            PropertyQuestion pqest = db.PropertyQuestions.Find(f);

            if (pqest.Response1 == bidquest.Response1)
            {
                count++;
            }

            if (pqest.Response2 == bidquest.Response2)
            {
                count++;
            }

            if (pqest.Response3 == bidquest.Response3)
            {
                count++;
            }


            if (pqest.Response4 == bidquest.Response4)
            {
                count++;
            }


            if (ModelState.IsValid)
            {
                if (pqest.Percentage <= ((count / 4) * 100))
                {
                    db.BiddingProperties.Add(bidquest);

                    db.SaveChanges();
                }
                ViewBag.message = "you have succesfully applied for the property";
                return(RedirectToAction("Index"));
            }

            return(View(bidquest));
        }
Exemplo n.º 4
0
        public ActionResult NewClient(Client cl)
        {
            if (ModelState.IsValid)
            {
                db.Clients.Add(cl);

                db.SaveChanges();

                ViewBag.message = "client added sucessfully";
                return(RedirectToAction("Login"));
            }



            return(View(cl));
        }
Exemplo n.º 5
0
        public ActionResult locationview(int id = 0)
        {
            SampleDBContext1 dbo = new SampleDBContext1();


            PropertyDetail iy = new PropertyDetail();

            var zzz = (from u in dbo.PropertyDetails
                       where u.PropertyID.Equals(id)
                       select u).FirstOrDefault();


            zzz.Views = zzz.Views + 1;


            dbo.SaveChanges();


            PropertyDetail st = db.PropertyDetails.Find(id);

            return(View(st));
        }
Exemplo n.º 6
0
 public ActionResult Delete(IEnumerable <int> employeeIdsToDelete)
 {
     db.Employees.Where(x => employeeIdsToDelete.Contains(x.ID)).ToList().ForEach(y => db.Employees.Remove(y));
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }