public virtual ActionResult Personalize(string templateId, int?type, int?val) { var userName = IDBContext.Current.UserName; if (templateId == null || type == null) { return(RedirectToAction("Template")); } ViewBag.UserName = type == 2 ? userName : string.Empty; ViewBag.BLCid = _viewModelMapperHelper.GetBlankChartId(); ViewBag.TemplateId = templateId; ViewBag.Type = type; ViewBag.Val = val; ViewBag.Personalize = true; if (val == 1) { ViewBag.ListRoles = _viewModelMapperHelper.GetRoles(); } else { ViewBag.ChartList = _viewModelMapperHelper.GetChartItems(0, (int)type, userName); } var model = _workspaceService.GetLayout(templateId, (int)type); if (!model.IsValid) { ViewBag.ErrorMessage = model.ErrorMessage; } return(View(model.BoxesModels)); }