public ActionResult Create(Evaluation ev) { if (ModelState.IsValid) { Encher en = EnchereRequette.getEnchereById(ev.IdEnchere); int etat = en.Etat; string id = ""; if (ModelState.IsValid) { if (ev.Id == "acheteur") { if (etat == 1) { EnchereRequette.setEnchereEtat(ev.IdEnchere, 3); } else if (etat == 4) { EnchereRequette.setEnchereEtat(ev.IdEnchere, 5); } id = en.IdVendeur; } else if (ev.Id == "vendeur") { if (etat == 1) { EnchereRequette.setEnchereEtat(ev.IdEnchere, 4); } else if (etat == 3) { EnchereRequette.setEnchereEtat(ev.IdEnchere, 5); } id = en.IdAcheteur; } ev.Id = Utility.IdGenerator.getEvaluationId(); EvaluationRequette.insertEvaluation(ev); Membre mb = MembreRequette.GetUserByNumero(id); mb.Cote += ev.Cote; MembreRequette.UpdateCote(mb); ////// update cote d'utilisateur ///////////////// return(RedirectToAction("Index", "Home")); } } return(View(ev)); }
public ActionResult List(string idEnchere, string op, string rtnUrl) { // LangueController.CreateCulture(getLangue()); CreateCulture(getLangue()); Encher en = EnchereRequette.getEnchereById(idEnchere); Evaluation ev = null; if (op == "acheteur") { ev = EvaluationRequette.getEvaluation(idEnchere, en.IdAcheteur); } else if (op == "vendeur") { ev = EvaluationRequette.getEvaluation(idEnchere, en.IdAcheteur); } ViewBag.rtn = rtnUrl; return(View(ev)); }