public ActionResult TypeQues(int proid = 0) { PropertyQuestion pqt = new PropertyQuestion(); pqt.PropertyId = proid; return(View(pqt)); }
public ActionResult TypeQues(PropertyQuestion pqt) { if (ModelState.IsValid) { db.PropertyQuestions.Add(pqt); db.SaveChanges(); return(RedirectToAction("index")); } return(View(pqt)); }
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)); }
public ActionResult bookprop(int ido) { PropertyDetail nh = db.PropertyDetails.Find(ido); BiddingProperty hu = new BiddingProperty(); PropertyQuestion pq = db.PropertyQuestions.Find(ido); hu.PropertyId = ido; hu.ClientId = Convert.ToInt32(Session["Id"]); ViewBag.ques1 = pq.Question1; ViewBag.ques2 = pq.Question2; ViewBag.ques3 = pq.Question3; ViewBag.ques4 = pq.Question4; return(View(hu)); }