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); } }
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); } }
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); } }