Пример #1
0
        public ActionResult Index1()
        {
            try
            {
                var user       = userBusinessLogic.GetUsers().Result.FirstOrDefault();
                var categories = categoryBusinessLogic.GetAllCategories().Result;

                BeSafeModels.HomeModel homeModel = new BeSafeModels.HomeModel();
                //var irem = mapUserEntityToModel.ConvertObject(user);
                homeModel.User       = mapUserEntityToModel.ConvertObject(user);
                homeModel.categories = mapCategoryEntityToModel.ConvertObjectCollection(categories);
                //foreach (var item in categories)
                //{
                //    homeModel.categories.Add(
                //        new BeSafeModels.Category()
                //        {
                //            CategoryId=item.CategoryId,
                //            CategoryName=item.CategoryName,
                //            ParentCategoryId=item.ParentCategoryId,
                //            Parent= mapCategoryEntityToModel.ConvertObject(item.Parent),
                //            Children= mapCategoryEntityToModel.ConvertObjectCollection(item.Children),
                //            MasterItems=mapMasterItemEntityToModel.ConvertObjectCollection(item.MasterItems),
                //            Remarks=item.Remarks
                //        }
                //        );
                //}

                return(View(homeModel));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
 public ActionResult Index()
 {
     try
     {
         var user       = userBusinessLogic.GetUsers().Result.FirstOrDefault();
         var categories = categoryBusinessLogic.GetAllCategories().Result;
         BeSafeModels.HomeModel homeModel = new BeSafeModels.HomeModel();
         homeModel.User       = mapUserEntityToModel.ConvertObject(user);
         homeModel.categories = mapCategoryEntityToModel.ConvertObjectCollection(categories);
         return(View(homeModel));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #3
0
        // GET: UserController
        public ActionResult Index()
        {
            var ViewItems = new BeSafeWebApp.Models.TreeNode();

            ViewItems.children   = new List <BeSafeEntities.MasterItemsSet>();
            ViewItems.Categories = new List <BeSafeEntities.Category>();
            ViewItems.Categories = categoryBusinessLogic.GetAllCategories().Result.Where(c => c.ParentCategoryId == null)
                                   .ToList();

            return(View(ViewItems));
        }