Example #1
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>ResultModel</returns>
        private void Check(BuyDataModel inputObject)
        {
            // Local variable declaration
            ClientItemsDao clientItemsDao = null;

            // Variable initialize
            clientItemsDao = new ClientItemsDao();

            // Check valid
            if (!clientItemsDao.IsExistItem(inputObject.ItemCd))
                throw new DataNotExistException(string.Format("Sản phẩm ({0})", inputObject.ItemCd));
        }
Example #2
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;
        }