Ejemplo n.º 1
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private FilterResponseModel Convert(FilterDataModel resultObject)
        {
            // Local variable declaration
            FilterResponseModel responseModel = null;
            IList<OutputUserModel> listUsers = null;
            MCodeCom mCodeCom = null;
            OutputUserModel user = null;

            // Variable initialize
            responseModel = new FilterResponseModel();
            listUsers = new List<OutputUserModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var deleteFlagName = string.Empty;
            foreach (var obj in resultObject.ListUsers)
            {
                user = new OutputUserModel();

                user.UserCd = DataHelper.ToString(obj.UserCd);
                user.Email = DataHelper.ToString(obj.Email);
                user.FullName = DataHelper.ToString(obj.FullName);
                user.Address = DataHelper.ToString(obj.Address);
                user.CityCd = DataHelper.ToString(obj.CityCd);
                user.CityName = DataHelper.ToString(obj.City.CityName);
                user.Phone1 = DataHelper.ToString(obj.Phone1);
                user.Phone2 = DataHelper.ToString(obj.Phone2);
                user.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);
                user.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                deleteFlagName = mCodeCom.GetCodeName(Logics.GROUP_DELETE_FLAG, user.DeleteFlag);
                user.DeleteFlagName = DataHelper.ToString(deleteFlagName);
                if (obj.UserGroups.Count > decimal.Zero)
                {
                    user.GroupCd = DataHelper.ToString(obj.UserGroups[0].GroupCd);
                    user.GroupName = DataHelper.ToString(obj.UserGroups[0].Group.GroupName);
                }
                listUsers.Add(user);
            }

            // Set value
            responseModel.ListUsers = listUsers;

            // Return value
            return responseModel;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Execute processing.
        /// </summary>
        /// <param name="request">RequestModel</param>
        /// <returns>ResponseModel</returns>
        private FilterResponseModel Execute(FilterRequestModel request)
        {
            // Local variable declaration
            FilterResponseModel responseModel = null;
            FilterDataModel inputObject = null;
            FilterDataModel resultObject = null;

            // Variable initialize
            responseModel = new FilterResponseModel();

            // Execute convert input.
            inputObject = Convert(request);

            // Check infomation
            Check(inputObject);

            // Get infomation
            resultObject = GetInfo(inputObject);

            // Execute convert ouput.
            responseModel = Convert(resultObject);

            return responseModel;
        }