public ActionResult Index() { ViewUtils.FillViewBag(ViewBag, TempData, User.Identity.Name); var users = new List <LBCFUBL_WCF.DBO.User>(Helper.GetUserClient().GetUsers()); var blockedUsers = users.Where(elt => elt.is_blocked == 1); var deptUsers = new List <LBCFUBL_WCF.DBO.User>(); var moneyForUser = new Dictionary <string, double>(); var accountUsers = new List <LBCFUBL_WCF.DBO.User>(); foreach (var user in users) { double money = Helper.GetUserClient().GetUserMoney(user.login); if (money < 0) { deptUsers.Add(user); } else if (money > 0) { accountUsers.Add(user); } moneyForUser.Add(user.login, Math.Round(money, 2)); } ViewBag.BlockedUsers = blockedUsers; ViewBag.DeptUsers = deptUsers; ViewBag.MoneyForUser = moneyForUser; ViewBag.AccountUsers = accountUsers; // Compute Data for Graph ViewBag.MonthMap = FetchMonth(); ViewBag.DayMap = FetchDay(); return(View()); }
public ActionResult Index() { ViewUtils.FillViewBag(ViewBag, TempData, User.Identity.Name); ViewBag.Accounts = Helper.GetUserClient().GetUsersMoneys(); var map = new Dictionary <string, LBCFUBL_WCF.DBO.User>(); foreach (var account in ViewBag.Accounts) { map[account.Item1] = Helper.GetUserClient().GetUserFromLogin(account.Item1); } ViewBag.AccountForUser = map; return(View()); }
public ActionResult Index(string id) { if (id == null) { id = User.Identity.Name; } if (id != User.Identity.Name && !User.IsInRole("admin")) { TempData["Error"] = "Vous n'êtes pas autorisé à voir cette resource"; return(Redirect("/Purchases")); } ViewUtils.FillViewBag(ViewBag, TempData, User.Identity.Name, true); ViewBag.UserMoney = Math.Round(Helper.GetUserClient().GetUserMoney(id), 2); ViewBag.Purchases = Helper.GetPurchaseClient().GetPurchasesForLogin(id); ViewBag.Accounts = Helper.GetAccountClient().GetAccountsForLogin(id); ViewBag.User = Helper.GetUserClient().GetUserFromLogin(id); ViewBag.MonthMap = GetMonthHistory(id); ViewBag.DayMap = GetDayHistory(id); return(View("Index")); }
public ActionResult Create() { ViewBag.Products = Helper.GetProductClient().GetAllProducts(); ViewUtils.FillViewBag(ViewBag, TempData, User.Identity.Name); return(View()); }
public ActionResult Index() { ViewUtils.FillViewBag(ViewBag, TempData, User.Identity.Name); return(View()); }