Exemplo n.º 1
0
        /// <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);
        }