Ejemplo n.º 1
0
        public ActionResult Edit(string id)
        {
            try
            {
                #region " [ Declaration ] "

                EducationTypeService _typeService = new EducationTypeService();
                EducationService     _service     = new EducationService();

                ViewBag.id   = id;
                ViewBag.type = _typeService.GetAll(UserID);

                #endregion

                // Call to service
                EducationModel model = _service.GetItemByID(new EducationModel()
                {
                    ID = new Guid(id), CreateBy = UserID, Insert = false
                });

                return(View(model));
            }
            catch (ServiceException serviceEx)
            {
                throw serviceEx;
            }
            catch (DataAccessException accessEx)
            {
                throw accessEx;
            }
            catch (Exception ex)
            {
                throw new ControllerException(FILE_NAME, "Edit", UserID, ex);
            }
        }
Ejemplo n.º 2
0
        public ActionResult Create()
        {
            try
            {
                #region " [ Declaration ] "

                EducationTypeService _typeService = new EducationTypeService();

                EducationModel model = new EducationModel()
                {
                    ID       = Guid.NewGuid(),
                    CreateBy = UserID,
                    Insert   = true
                };

                ViewBag.type = _typeService.GetAll(UserID);

                #endregion

                return(View(model));
            }
            catch (ServiceException serviceEx)
            {
                throw serviceEx;
            }
            catch (DataAccessException accessEx)
            {
                throw accessEx;
            }
            catch (Exception ex)
            {
                throw new ControllerException(FILE_NAME, "Create", UserID, ex);
            }
        }
Ejemplo n.º 3
0
        public ActionResult Index()
        {
            try
            {
                EducationTypeService _typeService = new EducationTypeService();

                ViewBag.type = _typeService.GetAll(UserID);

                return(View());
            }
            catch (ServiceException serviceEx)
            {
                throw serviceEx;
            }
            catch (DataAccessException accessEx)
            {
                throw accessEx;
            }
            catch (Exception ex)
            {
                throw new ControllerException(FILE_NAME, "Index", UserID, ex);
            }
        }