public ActionResult reviewYKienNguoiDan(YKienQuyHoach ykien) { if (ModelState.IsValid) { ykien.NgayLuu = DateTime.Now; ykien.TrangThai = false; string str = this.gISRepository.saveYKienNguoiDan(ykien); if (str.Trim().Length > 0) { ModelState.AddModelError("", "Hệ thống đang quá tải. Vui lòng thử lại lúc khác"); } else { ViewBag.message = "Đã lưu hồ sơ thành công"; return(RedirectToAction("thanksYKienNguoiDan")); } } else { ModelState.AddModelError("", "Dữ liệu không hợp lệ"); } return(View(ykien)); }
public ActionResult LayYKien(string madoan) { if (madoan == null) { return(RedirectToAction("Index")); } if (madoan.Trim().Length == 0) { return(RedirectToAction("Index")); } THONGTINDOAN doan = this.gISRepository.getThongTinDoAn().Where(da => da.MaDoAn == madoan).FirstOrDefault(); if (doan == null) { return(RedirectToAction("Index")); } ViewBag.DoAn = doan; ViewBag.HoSoDuAn = this.gISRepository.getHoSoDoAn().Where(hs => hs.MaDoAn == madoan).OrderBy(hs => hs.LoaiHoSo).ToList(); YKienQuyHoach ykien; ykien = new YKienQuyHoach(); ykien.MaDoAn = doan.MaDoAn; return(View(ykien)); }
public ActionResult DeleteConfirmed(int id) { YKienQuyHoach yKienQuyHoach = db.YKienQuyHoachs.Find(id); db.YKienQuyHoachs.Remove(yKienQuyHoach); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,TenToChu,DiaChi,DienThoai,Email,NoiDungGopY,MaDoAn,NgayLuu,TrangThai,NoiDungTraLoi")] YKienQuyHoach yKienQuyHoach) { if (ModelState.IsValid) { db.Entry(yKienQuyHoach).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } //ViewBag.Ten = this.gISRepository.getThongTinDoAn().Where(da => da.MaDoAn == yKienQuyHoach.MaDoAn).FirstOrDefault().TenDoAn; return(View(yKienQuyHoach)); }
// GET: QuanLy/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } YKienQuyHoach yKienQuyHoach = db.YKienQuyHoachs.Find(id); if (yKienQuyHoach == null) { return(HttpNotFound()); } return(View(yKienQuyHoach)); }
// GET: QuanLy/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } YKienQuyHoach yKienQuyHoach = db.YKienQuyHoachs.Find(id); if (yKienQuyHoach == null) { return(HttpNotFound()); } //ViewBag.Ten = this.gISRepository.getThongTinDoAn().Where(da => da.MaDoAn == yKienQuyHoach.MaDoAn).FirstOrDefault().TenDoAn; return(View(yKienQuyHoach)); }
public ActionResult reviewYKienNguoiDan(string madoan, string loaiDoAn) { khaoSatNguoiDung khaoSatNguoiDung = GetCart(); if (madoan == null) { return(RedirectToAction("Index")); } if (madoan.Trim().Length == 0) { return(RedirectToAction("Index")); } string table = ""; if (loaiDoAn == "QHCT") { table = "QHCT_ThongTinDoAn"; } if (loaiDoAn == "QHPK") { table = "QHPK_ThongTinDoAn"; } if (loaiDoAn == "QHC") { table = "QHC_ThongTinDoAn"; } if (loaiDoAn == "QHNT") { table = "QHNT_ThongTinDoAn"; } if (loaiDoAn == "KHAC") { table = "KHAC_ThongTinDoAn"; } if (loaiDoAn == "QHV") { table = "QHV_ThongTinDoAn"; } THONGTINDOAN doan = this.gISRepository.getThongTinDoAn(loaiDoAn).Where(da => da.MaDoAn == madoan).FirstOrDefault(); if (doan == null) { return(RedirectToAction("Index")); } ViewBag.DoAn = doan; //khaoSatNguoiDung khaoSatNguoiDung = GetCart(); string noiDung = ""; if (khaoSatNguoiDung != null) { foreach (var line in khaoSatNguoiDung.Lines) { if (line.HoSo.MaDoAn == madoan) { noiDung += "\n" + line.yKien; } } } YKienQuyHoach ykien; ykien = new YKienQuyHoach(); ykien.MaDoAn = doan.MaDoAn; ykien.NoiDungGopY = noiDung; ykien.TenDoAn = doan.TenDoAn; ykien.BangDuLieu = table; return(View(ykien)); }