public ActionResult Index() { if (ViewData["uiv"] == null) { ViewBag.TotalCountApproved = TotalCountApproved(); ViewBag.TotalInProcess = TotalCountInProcess(); ViewBag.TotalRejected = TotalCountrejected(); ViewBag.TotalPayment = TotalCountPayment(); ViewBag.HistoryChart = GetHistoryDataDefitition(); ViewBag.SpaceUsed = GetTotalSpaceUsed(); ViewBag.DemoDonut = GetDonutDataDemo(); //DashboardItem pendings = new DashboardItem(); ViewBag.GeoMapData = GetGeoDataDemo(); #region lists List <DashboardItemList> lists = new List <DashboardItemList>(); //DashboardItemList listMovements = new DashboardItemList(); //listMovements.UrlView = VirtualPathUtility.ToAbsolute("~/") + "SFSdotNetFrameworkSecurity/secMoneyMovements/ListViewGen?usemode=myaccount"; //listMovements.Title = "Mis movimientos"; //listMovements.UrlCatalog = VirtualPathUtility.ToAbsolute("~/") + "SFSdotNetFrameworkSecurity/secMoneyMovements"; //lists.Add(listMovements); DashboardItemList list = new DashboardItemList(); //if ((new SFSdotNet.Framework.Security.Permissions()).IsAllowed(SFSdotNet.Framework.My.Context.CurrentContext.User, "SFSServiceDesk", accIncomeExpens.EntityName + "_money-in", "r")) //{ // list = new DashboardItemList(); // list.UrlView = VirtualPathUtility.ToAbsolute("~/") + "SFSServiceDesk/accIncomeExpenses/ListViewGen?usemode=money-in"; // list.Title = "Ingresos"; // list.UrlCatalog = VirtualPathUtility.ToAbsolute("~/") + "SFSServiceDesk/accIncomeExpenses?usemode=money-in"; // lists.Add(list); //} //if ((new SFSdotNet.Framework.Security.Permissions()).IsAllowed(SFSdotNet.Framework.My.Context.CurrentContext.User, "SFSServiceDesk", accIncomeExpens.EntityName + "_money-out-request", "r")) //{ // list = new DashboardItemList(); // list.UrlView = VirtualPathUtility.ToAbsolute("~/") + "SFSServiceDesk/accIncomeExpenses/ListViewGen?usemode=money-out-request"; // list.Title = "Solicitudes de egreso"; // list.UrlCatalog = VirtualPathUtility.ToAbsolute("~/") + "SFSServiceDesk/accIncomeExpenses?usemode=money-out-request"; // lists.Add(list); //} DashboardItem item = new DashboardItem(); item.ItemType = DashboardItemTypes.ListView; item.Lists = lists; #endregion ViewBag.MyPendings = item; } DashboardModel model = new DashboardModel(); UIModel uiModel = new UIModel(); return(ResolveView("Dashboard", uiModel, model)); }
private DashboardList KMCList() { var dashboardList = new DashboardList(); var items = db.KMCs.GroupBy(x => x.KMCCategoryId, (key, group) => new { CategoryID = key, Items = group.ToList() }) .ToList(); foreach (var item in items) { var itemList = new DashboardItemList(); itemList.Count = item.Items.Count; itemList.StatusName = db.KMCCategory.FirstOrDefault(x => x.Id == item.CategoryID).Title; itemList.RedirectLink = "/KMC/Manage/List/" + db.KMCCategory.FirstOrDefault(x => x.Id == item.CategoryID).Id; dashboardList.DashboardItemList.Add(itemList); } return(dashboardList); }