/// <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<OutputBrandModel> listBrands = null; MCodeCom mCodeCom = null; OutputBrandModel brand = null; // Variable initialize responseModel = new InitResponseModel(); listBrands = new List<OutputBrandModel>(); mCodeCom = new MCodeCom(); // Get value var deleteFlagName = string.Empty; foreach (var obj in resultObject.ListBrands) { brand = new OutputBrandModel(); brand.BrandCd = DataHelper.ToString(obj.BrandCd); brand.BrandName = DataHelper.ToString(obj.BrandName); brand.FileId = DataHelper.ToString(obj.FileId); brand.SortKey = DataHelper.ToString(Formats.NUMBER, obj.SortKey); brand.Notes = DataHelper.ToString(obj.Notes); brand.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate); brand.DeleteFlag = DataHelper.ToString(obj.DeleteFlag); deleteFlagName = mCodeCom.GetCodeName(Logics.GROUP_DELETE_FLAG, brand.DeleteFlag); brand.DeleteFlagName = DataHelper.ToString(deleteFlagName); listBrands.Add(brand); } // Set value var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, null); responseModel.ListDeleteFlag = cbDeleteFlag.ListItems; responseModel.DeleteFlag = cbDeleteFlag.SeletedValue; responseModel.ListBrands = listBrands; // Return value return responseModel; }
/// <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 responseModel; }