示例#1
0
        public IList<Offer> GetListOffers(FilterDataModel inputObject)
        {
            // Get value
            var listResult = from tbl in EntityManager.Offers
                             where (tbl.ItemCd.Contains(inputObject.ItemCd) || DataCheckHelper.IsNull(inputObject.ItemCd))
                             && (tbl.OfferDiv == inputObject.OfferDiv || DataCheckHelper.IsNull(inputObject.OfferDiv))
                             && (tbl.DeleteFlag == inputObject.DeleteFlag || DataCheckHelper.IsNull(inputObject.DeleteFlag))
                             orderby tbl.UpdateDate ascending
                             select tbl;

            // Return value
            return listResult.ToList();
        }
示例#2
0
        /// <summary>
        /// Execute convert input.
        /// </summary>
        /// <param name="request">RequestModel</param>
        /// <returns>DataModel</returns>
        private FilterDataModel Convert(FilterRequestModel request)
        {
            // Local variable declaration
            FilterDataModel inputObject = null;

            // Variable initialize
            inputObject = new FilterDataModel();

            // Convert data input
            DataHelper.ConvertInput(request, inputObject);

            // Return value
            return inputObject;
        }
示例#3
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private FilterResponseModel Convert(FilterDataModel resultObject)
        {
            // Local variable declaration
            FilterResponseModel responseModel = null;
            IList<OutputOfferModel> listOffers = null;
            MCodeCom mCodeCom = null;
            OutputOfferModel offer = null;

            // Variable initialize
            responseModel = new FilterResponseModel();
            listOffers = new List<OutputOfferModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var cbDeleteFlag = new ComboModel();
            var offerDivName = string.Empty;
            foreach (var obj in resultObject.ListOffers)
            {
                offer = new OutputOfferModel();
                offer.OfferCd = DataHelper.ToString(obj.OfferCd);
                offer.OfferGroupCd = DataHelper.ToString(obj.OfferGroupCd);
                offer.ItemCd = DataHelper.ToString(obj.ItemCd);
                offer.StartDate = DataHelper.ToString(Formats.DATE, obj.StartDate);
                offer.EndDate = DataHelper.ToString(Formats.DATE, obj.EndDate);
                offer.Percent = DataHelper.ToString(Formats.NUMBER, obj.Percent);
                offer.Notes = DataHelper.ToString(obj.Notes);
                offer.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                offer.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);

                offerDivName = mCodeCom.GetCodeName(Logics.GROUP_OFFER_DIV, obj.OfferDiv);
                offer.OfferDiv = DataHelper.ToString(obj.OfferDiv);
                offer.OfferDivName = DataHelper.ToString(offerDivName);

                cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, offer.DeleteFlag);
                offer.ListDeleteFlag = cbDeleteFlag.ListItems;
                offer.DeleteFlag = cbDeleteFlag.SeletedValue;

                listOffers.Add(offer);
            }

            // Set value
            responseModel.ListOffers = listOffers;

            // Return value
            return responseModel;
        }
示例#4
0
 /// <summary>
 /// Check processing.
 /// </summary>
 /// <param name="inputObject">DataModel</param>
 private void Check(FilterDataModel inputObject)
 {
     // Check role
     if (!PageHelper.AuthRole(Logics.RL_OFFERS))
         throw new ExecuteException("E_MSG_00013");
 }
示例#5
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private FilterDataModel GetInfo(FilterDataModel inputObject)
        {
            // Local variable declaration
            FilterDataModel getResult = null;
            MCodeCom mCodeCom = null;
            AdminOfferListDao adminOfferListDao = null;

            // Variable initialize
            getResult = new FilterDataModel();
            mCodeCom = new MCodeCom();
            adminOfferListDao = new AdminOfferListDao();

            // Get data
            var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, true, false);
            var listOffers = adminOfferListDao.GetListOffers(inputObject);

            // Set value
            getResult.ListDeleteFlag = listDeleteFlag;
            getResult.ListOffers = listOffers;

            // Return value
            return getResult;
        }