Exemplo n.º 1
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel responseModel = null;
            IList<OutputCategoryModel> listCategories = null;
            OutputCategoryModel category = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            listCategories = new List<OutputCategoryModel>();

            // Get value
            var cbCategoryDiv = new ComboModel();
            var cbDeleteFlag = new ComboModel();
            foreach (var obj in resultObject.ListCategories)
            {
                category = new OutputCategoryModel();
                category.CategoryCd = DataHelper.ToString(obj.CategoryCd);
                category.CategoryName = DataHelper.ToString(obj.CategoryName);
                category.CategorySearchName = DataHelper.ToString(obj.CategorySearchName);
                category.CategoryDiv = DataHelper.ToString(obj.CategoryDiv);
                category.SortKey = DataHelper.ToString(Formats.NUMBER, obj.SortKey);
                category.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                category.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);

                cbCategoryDiv = MCodeCom.ToComboItems(resultObject.ListCategoryDiv, category.CategoryDiv);
                category.ListCategoryDiv = cbCategoryDiv.ListItems;
                category.CategoryDiv = cbCategoryDiv.SeletedValue;
                cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, category.DeleteFlag);
                category.ListDeleteFlag = cbDeleteFlag.ListItems;
                category.DeleteFlag = cbDeleteFlag.SeletedValue;

                listCategories.Add(category);
            }

            // Set value
            responseModel.ListCategories = listCategories;

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

            // Variable initialize
            responseModel = new InitResponseModel();

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

            // Check infomation
            Check(inputObject);

            // Get infomation
            resultObject = GetInfo(inputObject);

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

            // Return value
            return responseModel;
        }