Beispiel #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;
            }
        }
Beispiel #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;
     }
 }