Пример #1
0
        public ActionResult Index()
        {
            try
            {
                #region " [ Declaration ] "

                UserService    _userService    = new UserService();
                FanpageService _fanpageService = new FanpageService();
                GroupService   _groupService   = new GroupService();

                ViewBag.user    = _userService.GetAll(UserID);
                ViewBag.fanpage = _fanpageService.GetAll(UserID);
                ViewBag.group   = _groupService.GetAll(UserID);

                #endregion

                return(View());
            }
            catch (ServiceException serviceEx)
            {
                throw serviceEx;
            }
            catch (DataAccessException accessEx)
            {
                throw accessEx;
            }
            catch (Exception ex)
            {
                throw new ControllerException(FILE_NAME, "Index", UserID, ex);
            }
        }
Пример #2
0
        public ActionResult GetFanpage()
        {
            try
            {
                #region " [ Declaration ] "

                FanpageService _service = new FanpageService();

                #endregion

                // Call to service
                return(this.Json(_service.GetAll(UserID), JsonRequestBehavior.AllowGet));
            }
            catch (ServiceException serviceEx)
            {
                throw serviceEx;
            }
            catch (DataAccessException accessEx)
            {
                throw accessEx;
            }
            catch (Exception ex)
            {
                throw new ControllerException(FILE_NAME, "GetFanpage", UserID, ex);
            }
        }
Пример #3
0
        public ActionResult DeleteFanpage(FanpageModel model)
        {
            try
            {
                #region " [ Declaration ] "

                FanpageService _service = new FanpageService();

                #endregion

                #region " [ Main processing ] "

                model.Publish    = true;
                model.CreateBy   = UserID;
                model.UpdateBy   = UserID;
                model.CreateDate = DateTime.Now;
                model.UpdateDate = DateTime.Now;

                #endregion

                // Call to service
                return(this.Json(_service.Delete(model), JsonRequestBehavior.AllowGet));
            }
            catch (ServiceException serviceEx)
            {
                throw serviceEx;
            }
            catch (DataAccessException accessEx)
            {
                throw accessEx;
            }
            catch (Exception ex)
            {
                throw new ControllerException(FILE_NAME, "DeleteFanpage", UserID, ex);
            }
        }