Esempio n. 1
0
 public ActionResult ChinhSua(string id)
 {
     if (SessionManager.CheckSession(ConstantValues.SessionKeyCurrentUser))
     {
         if (string.IsNullOrEmpty(id))
         {
             return(RedirectToAction("Index", "NguoiDung"));
         }
         var model = new NguoiDungModel();
         model.NguoiDungHienTai = xlNguoiDung.Doc(id);
         if (model.NguoiDungHienTai == null)
         {
             return(RedirectToAction("Index", "NguoiDung"));
         }
         model.DanhSachVaiTro        = DocDanhSachVaiTro();
         model.DanhSachDonVi         = DocDanhSachDonVi();
         model.DanhSachNhomNguoiDung = DocDanhSachNhomNguoiDung();
         return(View("ChinhSua", model));
     }
     if (Request.Url != null)
     {
         SessionManager.RegisterSession(ConstantValues.SessionKeyUrl, Request.Url.AbsolutePath);
     }
     return(RedirectToAction("Index", "Login"));
 }
Esempio n. 2
0
 public void kichHoatTaiKhoan(string id, string userId, int trangThai)
 {
     try
     {
         if (string.IsNullOrEmpty(id))
         {
             Clients.Caller.UpdateResult(false);
         }
         NguoiDung nd = xlNguoiDung.Doc(id);
         if (nd == null)
         {
             Clients.Caller.UpdateResult(false);
         }
         nd.KichHoat       = trangThai;
         nd.IdNguoiCapNhat = userId;
         Clients.Caller.UpdateResult(xlNguoiDung.CapNhat(nd));
     }
     catch (Exception)
     {
         Clients.Caller.UpdateResult(false);
     }
 }