/// <summary> /// Execute convert ouput. /// </summary> /// <param name="resultObject">DataModel</param> /// <returns>ResponseModel</returns> private InitResponseModel Convert(InitDataModel resultObject) { // Local variable declaration InitResponseModel responseModel = null; PagerResponse<OutputItemModel> listItems = null; OutputItemModel item = null; // Variable initialize responseModel = new InitResponseModel(); listItems = new PagerResponse<OutputItemModel>(); // Get value foreach (var obj in resultObject.ListItems) { item = new OutputItemModel(); item.ItemCd = DataHelper.ToString(obj.ItemCd); item.ItemName = DataHelper.ToSubString(obj.ItemName, 20, false); item.Tooltip = DataHelper.ToString(obj.ItemName); item.ItemImage = DataHelper.ToString(obj.ItemImage); item.BrandCd = DataHelper.ToString(obj.BrandCd); item.BrandName = DataHelper.ToString(obj.Brand.BrandName); item.ItemDiv = DataHelper.ToString(obj.ItemDiv); item.OfferDiv = DataHelper.ToString(obj.OfferDiv); item.Price = DataHelper.ToString(Formats.CURRENCY, obj.SalesPrice); item.PriceOld = DataHelper.ToString(Formats.CURRENCY, obj.SalesPriceOld); item.SummaryNotes = DataHelper.ToString(obj.SummaryNotes); item.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate); listItems.Add(item); } listItems.AllRecordCount = resultObject.ListItems.AllRecordCount; listItems.Limit = resultObject.ListItems.Limit; listItems.Offset = resultObject.ListItems.Offset; // Set value responseModel.DiscountMember = DataHelper.ToString(Formats.PERCENT, resultObject.DiscountMember); responseModel.Hotline = DataHelper.ToString(resultObject.Hotline); //responseModel.ChatYahooIM = DataHelper.GetYahooIM(resultObject.ChatYahoo); //responseModel.ChatYahooIcon = DataHelper.GetYahooIcon(resultObject.ChatYahoo); responseModel.Title = DataHelper.ToString(resultObject.Title); responseModel.ListItems = listItems; // 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; }