public ActionResult Index() { if (sessiondto.getName() == null) { return(RedirectToAction("Index", "Home")); } else if (sessiondto.getRole() != 3) { return(RedirectToAction("Index", "Home")); } else { int totalbuyersCount = new UserBL().getUserList().Where(x => x.Role == 0).Count(); int totaluksuppliersCount = new UserBL().getUserList().Where(x => x.Role == 1).Count(); int totalinternationalsuppliersCount = new UserBL().getUserList().Where(x => x.Role == 2).Count(); int totalactivebuyersCount = new UserBL().getUserList().Where(x => x.Role == 0 && x.Is_Authorize == 1).Count(); int totalactiveuksuppliersCount = new UserBL().getUserList().Where(x => x.Role == 1 && x.Is_Authorize == 1).Count(); int totalactiveinternationalsuppliersCount = new UserBL().getUserList().Where(x => x.Role == 2 && x.Is_Authorize == 1).Count(); ViewBag.totalbuyersCount = totalbuyersCount; ViewBag.totaluksuppliersCount = totaluksuppliersCount; ViewBag.totalinternationalsuppliersCount = totalinternationalsuppliersCount; ViewBag.totalactivebuyersCount = totalactivebuyersCount; ViewBag.totalactiveuksuppliersCount = totalactiveuksuppliersCount; ViewBag.totalactiveinternationalsuppliersCount = totalactiveinternationalsuppliersCount; return(View()); } }
public int ValidateLogin() { if (sdto.getEmail() != null) { if (sdto.getRole() == 1) { return(1); } else if (sdto.getRole() == 2) { return(2); } else { return(0); } } else { return(0); } }
public ActionResult AddProduct(string message = "") { if (sessiondto.getName() == null) { return(RedirectToAction("Index", "Home")); } else if (sessiondto.getRole() == 0) { return(RedirectToAction("Index", "Account")); } else { List <Category> categories = new UserBL().getCategoryList(); ViewBag.categories = categories; ViewBag.message = message; return(View()); } }
public bool ValidateLogin() { if (sdto.getEmail() != null) { if (sdto.getRole() == 1) { return(true); } else { return(false); } } else { return(false); } }