/*[HttpGet] * public ActionResult Edit(FormCollection collection ,int ?id) * { * var ten = collection["TEN"]; * var gia = collection["GIA"]; * int num; * int.TryParse(gia, out num); * if (id == null) * return new HttpStatusCodeResult(HttpStatusCode.BadRequest); * DICHVU data = cc.GetDichVu(id); * if (data == null) return HttpNotFound(); * data.TEN = ten; * data.GIA = num; * return View(data); * } * [HttpPost] * [ValidateAntiForgeryToken] * public ActionResult Edit([Bind(Include = "ID,TEN,GIA")] DICHVU dichVu) * { * if (ModelState.IsValid) * { * if (cc.SuaDichVu(dichVu)) * { * return RedirectToAction("Index"); * } * else * ViewBag.ThongBao = "Đã có tên dịch vụ " + dichVu.TEN; * * } * return View(dichVu); * }*/ public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } return(View(cc.GetDichVu(id))); }