예제 #1
0
        public JsonResult GetGroupSettingInfo(decimal year)
        {
            try
            {
                #region " [ Declaration ] "

                GroupSettingService _service = new GroupSettingService();

                #endregion

                //Call to service
                List <GroupSettingModel> model = _service.GetAll(UserID, year);
                //
                return(this.Json(model, JsonRequestBehavior.AllowGet));
            }
            catch (ServiceException serviceEx)
            {
                throw serviceEx;
            }
            catch (DataAccessException accessEx)
            {
                throw accessEx;
            }
            catch (Exception ex)
            {
                throw new ControllerException(FILE_NAME, MethodInfo.GetCurrentMethod().Name, UserID, ex);
            }
        }
예제 #2
0
        public JsonResult SaveGroupSettingInfo(List <GroupSettingModel> model)
        {
            try
            {
                #region " [ Declaration ] "

                GroupSettingService _service = new GroupSettingService();

                #endregion

                #region " [ Main processing ] "

                if (model.Count == 0)
                {
                    return(this.Json(ResponseStatusCodeHelper.OK, JsonRequestBehavior.AllowGet));
                }
                //
                model[0].CreateBy = UserID;
                model[0].UpdateBy = UserID;

                #endregion

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