Esempio n. 1
0
        public ActionResult Create()
        {
            try
            {
                #region " [ Declaration ] "

                AccountTypeService _typeServices = new AccountTypeService();
                AccountService     _service      = new AccountService();
                //
                ViewBag.type = _typeServices.GetAll(UserID);

                #endregion

                //Call to service
                AccountModel model = new AccountModel()
                {
                    ID = Guid.NewGuid(), CreateBy = UserID, Insert = true
                };
                //
                return(View(model));
            }
            catch (ServiceException serviceEx)
            {
                throw serviceEx;
            }
            catch (DataAccessException accessEx)
            {
                throw accessEx;
            }
            catch (Exception ex)
            {
                throw new ControllerException(FILE_NAME, MethodInfo.GetCurrentMethod().Name, UserID, ex);
            }
        }
Esempio n. 2
0
        protected override AccountViewModel SetViewModelData(AccountViewModel viewModel)
        {
            var accountType = new AccountTypeService(UnitOfWork);

            viewModel.AccountTypes = accountType.GetAll().Select(o => new SelectListItem
            {
                Text  = o.Name,
                Value = o.Id.ToString()
            }).ToList();

            return(viewModel);
        }