Beispiel #1
0
        /// <summary>
        /// Convert output combo items list
        /// </summary>
        /// <param name="target">List string</param>
        /// <param name="selectedValue">Selected value</param>
        /// <returns>List ListItem</returns>
        public static ComboModel ToComboItems(IList<string> target, string selectedValue)
        {
            // Local variable declaration
            ComboModel comboModel = null;
            IList<ComboItem> listComboItems = null;

            // Variable initialize
            listComboItems = new List<ComboItem>();
            comboModel = new ComboModel();

            // Get data
            var val = string.Empty;
            foreach (var obj in target)
            {
                var combo = new ComboItem();
                combo.Code = DataHelper.ToString(obj);
                combo.Name = DataHelper.ToString(obj);
                if (combo.Code == selectedValue
                    || (DataCheckHelper.IsNull(selectedValue) && target.IndexOf(obj) == 0))
                    val = combo.Code;
                listComboItems.Add(combo);
            }

            // Set value
            comboModel.SeletedValue = val;
            comboModel.ListItems = listComboItems;

            return comboModel;
        }
Beispiel #2
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<OutputGroupModel> listGroups = null;
            OutputGroupModel group = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            listGroups = new List<OutputGroupModel>();

            // Get value
            var cbDeleteFlag = new ComboModel();
            foreach (var obj in resultObject.ListGroups)
            {
                group = new OutputGroupModel();
                group.GroupCd = DataHelper.ToString(obj.GroupCd);
                group.GroupName = DataHelper.ToString(obj.GroupName);
                group.SortKey = DataHelper.ToString(Formats.NUMBER, obj.SortKey);
                group.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                group.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);

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

                listGroups.Add(group);
            }

            // Set value
            responseModel.ListGroups = listGroups;

            // Return value
            return responseModel;
        }
Beispiel #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<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;
        }
Beispiel #4
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;
        }
Beispiel #5
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<OutputCategoryModel> listCategories = null;
            OutputCategoryModel category = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            listCategories = new List<OutputCategoryModel>();

            // Get value
            var cbCategoryDiv = new ComboModel();
            var cbDeleteFlag = new ComboModel();
            foreach (var obj in resultObject.ListCategories)
            {
                category = new OutputCategoryModel();
                category.CategoryCd = DataHelper.ToString(obj.CategoryCd);
                category.CategoryName = DataHelper.ToString(obj.CategoryName);
                category.CategorySearchName = DataHelper.ToString(obj.CategorySearchName);
                category.CategoryDiv = DataHelper.ToString(obj.CategoryDiv);
                category.SortKey = DataHelper.ToString(Formats.NUMBER, obj.SortKey);
                category.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                category.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);

                cbCategoryDiv = MCodeCom.ToComboItems(resultObject.ListCategoryDiv, category.CategoryDiv);
                category.ListCategoryDiv = cbCategoryDiv.ListItems;
                category.CategoryDiv = cbCategoryDiv.SeletedValue;
                cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, category.DeleteFlag);
                category.ListDeleteFlag = cbDeleteFlag.ListItems;
                category.DeleteFlag = cbDeleteFlag.SeletedValue;

                listCategories.Add(category);
            }

            // Set value
            responseModel.ListCategories = listCategories;

            // Return value
            return responseModel;
        }
Beispiel #6
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<OutputOfferItemModel> listOfferItems = null;
            OutputOfferItemModel offerItem = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            listOfferItems = new List<OutputOfferItemModel>();

            // Get value
            var cbDeleteFlag = new ComboModel();
            foreach (var obj in resultObject.ListOfferItems)
            {
                offerItem = new OutputOfferItemModel();
                offerItem.OfferCd = DataHelper.ToString(obj.OfferCd);
                offerItem.DetailNo = DataHelper.ToString(obj.DetailNo);
                offerItem.OfferItemCd = DataHelper.ToString(obj.OfferItemCd);
                offerItem.OfferItemQtty = DataHelper.ToString(Formats.NUMBER, obj.OfferItemQtty);
                offerItem.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                offerItem.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);

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

                listOfferItems.Add(offerItem);
            }

            // Set value
            responseModel.OfferCd = resultObject.OfferCd;
            responseModel.ListOfferItems = listOfferItems;

            // Return value
            return responseModel;
        }