public ActionResult Edit(string id) { try { #region " [ Declaration ] " EventTypeService _typeService = new EventTypeService(); EventService _service = new EventService(); ViewBag.id = id; ViewBag.type = _typeService.GetAll(UserID); #endregion // Call to service EventModel model = _service.GetItemByID(new EventModel() { 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); } }
public ActionResult Create() { try { #region " [ Declaration ] " EventTypeService _typeService = new EventTypeService(); EventModel model = new EventModel() { 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); } }
public List <BllEventType> GetAllEventTypes() { using (ServiceDB serviceDB = new ServiceDB()) { IUnitOfWork uow = new UnitOfWork(serviceDB); IEventTypeService EventTypeService = new EventTypeService(uow); return(EventTypeService.GetAll().ToList()); } }
public ActionResult Index() { try { EventTypeService _typeService = new EventTypeService(); 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); } }