コード例 #1
0
ファイル: InitLogic.cs プロジェクト: hieur8/web-mbec
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel response = null;
            OutputDetailsModel details = null;

            // Variable initialize
            response = new InitResponseModel();
            details = new OutputDetailsModel();

            // Get value
            var item = resultObject.Item;
            details.Status = DataHelper.ToString(_status);
            details.ItemCd = DataHelper.ToString(item.ItemCd);
            details.ItemName = DataHelper.ToString(item.ItemName);
            details.ItemSearchName = DataHelper.ToString(item.ItemSearchName);
            details.CategoryCd = DataHelper.ToString(item.CategoryCd);
            details.AgeCd = DataHelper.ToString(item.AgeCd);
            details.GenderCd = DataHelper.ToString(item.GenderCd);
            details.BrandCd = DataHelper.ToString(item.BrandCd);
            details.CountryCd = DataHelper.ToString(item.CountryCd);
            details.UnitCd = DataHelper.ToString(item.UnitCd);
            details.ItemDiv = DataHelper.ToString(item.ItemDiv);
            details.SalesPrice = DataHelper.ToString(Formats.NUMBER, item.SalesPrice);
            details.BuyingPrice = DataHelper.ToString(Formats.NUMBER, item.BuyingPrice);
            details.LinkVideo = DataHelper.ToString(item.LinkVideo);
            details.Material = DataHelper.ToString(item.Material);
            details.SummaryNotes = DataHelper.ToString(item.SummaryNotes);
            details.Notes = DataHelper.ToString(item.Notes);
            details.SortKey = DataHelper.ToString(item.SortKey);
            details.DeleteFlag = DataHelper.ToString(item.DeleteFlag);
            details.FileId = DataHelper.ToString(item.FileId);

            var cbCategory = MCodeCom.ToComboItems(resultObject.ListCategory, details.CategoryCd);
            details.ListCategory = cbCategory.ListItems;
            details.CategoryCd = cbCategory.SeletedValue;
            var cbAge = MCodeCom.ToComboItems(resultObject.ListAge, details.AgeCd);
            details.ListAge = cbAge.ListItems;
            details.AgeCd = cbAge.SeletedValue;
            var cbGender = MCodeCom.ToComboItems(resultObject.ListGender, details.GenderCd);
            details.ListGender = cbGender.ListItems;
            details.GenderCd = cbGender.SeletedValue;
            var cbBrand = MCodeCom.ToComboItems(resultObject.ListBrand, details.BrandCd);
            details.ListBrand = cbBrand.ListItems;
            details.BrandCd = cbBrand.SeletedValue;
            var cbCountry = MCodeCom.ToComboItems(resultObject.ListCountry, details.CountryCd);
            details.ListCountry = cbCountry.ListItems;
            details.CountryCd = cbCountry.SeletedValue;
            var cbUnit = MCodeCom.ToComboItems(resultObject.ListUnit, details.UnitCd);
            details.ListUnit = cbUnit.ListItems;
            details.UnitCd = cbUnit.SeletedValue;
            var cbItemDiv = MCodeCom.ToComboItems(resultObject.ListItemDiv, details.ItemDiv);
            details.ListItemDiv = cbItemDiv.ListItems;
            details.ItemDiv = cbItemDiv.SeletedValue;
            var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, details.DeleteFlag);
            details.ListDeleteFlag = cbDeleteFlag.ListItems;
            details.DeleteFlag = cbDeleteFlag.SeletedValue;

            // Set value
            response.Details = new List<OutputDetailsModel>() { details };

            // Return value
            return response;
        }
コード例 #2
0
ファイル: InitLogic.cs プロジェクト: hieur8/web-mbec
        /// <summary>
        /// Execute processing.
        /// </summary>
        /// <param name="request">RequestModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Execute(InitRequestModel request)
        {
            // Local variable declaration
            InitResponseModel response = null;
            InitDataModel inputObject = null;
            InitDataModel resultObject = null;

            // Variable initialize
            response = new InitResponseModel();

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

            // Check processing
            Check(inputObject);

            // Get infomation
            resultObject = GetInfo(inputObject);

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

            return response;
        }