Ejemplo n.º 1
0
 public IActionResult Create()
 {
     ViewBag.Name      = HttpContext.Session.GetString("Ten");
     ViewBag.NguoiDung = inguoiDungs.GetNguoiDungs();
     ViewBag.KhachHang = ikhachhangs.GetKhachHangs();
     return(View());
 }
Ejemplo n.º 2
0
 public IActionResult Index(string dataTimKiem, string loaiTimKiem, int PageNumber = 1)
 {
     ViewBag.Name = HttpContext.Session.GetString("Ten");
     if (HttpContext.Session.GetString("VaiTro") == "NguoiQuanTri")
     {
         if (dataTimKiem == null)
         {
             NguoiDungViewModel model = iNguoiDungService.GetNguoiDungs();
             ViewBag.TotalPages  = Math.Ceiling(model.NguoiDungs.Count() / 5.0);
             ViewBag.dataTimKiem = dataTimKiem;
             ViewBag.loaiTimKiem = loaiTimKiem;
             var user = model.NguoiDungs.Skip((PageNumber - 1) * 5).Take(5).ToList();
             return(View(user));
         }
         else
         {
             var model = iNguoiDungService.GetSearchTenNguoiDung(dataTimKiem, loaiTimKiem);
             ViewBag.TotalPages  = Math.Ceiling(model.Count() / 5.0);
             ViewBag.dataTimKiem = dataTimKiem;
             ViewBag.loaiTimKiem = loaiTimKiem;
             if (Math.Ceiling(model.Count() / 5.0) <= PageNumber - 1)
             {
                 var user = model.Skip((1 - 1) * 5).Take(5).ToList();
                 return(View(user));
             }
             else
             {
                 var user = model.Skip((PageNumber - 1) * 5).Take(5).ToList();
                 return(View(user));
             }
         }
     }
     return(RedirectToAction("Login"));
 }
Ejemplo n.º 3
0
 public IActionResult Index()
 {
     if (HttpContext.Session.GetString("VaiTro") != "NguoiQuanTri")
     {
         return(Redirect(@"~/NguoiDung/Login"));
     }
     else
     {
         ViewBag.Name = HttpContext.Session.GetString("Ten");
         return(View(iNguoiDungService.GetNguoiDungs()));
     }
 }
Ejemplo n.º 4
0
 public IActionResult Create()
 {
     ViewBag.NguoiDung = nguoidungs.GetNguoiDungs(); 
     return View();
 }
Ejemplo n.º 5
0
 public IActionResult Index()
 {
     return(View(iNguoiDungService.GetNguoiDungs()));
 }
Ejemplo n.º 6
0
 public IActionResult Create()
 {
     ViewBag.NguoiDung = inguoiDungs.GetNguoiDungs();
     ViewBag.KhachHang = ikhachhangs.GetKhachHangs();
     return(View());
 }