Ejemplo n.º 1
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel responseModel = null;
            IList<OutputOfferModel> listOffers = null;
            OutputOfferModel offer = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            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);
            }

            var cbOfferDiv = MCodeCom.ToComboItems(resultObject.ListOfferDiv, null);
            cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, null);

            // Set value
            responseModel.ListOfferDiv = cbOfferDiv.ListItems;
            responseModel.ListDeleteFlag = cbDeleteFlag.ListItems;
            responseModel.ListOffers = listOffers;

            // Return value
            return responseModel;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Execute convert input.
        /// </summary>
        /// <param name="request">RequestModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel Convert(InitRequestModel request)
        {
            // Local variable declaration
            InitDataModel inputObject = null;

            // Variable initialize
            inputObject = new InitDataModel();

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

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

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

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

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

            // Return value
            return getResult;
        }