public ActionResult Index() { TempData["returnUrl"] = Url.Action("Index", "NguoiDung", new { Areas = "NguoiDung" }); if (Session["UserInfo"] == null) { return(Redirect(ChucNang.DuongDan.DangNhap)); } if (!XuLyPhanQuyen.KiemTraQuyen(ChucNang.Ma.QuanLyTaiKhoan, QuyenHan.Ma.Xem)) { return(Redirect(ChucNang.DuongDan.BangDieuKhien)); } ViewBag.DanhSachDonVi = DocDanhSachDonVi(); ViewBag.DanhSachVaiTro = DocDanhSachVaiTro(); ViewBag.DanhSachTrangThai = StaticList.TrangThaiKichHoats(); return(View()); }
public ActionResult XuLyXoaDanhSach(List <string> danhSachId) { var model = new CommonOutput(); TempData["returnUrl"] = Url.Action("Index", "NguoiDung", new { Areas = "NguoiDung" }); //if (Session["UserInfo"] == null) return Redirect(ChucNang.DuongDan.DangNhap); if (!XuLyPhanQuyen.KiemTraQuyen(ChucNang.Ma.QuanLyTaiKhoan, QuyenHan.Ma.Xoa)) { model.KetQua = 0; model.ThongBao = ConstantValues.Message.KhongCoQuyen; model.TongSoLuong = ""; return(Json(model)); } try { var input = new CommonInput.XoaDanhSachInput2(); input.Ids = danhSachId; var output = XuLyAPI.ApiJsonPost(APIUrl.NguoiDung.XoaDanhSach, input) as CommonOutput; if (output == null) { throw new Exception(ConstantValues.Message.LoiServer); } if (output.KetQua == 1) { model.KetQua = 1; model.ThongBao = ConstantValues.Message.ThanhCong; model.TongSoLuong = output.DuLieu.ToString(); } else { model.KetQua = 0; model.ThongBao = ConstantValues.Message.ThatBai; } } catch (Exception) { model.KetQua = 0; model.ThongBao = ConstantValues.Message.ThatBai; } return(Json(model)); }
public ActionResult ThongTinThemCapNhat(string Id) { TempData["returnUrl"] = Url.Action("Index", "NguoiDung", new { Areas = "NguoiDung" }); if (Session["UserInfo"] == null) { return(Redirect(ChucNang.DuongDan.DangNhap)); } if (!XuLyPhanQuyen.KiemTraQuyen(ChucNang.Ma.QuanLyTaiKhoan, QuyenHan.Ma.Them)) { return(Redirect(ChucNang.DuongDan.BangDieuKhien)); } var duLieuOutput = new CommonNguoiDung.NguoiDungOutput.ThongTin(); try { ViewBag.DanhSachVaiTro = DocDanhSachVaiTro(); ViewBag.DanhSachDonVi = DocDanhSachDonVi(); ViewBag.DanhSachPhanQuyen = DocDanhSachPhanQuyen(); ViewBag.DanhSachHuyen = XuLyTinhHuyenXa.DocDanhSachCacCap("Huyen"); if (!string.IsNullOrEmpty(Id)) { var input = new CommonInput.DocThongTinInput { Id = Id }; var output = XuLyAPI.ApiJsonPost(APIUrl.NguoiDung.DocThongTin, input) as CommonOutput; if (output == null) { throw new Exception(ConstantValues.Message.LoiServer); } if (output.KetQua != 1) { throw new Exception(output.ThongBao); } duLieuOutput = JsonConvert.DeserializeObject <CommonNguoiDung.NguoiDungOutput.ThongTin>(output.DuLieu.ToString()); } } catch (Exception) { } return(PartialView("_ThemCapNhatPartial", duLieuOutput)); }
//[Route("")] //[Route("xem-danh-sach/{id}")] public ActionResult Index() { TempData["returnUrl"] = Url.Action("Index", "QuangCao", new { Areas = "QuangCao" }); if (Session["UserInfo"] == null) { return(Redirect(ChucNang.DuongDan.DangNhap)); } if (!XuLyPhanQuyen.KiemTraQuyen(ChucNang.Ma.QuangCao, QuyenHan.Ma.Xem)) { return(Redirect(ChucNang.DuongDan.BangDieuKhien)); } try { string tuKhoa = ""; int trang = 1; if (!string.IsNullOrEmpty(Request.QueryString["Tukhoa"])) { tuKhoa = Request.QueryString["Tukhoa"]; } if (!string.IsNullOrEmpty(Request.QueryString["Trang"])) { trang = int.Parse(Request.QueryString["Trang"]); } var danhSachThamSo = new { Tukhoa = tuKhoa }; //ViewBag.DanhSachThamSo = Utility.ConvertOjectToGETParam(danhSachThamSo); var DanhSachNenTang = StaticList.NenTangs(); ViewBag.DanhSachNenTangTimKiem = DanhSachNenTang; ViewBag.DanhSachLoaiTimKiem = DocDanhSachLoai(); //var danhSach = DocDanhSach(); return(View()); } catch (Exception ex) { TempData["Error"] = ConstantValues.Message.LoiDuLieu; return(View()); } }
public ActionResult Index() { TempData["returnUrl"] = Url.Action("Index", "Manage", new { Areas = "PhongBan" }); if (Session["UserToken"] == null) { return(Redirect(ChucNang.DuongDan.DangNhap)); } if (!XuLyPhanQuyen.KiemTraQuyen(ChucNang.Ma.DanhMucPhongBan, QuyenHan.Ma.Xem)) { return(Redirect(ChucNang.DuongDan.BangDieuKhien)); } try { ViewBag.Active = "PhongBan"; string tuKhoa = ""; int trang = 1; if (!string.IsNullOrEmpty(Request.QueryString["tukhoa"])) { tuKhoa = Request.QueryString["tukhoa"]; } if (!string.IsNullOrEmpty(Request.QueryString["trang"])) { trang = int.Parse(Request.QueryString["trang"]); } var danhSachThamSo = new { tukhoa = tuKhoa }; ViewBag.DanhSachThamSo = Utility.ConvertOjectToGETParam(danhSachThamSo); var danhSach = DocDanhSach(); return(View(danhSach)); } catch (Exception ex) { TempData["Error"] = ConstantValues.Message.LoiDuLieu; return(View()); } }
//[Route("trang-chu")] public ActionResult Index() { TempData["returnUrl"] = Url.Action("Index", "Menu", new { Areas = "Admin" }); if (Session["UserInfo"] == null) { return(Redirect(ChucNang.DuongDan.DangNhap)); } if (!XuLyPhanQuyen.KiemTraQuyen(ChucNang.Ma.Menu, QuyenHan.Ma.Xem)) { return(Redirect(ChucNang.DuongDan.BangDieuKhien)); } try { string tuKhoa = ""; int nhom = 0; int loai = 0; if (!string.IsNullOrEmpty(Request.QueryString["tukhoa"])) { tuKhoa = Request.QueryString["tukhoa"]; } if (!string.IsNullOrEmpty(Request.QueryString["nhom"])) { nhom = int.Parse(Request.QueryString["nhom"]); } if (!string.IsNullOrEmpty(Request.QueryString["loai"])) { loai = int.Parse(Request.QueryString["loai"]); } var danhSach = DocDanhSach(tuKhoa, nhom, loai); return(View(danhSach)); } catch (Exception ex) { TempData["Error"] = Message.LoiDuLieu; return(View()); } }
public ActionResult XemDanhSach(string tukhoa = "", int nhom = 0, int loai = 0) { var danhSachThamSo = new { tukhoa = tukhoa }; ViewBag.DanhSachThamSo = Utility.ConvertOjectToGETParam(danhSachThamSo); TempData["returnUrl"] = Url.Action("Index", "Menu", new { Areas = "Admin" }); //if (Session["UserInfo"] == null) return Redirect(ChucNang.DuongDan.DangNhap); if (!XuLyPhanQuyen.KiemTraQuyen(ChucNang.Ma.Menu, QuyenHan.Ma.Xem)) { return(Redirect(ChucNang.DuongDan.BangDieuKhien)); } try { var danhSach = DocDanhSach(tukhoa, nhom, loai); return(PartialView("_PartialDanhSach", danhSach)); } catch (Exception ex) { //Ghi log TempData["Error"] = Message.LoiDuLieu; return(PartialView("_PartialDanhSach")); } }
public ActionResult XemDanhSach(string TuKhoa = "", string MaNenTang = "", string MaLoai = "", int?Trang = 1) { var danhSachThamSo = new { TuKhoa = TuKhoa, MaNenTang = MaNenTang, MaLoai = MaLoai }; ViewBag.DanhSachThamSo = Utility.ConvertOjectToGETParam(danhSachThamSo); TempData["returnUrl"] = Url.Action("Index", "QuangCao", new { Areas = "QuangCao" }); //if (Session["UserInfo"] == null) return Redirect(ChucNang.DuongDan.DangNhap); if (!XuLyPhanQuyen.KiemTraQuyen(ChucNang.Ma.QuangCao, QuyenHan.Ma.Xem)) { return(Redirect(ChucNang.DuongDan.BangDieuKhien)); } try { var danhSach = DocDanhSach(TuKhoa, MaNenTang, MaLoai, Trang); return(PartialView("_DanhSachPartial", danhSach)); } catch (Exception ex) { //Ghi log TempData["Error"] = ConstantValues.Message.LoiDuLieu; return(PartialView("_DanhSachPartial")); } }