Пример #1
0
        public ActionResult XuLyDocDanhSachHuyenXaAp(string Loai, string Id)
        {
            var model        = new CommonOutput();
            var quyenTruyCap = XuLyPhanQuyen.KiemTraQuyenTruyCap(ChucNang.Ma.QuanLyTaiKhoan, QuyenHan.Ma.Xoa);

            if (quyenTruyCap != null && quyenTruyCap.KetQua < 1)
            {
                model.KetQua   = 0;
                model.ThongBao = ConstantValues.Message.KhongCoQuyen;
                model.DuLieu   = null;
                return(Json(model));
            }
            try
            {
                var input = new CommonHuyen.HuyenInput.DocDanhSachTheoIdTinh();
                var ds    = XuLyTinhHuyenXa.DocDanhSachCacCap(Loai, Id);
                if (ds != null)
                {
                    model.KetQua   = 1;
                    model.ThongBao = ConstantValues.Message.ThanhCong;
                    model.DuLieu   = ds;
                }
            }
            catch (Exception ex)
            {
                model.KetQua   = 0;
                model.ThongBao = ConstantValues.Message.ThatBai;
                model.DuLieu   = null;
            }
            return(Json(model));
        }
Пример #2
0
        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));
        }