コード例 #1
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 <OutputAcceptModel> listAccepts   = null;
            MCodeCom          mCodeCom = null;
            OutputAcceptModel accept   = null;

            // Variable initialize
            responseModel = new FilterResponseModel();
            listAccepts   = new List <OutputAcceptModel>();
            mCodeCom      = new MCodeCom();

            // Get value
            var slipStatusName     = string.Empty;
            var paymentMethodsName = string.Empty;
            var deleteFlagName     = string.Empty;
            var cbSlipStatus       = new ComboModel();

            foreach (var obj in resultObject.ListAccepts)
            {
                accept = new OutputAcceptModel();
                accept.AcceptSlipNo       = DataHelper.ToString(obj.AcceptSlipNo);
                accept.SlipStatus         = DataHelper.ToString(obj.SlipStatus);
                slipStatusName            = mCodeCom.GetCodeName(Logics.GROUP_SLIP_STATUS, accept.SlipStatus);
                accept.SlipStatusName     = DataHelper.ToString(slipStatusName);
                accept.AcceptDate         = DataHelper.ToString(Formats.DATE, obj.AcceptDate);
                accept.DeliveryDate       = DataHelper.ToString(Formats.DATE, obj.DeliveryDate);
                accept.ClientCd           = DataHelper.ToString(obj.ClientCd);
                accept.ClientName         = DataHelper.ToString(obj.ClientName);
                accept.ClientAddress      = DataHelper.ToString(obj.ClientAddress);
                accept.ClientTel          = DataHelper.ToString(obj.ClientTel);
                accept.DeliveryCd         = DataHelper.ToString(obj.DeliveryCd);
                accept.DeliveryName       = DataHelper.ToString(obj.DeliveryName);
                accept.DeliveryAddress    = DataHelper.ToString(obj.DeliveryAddress);
                accept.DeliveryTel        = DataHelper.ToString(obj.DeliveryTel);
                accept.PaymentMethods     = DataHelper.ToString(obj.PaymentMethods);
                paymentMethodsName        = mCodeCom.GetCodeName(Logics.GROUP_PAYMENT_METHODS, accept.PaymentMethods);
                accept.PaymentMethodsName = DataHelper.ToString(paymentMethodsName);
                accept.GiftCd             = DataHelper.ToString(obj.GiftCd);
                accept.ViewId             = DataHelper.ToString(obj.ViewId);
                accept.Notes          = DataHelper.ToString(obj.Notes);
                accept.UpdateUser     = DataHelper.ToString(obj.UpdateUser);
                accept.UpdateDate     = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);
                accept.DeleteFlag     = DataHelper.ToString(obj.DeleteFlag);
                deleteFlagName        = mCodeCom.GetCodeName(Logics.GROUP_DELETE_FLAG, accept.DeleteFlag);
                accept.DeleteFlagName = DataHelper.ToString(deleteFlagName);
                cbSlipStatus          = MCodeCom.ToComboItems(resultObject.ListSlipStatus, accept.SlipStatus);
                accept.ListSlipStatus = cbSlipStatus.ListItems;
                accept.SlipStatus     = cbSlipStatus.SeletedValue;
                listAccepts.Add(accept);
            }

            // Set value
            responseModel.ListAccepts = listAccepts;

            // Return value
            return(responseModel);
        }
コード例 #2
0
ファイル: InitLogic.cs プロジェクト: hieur8/web-mbec
        /// <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 <OutputAcceptModel> listAccepts   = null;
            OutputAcceptModel         accept        = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            listAccepts   = new List <OutputAcceptModel>();
            mCodeCom      = new MCodeCom();

            // Get value
            string slipStatusName = null;

            foreach (var obj in resultObject.ListAccepts)
            {
                accept = new OutputAcceptModel();

                accept.AcceptSlipNo   = DataHelper.ToString(obj.AcceptSlipNo);
                accept.AcceptDate     = DataHelper.ToString(Formats.DATE, obj.AcceptDate);
                accept.DeliveryName   = DataHelper.ToString(obj.DeliveryName);
                accept.TotalAmount    = DataHelper.ToString(Formats.CURRENCY, obj.TotalAmount);
                slipStatusName        = mCodeCom.GetCodeName(Logics.GROUP_SLIP_STATUS, obj.SlipStatus);
                accept.SlipStatus     = DataHelper.ToString(obj.SlipStatus);
                accept.SlipStatusName = DataHelper.ToString(slipStatusName);

                listAccepts.Add(accept);
            }

            // Set value
            responseModel.ListAccepts = listAccepts;
            responseModel.AcceptCount = DataHelper.ToString(Formats.NUMBER, listAccepts.Count);

            // Return value
            return(responseModel);
        }