/// <summary> /// Get infomation /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private InitDataModel GetInfo(InitDataModel inputObject) { // Local variable declaration InitDataModel getResult = null; ClientIndexDao clientIndexDao = null; ItemCom itemCom = null; MParameterCom mParameterCom = null; // Variable initialize getResult = new InitDataModel(); clientIndexDao = new ClientIndexDao(); itemCom = new ItemCom(); mParameterCom = new MParameterCom(); // Get data var listBanners = clientIndexDao.GetListBanners(); var listNewItems = clientIndexDao.GetListNewItems(); var listHotItems = clientIndexDao.GetListHotItems(); var listOfferItems = clientIndexDao.GetListOfferItems(); var discountMember = mParameterCom.GetNumber(Logics.PR_DISCOUNT_MEMBER, false); var strHotline = mParameterCom.GetString(Logics.PR_HOTLINE, false); var strChatYahoo = mParameterCom.GetString(Logics.PR_CHAT_YAHOO, false); var strChatSkype = mParameterCom.GetString(Logics.PR_CHAT_SKYPE, false); // Set value getResult.DiscountMember = discountMember; getResult.Hotline = strHotline; getResult.ChatYahoo = strChatYahoo; getResult.ChatSkype = strChatSkype; getResult.ListBanners = listBanners; getResult.ListNewItems = itemCom.ToListItemModel(listNewItems); getResult.ListHotItems = itemCom.ToListItemModel(listHotItems); getResult.ListOfferItems = itemCom.ToListItemModel(listOfferItems); // Return value return(getResult); }
/// <summary> /// Get infomation /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private InitDataModel GetInfo(InitDataModel inputObject) { // Local variable declaration InitDataModel getResult = null; ClientItemsDao clientItemsDao = null; ItemCom itemCom = null; MParameterCom mParameterCom = null; // Variable initialize getResult = new InitDataModel(); clientItemsDao = new ClientItemsDao(); itemCom = new ItemCom(); mParameterCom = new MParameterCom(); // Get data var listItems = clientItemsDao.GetListItems(inputObject); var discountMember = mParameterCom.GetNumber(Logics.PR_DISCOUNT_MEMBER, false); var strHotline = mParameterCom.GetString(Logics.PR_HOTLINE, false); var strChatYahoo = mParameterCom.GetString(Logics.PR_CHAT_YAHOO, false); // Title var title = string.Empty; if (!DataCheckHelper.IsNull(inputObject.SearchText)) { title = "Tìm kiếm"; } else if (!DataCheckHelper.IsNull(inputObject.CategoryCd)) { title = clientItemsDao.GetCategoryName(inputObject.CategoryCd); } else if (!DataCheckHelper.IsNull(inputObject.BrandCd)) { title = clientItemsDao.GetBrandName(inputObject.BrandCd); } else if (!DataCheckHelper.IsNull(inputObject.AgeCd)) { title = clientItemsDao.GetAgeName(inputObject.AgeCd); } else if (!DataCheckHelper.IsNull(inputObject.GenderCd)) { title = clientItemsDao.GetGenderName(inputObject.GenderCd); } else if (!DataCheckHelper.IsNull(inputObject.OfferGroupCd)) { title = "Khuyến mãi"; } else { title = "Tất cả"; } // Set value getResult.Title = title; getResult.DiscountMember = discountMember; getResult.Hotline = strHotline; getResult.ChatYahoo = strChatYahoo; getResult.ListItems = PagingHelper.GetPagerList( itemCom.ToListItemModel(listItems), inputObject); // Return value return(getResult); }