Beispiel #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;
            OutputDetailsModel details = null;
            IList<OutputAcceptDetailsModel> listAcceptDetails = null;
            OutputAcceptDetailsModel acceptDetails = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            details = new OutputDetailsModel();
            listAcceptDetails = new List<OutputAcceptDetailsModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var accept = resultObject.Accept;
            details.AcceptSlipNo = DataHelper.ToString(accept.AcceptSlipNo);
            var slipStatusName = mCodeCom.GetCodeName(Logics.GROUP_SLIP_STATUS, accept.SlipStatus);
            details.SlipStatus = DataHelper.ToString(accept.SlipStatus);
            details.SlipStatusName = DataHelper.ToString(slipStatusName);
            details.AcceptDate = DataHelper.ToString(Formats.FULL_DATE, accept.AcceptDate);
            details.DeliveryName = DataHelper.ToString(accept.DeliveryName);
            details.DeliveryAddress = DataHelper.ToString(accept.DeliveryAddress);
            details.ClientName = DataHelper.ToString(accept.ClientName);
            details.ClientAddress = DataHelper.ToString(accept.ClientAddress);
            var paymentMethodsName = mCodeCom.GetCodeContent(Logics.GROUP_PAYMENT_METHODS, accept.PaymentMethods);
            details.PaymentMethods = DataHelper.ToString(accept.PaymentMethods);
            details.PaymentMethodsName = DataHelper.ToString(paymentMethodsName);
            var totalItem = accept.AcceptDetails.Sum(o => o.DetailAmt);
            var totalAmount = accept.TotalAmt;
            details.TotalAmount = DataHelper.ToString(Formats.CURRENCY, totalAmount);
            details.ShipAmount = DataHelper.ToString(Formats.CURRENCY, totalAmount - totalItem);
            foreach (var obj in accept.AcceptDetails)
            {
                acceptDetails = new OutputAcceptDetailsModel();
                acceptDetails.ItemCd = DataHelper.ToString(obj.ItemCd);
                acceptDetails.ItemName = DataHelper.ToString(obj.ItemName);
                acceptDetails.Price = DataHelper.ToString(Formats.CURRENCY, obj.DetailPrice);
                acceptDetails.Quantty = DataHelper.ToString(Formats.NUMBER, obj.DetailQtty);
                acceptDetails.Amount = DataHelper.ToString(Formats.CURRENCY, obj.DetailAmt);

                listAcceptDetails.Add(acceptDetails);
            }
            details.ListAcceptDetails = listAcceptDetails;

            // Set value
            responseModel.Details = new List<OutputDetailsModel>() { details };

            // Return value
            return responseModel;
        }
Beispiel #2
0
        /// <summary>
        /// Execute processing.
        /// </summary>
        /// <param name="request">RequestModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Execute(InitRequestModel request)
        {
            // Local variable declaration
            InitResponseModel responseModel = null;
            InitDataModel inputObject = null;
            InitDataModel resultObject = null;

            // Variable initialize
            responseModel = new InitResponseModel();

            // Execute convert input.
            inputObject = Convert(request);

            // Check infomation
            Check(inputObject);

            // Get infomation
            resultObject = GetInfo(inputObject);

            // Execute convert ouput.
            responseModel = Convert(resultObject);

            return responseModel;
        }