Exemplo n.º 1
0
        /// <summary>
        /// Get Mapper
        /// </summary>
        /// <param name="entity">Business Entity</param>
        /// <returns>Mapped Model</returns>
        public override T Map(IBusinessEntity entity)
        {
            var model = base.Map(entity);

            model.SourceLedger = entity.GetValue <string>(SourceCode.Index.SourceLedger);
            model.SourceType   = entity.GetValue <string>(SourceCode.Index.SourceType);
            model.Description  = entity.GetValue <string>(SourceCode.Index.Description);
            return(model);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get Mapper
        /// </summary>
        /// <param name="entity">Business Entity</param>
        /// <returns>Mapped Model</returns>
        public override T Map(IBusinessEntity entity)
        {
            var model = base.Map(entity);

            //model.SegmentNumber = EnumUtility.GetEnum<SegmentNumber>(entity.GetValue<string>(SegmentCodes.Index.SegmentNumber));
            model.SegmentNumber = entity.GetValue <string>(SegmentCodes.Index.SegmentNumber);
            model.SegmentCode   = entity.GetValue <string>(SegmentCodes.Index.SegmentCode);
            model.Description   = entity.GetValue <string>(SegmentCodes.Index.Description);
            return(model);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Map fields from entity view to model
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override T Map(IBusinessEntity entity)
        {
            T model = base.Map(entity);

            model.CustomerNumber           = entity.GetValue <string>(FieldsIndex.CustomerNumber);
            model.OptionalField            = entity.GetValue <string>(FieldsIndex.OptionalField);
            model.OptionalFieldDescription = entity.GetValue <string>(FieldsIndex.OptionalFieldDescription);
            model.Value            = entity.GetValue <string>(FieldsIndex.Value);
            model.ValueDescription = entity.GetValue <string>(FieldsIndex.ValueDescription);
            model.ValueSet         = entity.GetValue <string>(FieldsIndex.AddressLine1);
            model.Decimals         = entity.GetValue <Int16>(FieldsIndex.Decimals);
            model.Validate         = entity.GetValue <Int16>(FieldsIndex.Validate);

            return(model);
        }
        /// <summary>
        /// Get Mapper
        /// </summary>
        /// <param name="entity">Business Entity</param>
        /// <returns>Mapped Model</returns>
        public override T Map(IBusinessEntity entity)
        {
            var model = base.Map(entity);

            model.SequenceNumber              = entity.GetValue <long>(ReceiptDetailLotNumber.Index.SequenceNumber);
            model.LineNumber                  = entity.GetValue <int>(ReceiptDetailLotNumber.Index.LineNumber);
            model.LotNumber                   = entity.GetValue <string>(ReceiptDetailLotNumber.Index.LotNumber);
            model.ExpiryDate                  = entity.GetValue <DateTime>(ReceiptDetailLotNumber.Index.ExpiryDate);
            model.TransactionQuantity         = entity.GetValue <decimal>(ReceiptDetailLotNumber.Index.TransactionQuantity);
            model.LotQuantityInStockingUOM    = entity.GetValue <decimal>(ReceiptDetailLotNumber.Index.LotQuantityInStockingUOM);
            model.LotQuantityReturned         = entity.GetValue <decimal>(ReceiptDetailLotNumber.Index.LotQuantityReturned);
            model.LotQtyReturnedInStockingUOM = entity.GetValue <decimal>(ReceiptDetailLotNumber.Index.LotQtyReturnedInStockingUOM);

            return(model);
        }
        /// <summary>
        /// GetById
        /// </summary>
        /// <typeparam name="TKey">Key</typeparam>
        /// <param name="id">Id</param>
        /// <returns>T</returns>
        public override T GetById <TKey>(TKey id)
        {
            _businessEntity = CreateBusinessEntities();
            CheckRights(_businessEntity, SecurityType.Inquire);

            _businessEntity.SetValue(SourceJournalProfile.Fields.SourceJournalName, id);
            var exist = _businessEntity.Read(false);

            return(new T
            {
                SourceJournalName = _businessEntity.GetValue <string>(SourceJournalProfile.Index.SourceJournalName),
                ETag = _businessEntity.ETag,
                Exist = exist
            });
        }
        /// <summary>
        /// Get Mapper
        /// </summary>
        /// <param name="entity">Business Entity</param>
        /// <returns>Mapped Model</returns>
        public override T Map(IBusinessEntity entity)
        {
            var model = base.Map(entity);

            model.SequenceNumber         = entity.GetValue <long>(ReceiptDetailSerialNumber.Index.SequenceNumber);
            model.LineNumber             = entity.GetValue <int>(ReceiptDetailSerialNumber.Index.LineNumber);
            model.SerialNumber           = entity.GetValue <string>(ReceiptDetailSerialNumber.Index.SerialNumber);
            model.SerialReturned         = entity.GetValue <bool>(ReceiptDetailSerialNumber.Index.SerialReturned);
            model.TransactionQuantity    = entity.GetValue <long>(ReceiptDetailSerialNumber.Index.TransactionQuantity);
            model.SerialQuantityReturned = entity.GetValue <long>(ReceiptDetailSerialNumber.Index.SerialQuantityReturned);

            return(model);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Get Mapper
        /// </summary>
        /// <param name="entity">Business Entity</param>
        /// <returns>Mapped Model</returns>
        public override ReceiptHeader Map(IBusinessEntity entity)
        {
            var model = base.Map(entity);

            model.SequenceNumber               = entity.GetValue <long>(ReceiptHeader.Index.SequenceNumber);
            model.Description                  = entity.GetValue <string>(ReceiptHeader.Index.Description);
            model.ReceiptDate                  = entity.GetValue <DateTime>(ReceiptHeader.Index.ReceiptDate);
            model.FiscalYear                   = entity.GetValue <string>(ReceiptHeader.Index.FiscalYear);
            model.FiscalPeriod                 = (Models.Enums.FiscalPeriod)(entity.GetValue <int>(ReceiptHeader.Index.FiscalPeriod));
            model.PurchaseOrderNumber          = entity.GetValue <string>(ReceiptHeader.Index.PurchaseOrderNumber);
            model.Reference                    = entity.GetValue <string>(ReceiptHeader.Index.Reference);
            model.ReceiptType                  = (ReceiptType)(entity.GetValue <int>(ReceiptHeader.Index.ReceiptType));
            model.RateOperation                = (RateOperation)(entity.GetValue <int>(ReceiptHeader.Index.RateOperation));
            model.VendorNumber                 = entity.GetValue <string>(ReceiptHeader.Index.VendorNumber);
            model.ReceiptCurrency              = entity.GetValue <string>(ReceiptHeader.Index.ReceiptCurrency);
            model.ExchangeRate                 = entity.GetValue <decimal>(ReceiptHeader.Index.ExchangeRate);
            model.RateType                     = entity.GetValue <string>(ReceiptHeader.Index.RateType);
            model.RateDate                     = entity.GetValue <DateTime>(ReceiptHeader.Index.RateDate);
            model.RateOverride                 = (RateOverride)(entity.GetValue <int>(ReceiptHeader.Index.RateOverride));
            model.AdditionalCost               = entity.GetValue <decimal>(ReceiptHeader.Index.AdditionalCost);
            model.OrigAdditionalCostFunc       = entity.GetValue <decimal>(ReceiptHeader.Index.OrigAdditionalCostFunc);
            model.OrigAdditionalCostSource     = entity.GetValue <decimal>(ReceiptHeader.Index.OrigAdditionalCostSource);
            model.AdditionalCostCurrency       = entity.GetValue <string>(ReceiptHeader.Index.AdditionalCostCurrency);
            model.TotalExtendedCostFunctional  = entity.GetValue <decimal>(ReceiptHeader.Index.TotalExtendedCostFunctional);
            model.TotalExtendedCostSource      = entity.GetValue <decimal>(ReceiptHeader.Index.TotalExtendedCostSource);
            model.TotalExtendedCostAdjusted    = entity.GetValue <decimal>(ReceiptHeader.Index.TotalExtendedCostAdjusted);
            model.TotalAdjustedCostFunctional  = entity.GetValue <decimal>(ReceiptHeader.Index.TotalAdjustedCostFunctional);
            model.TotalReturnCost              = entity.GetValue <decimal>(ReceiptHeader.Index.TotalReturnCost);
            model.NumberOfDetailswithCost      = entity.GetValue <int>(ReceiptHeader.Index.NumberOfDetailswithCost);
            model.RequireLabels                = (RequireLabels)(entity.GetValue <int>(ReceiptHeader.Index.RequireLabels));
            model.AdditionalCostAllocationType = (AddlCostonRcptReturns)(entity.GetValue <int>(ReceiptHeader.Index.AdditionalCostAllocationType));
            model.Complete                     = (Complete)(entity.GetValue <int>(ReceiptHeader.Index.Complete));
            model.OriginalTotalCostSource      = entity.GetValue <decimal>(ReceiptHeader.Index.OriginalTotalCostSource);
            model.OriginalTotalCostFunctional  = entity.GetValue <decimal>(ReceiptHeader.Index.OriginalTotalCostFunctional);
            model.AdditionalCostFunctional     = entity.GetValue <decimal>(ReceiptHeader.Index.AdditionalCostFunctional);
            model.TotalCostReceiptAdditional   = entity.GetValue <decimal>(ReceiptHeader.Index.TotalCostReceiptAdditional);
            model.TotalAdjCostReceiptAddl      = entity.GetValue <decimal>(ReceiptHeader.Index.TotalAdjCostReceiptAddl);
            model.ReceiptCurrencyDecimals      = entity.GetValue <int>(ReceiptHeader.Index.ReceiptCurrencyDecimals);
            model.VendorShortName              = entity.GetValue <string>(ReceiptHeader.Index.VendorShortName);
            model.ICUniqueDocumentNumber       = entity.GetValue <decimal>(ReceiptHeader.Index.ICUniqueDocumentNumber);
            model.VendorExists                 = (VendorExists)(entity.GetValue <int>(ReceiptHeader.Index.VendorExists));
            model.RecordDeleted                = (RecordDeleted)(entity.GetValue <int>(ReceiptHeader.Index.RecordDeleted));
            model.TransactionNumber            = entity.GetValue <decimal>(ReceiptHeader.Index.TransactionNumber);
            model.RecordStatus                 = (RecordStatus)(entity.GetValue <int>(ReceiptHeader.Index.RecordStatus));
            model.ReceiptNumber                = entity.GetValue <string>(ReceiptHeader.Index.ReceiptNumber);
            model.NextDetailLineNumber         = entity.GetValue <int>(ReceiptHeader.Index.NextDetailLineNumber);
            model.RecordPrinted                = (RecordPrinted)(entity.GetValue <int>(ReceiptHeader.Index.RecordPrinted));
            model.PostSequenceNumber           = entity.GetValue <long>(ReceiptHeader.Index.PostSequenceNumber);
            model.OptionalFields               = entity.GetValue <long>(ReceiptHeader.Index.OptionalFields);
            model.ProcessCommand               = (ProcessCommand)(entity.GetValue <int>(ReceiptHeader.Index.ProcessCommand));
            model.VendorName                   = entity.GetValue <string>(ReceiptHeader.Index.VendorName);
            model.EnteredBy                    = entity.GetValue <string>(ReceiptHeader.Index.EnteredBy);
            model.PostingDate                  = entity.GetValue <DateTime>(ReceiptHeader.Index.PostingDate);
            return(model);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Get Mapper
        /// </summary>
        /// <param name="entity">Clear Statistics Business Entity</param>
        /// <returns>Clear Statistics Mapped Model</returns>
        public override T Map(IBusinessEntity entity)
        {
            var model = base.Map(entity);

            model.FromCustomerNo              = entity.GetValue <string>(ClearStatistics.Index.FromCustomerNo);
            model.ToCustomerNo                = entity.GetValue <string>(ClearStatistics.Index.ToCustomerNo);
            model.FromGroupCode               = entity.GetValue <string>(ClearStatistics.Index.FromGroupCode);
            model.ToGroupCode                 = entity.GetValue <string>(ClearStatistics.Index.ToGroupCode);
            model.FromNationalAccount         = entity.GetValue <string>(ClearStatistics.Index.FromNationalAccount);
            model.ToNationalAccount           = entity.GetValue <string>(ClearStatistics.Index.ToNationalAccount);
            model.FromSalesPerson             = entity.GetValue <string>(ClearStatistics.Index.FromSalesPerson);
            model.ToSalesPerson               = entity.GetValue <string>(ClearStatistics.Index.ToSalesPerson);
            model.FromItemNumber              = entity.GetValue <string>(ClearStatistics.Index.FromItemNumber);
            model.ToItemNumber                = entity.GetValue <string>(ClearStatistics.Index.ToItemNumber);
            model.ClearCustomerStatistics     = (ClearCustomerStatistics)(entity.GetValue <int>(ClearStatistics.Index.ClearCustomerStatistics));
            model.ClearGroupStatistics        = (ClearGroupStatistics)(entity.GetValue <int>(ClearStatistics.Index.ClearGroupStatistics));
            model.ClearNationalAcctStatistics = (ClearNationalAccountStatistics)(entity.GetValue <int>(ClearStatistics.Index.ClearNationalAcctStatistics));
            model.ClearSalesPersonStatistics  = (ClearSalespersonStatistics)(entity.GetValue <int>(ClearStatistics.Index.ClearSalesPersonStatistics));
            model.ClearItemStatistics         = (ClearItemStatistics)(entity.GetValue <int>(ClearStatistics.Index.ClearItemStatistics));
            model.ThroughCustomerYear         = entity.GetValue <string>(ClearStatistics.Index.ThroughCustomerYear);
            model.ThroughCustomerPeriod       = entity.GetValue <string>(ClearStatistics.Index.ThroughCustomerPeriod);
            model.ThroughNationalAcctYear     = entity.GetValue <string>(ClearStatistics.Index.ThroughNationalAcctYear);
            model.ThroughNationalAcctPeriod   = entity.GetValue <string>(ClearStatistics.Index.ThroughNationalAcctPeriod);
            model.ThroughGroupYear            = entity.GetValue <string>(ClearStatistics.Index.ThroughGroupYear);
            model.ThroughGroupPeriod          = entity.GetValue <string>(ClearStatistics.Index.ThroughGroupPeriod);
            model.ThroughSalesPersonYear      = entity.GetValue <string>(ClearStatistics.Index.ThroughSalesPersonYear);
            model.ThroughSalesPersonPeriod    = entity.GetValue <string>(ClearStatistics.Index.ThroughSalesPersonPeriod);
            model.ThroughItemYear             = entity.GetValue <string>(ClearStatistics.Index.ThroughItemYear);
            model.ThroughItemPeriod           = entity.GetValue <string>(ClearStatistics.Index.ThroughItemPeriod);
            return(model);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Get Mapper
        /// </summary>
        /// <param name="entity">Business Entity</param>
        /// <returns>Mapped Model</returns>
        public override T Map(IBusinessEntity entity)
        {
            var model = base.Map(entity);

            model.TaxAuthority         = entity.GetValue <string>(TaxAuthorities.Index.TaxAuthority);
            model.Description          = entity.GetValue <string>(TaxAuthorities.Index.Description);
            model.TaxReportingCurrency = entity.GetValue <string>(TaxAuthorities.Index.TaxReportingCurrency);
            model.MaximumTaxAllowable  = entity.GetValue <decimal>(TaxAuthorities.Index.MaximumTaxAllowable);
            model.NoTaxChargedBelow    = entity.GetValue <decimal>(TaxAuthorities.Index.NoTaxChargedBelow);
            model.TaxBase                      = (TaxBase)(entity.GetValue <int>(TaxAuthorities.Index.TaxBase));
            model.AllowTaxInPrice              = (AllowTaxInPrice)(entity.GetValue <int>(TaxAuthorities.Index.AllowTaxInPrice));
            model.TaxLiabilityAccount          = entity.GetValue <string>(TaxAuthorities.Index.TaxLiabilityAccount);
            model.ReportLevel                  = (ReportLevel)(entity.GetValue <int>(TaxAuthorities.Index.ReportLevel));
            model.TaxRecoverable               = (TaxRecoverable)(entity.GetValue <int>(TaxAuthorities.Index.TaxRecoverable));
            model.RecoverableRate              = entity.GetValue <decimal>(TaxAuthorities.Index.RecoverableRate);
            model.RecoverableTaxAccount        = entity.GetValue <string>(TaxAuthorities.Index.RecoverableTaxAccount);
            model.ExpenseSeparately            = (ExpenseSeparately)(entity.GetValue <int>(TaxAuthorities.Index.ExpenseSeparately));
            model.ExpenseAccount               = entity.GetValue <string>(TaxAuthorities.Index.ExpenseAccount);
            model.LastMaintained               = entity.GetValue <DateTime>(TaxAuthorities.Index.LastMaintained);
            model.TaxType                      = (TaxType)(entity.GetValue <int>(TaxAuthorities.Index.TaxType));
            model.ReportTaxonRetainageDocument = (ReportTaxonRetainageDocument)(entity.GetValue <int>(TaxAuthorities.Index.ReportTaxonRetainageDocument));
            return(model);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Get Mapper
        /// </summary>
        /// <param name="entity">Business Entity</param>
        /// <returns>Mapped Model</returns>
        public override T Map(IBusinessEntity entity)
        {
            var model = base.Map(entity);

            model.SourceJournalName            = entity.GetValue <string>(SourceJournalProfile.Index.SourceJournalName);
            model.SourceCodeID01               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID01);
            model.SourceType01                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType01);
            model.SourceCodeID02               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID02);
            model.SourceType02                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType02);
            model.SourceCodeID03               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID03);
            model.SourceType03                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType03);
            model.SourceCodeID04               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID04);
            model.SourceType04                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType04);
            model.SourceCodeID05               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID05);
            model.SourceType05                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType05);
            model.SourceCodeID06               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID06);
            model.SourceType06                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType06);
            model.SourceCodeID07               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID07);
            model.SourceType07                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType07);
            model.SourceCodeID08               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID08);
            model.SourceType08                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType08);
            model.SourceCodeID09               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID09);
            model.SourceType09                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType09);
            model.SourceCodeID10               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID10);
            model.SourceType10                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType10);
            model.SourceCodeID11               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID11);
            model.SourceType11                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType11);
            model.SourceCodeID12               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID12);
            model.SourceType12                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType12);
            model.SourceCodeID13               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID13);
            model.SourceType13                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType13);
            model.SourceCodeID14               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID14);
            model.SourceType14                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType14);
            model.SourceCodeID15               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID15);
            model.SourceType15                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType15);
            model.SourceCodeID16               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID16);
            model.SourceType16                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType16);
            model.SourceCodeID17               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID17);
            model.SourceType17                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType17);
            model.SourceCodeID18               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID18);
            model.SourceType18                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType18);
            model.SourceCodeID19               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID19);
            model.SourceType19                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType19);
            model.SourceCodeID20               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID20);
            model.SourceType20                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType20);
            model.SourceCodeID21               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID21);
            model.SourceType21                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType21);
            model.SourceCodeID22               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID22);
            model.SourceType22                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType22);
            model.SourceCodeID23               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID23);
            model.SourceType23                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType23);
            model.SourceCodeID24               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID24);
            model.SourceType24                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType24);
            model.SourceCodeID25               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID25);
            model.SourceType25                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType25);
            model.SourceCodeID26               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID26);
            model.SourceType26                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType26);
            model.SourceCodeID27               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID27);
            model.SourceType27                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType27);
            model.SourceCodeID28               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID28);
            model.SourceType28                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType28);
            model.SourceCodeID29               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID29);
            model.SourceType29                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType29);
            model.SourceCodeID30               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID30);
            model.SourceType30                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType30);
            model.SourceCodeID31               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID31);
            model.SourceType31                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType31);
            model.SourceCodeID32               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID32);
            model.SourceType32                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType32);
            model.SourceCodeID33               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID33);
            model.SourceType33                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType33);
            model.SourceCodeID34               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID34);
            model.SourceType34                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType34);
            model.SourceCodeID35               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID35);
            model.SourceType35                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType35);
            model.SourceCodeID36               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID36);
            model.SourceType36                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType36);
            model.SourceCodeID37               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID37);
            model.SourceType37                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType37);
            model.SourceCodeID38               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID38);
            model.SourceType38                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType38);
            model.SourceCodeID39               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID39);
            model.SourceType39                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType39);
            model.SourceCodeID40               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID40);
            model.SourceType40                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType40);
            model.SourceCodeID41               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID41);
            model.SourceType41                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType41);
            model.SourceCodeID42               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID42);
            model.SourceType42                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType42);
            model.SourceCodeID43               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID43);
            model.SourceType43                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType43);
            model.SourceCodeID44               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID44);
            model.SourceType44                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType44);
            model.SourceCodeID45               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID45);
            model.SourceType45                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType45);
            model.SourceCodeID46               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID46);
            model.SourceType46                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType46);
            model.SourceCodeID47               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID47);
            model.SourceType47                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType47);
            model.SourceCodeID48               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID48);
            model.SourceType48                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType48);
            model.SourceCodeID49               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID49);
            model.SourceType49                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType49);
            model.SourceCodeID50               = entity.GetValue <string>(SourceJournalProfile.Index.SourceCodeID50);
            model.SourceType50                 = entity.GetValue <string>(SourceJournalProfile.Index.SourceType50);
            model.RESERVEDFunctionalReportName = entity.GetValue <string>(SourceJournalProfile.Index.RESERVEDFunctionalReportName);
            model.RESERVEDSourceReportName     = entity.GetValue <string>(SourceJournalProfile.Index.RESERVEDSourceReportName);
            return(model);
        }
        /// <summary>
        /// Gets SourceJournal Detail
        /// </summary>
        /// <param name="id">sourceJournalName</param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        public EnumerableResponse <SourceCode> GetSourceJournal(string id, int pageNumber, int pageSize)
        {
            _businessEntity = CreateBusinessEntities();

            _businessEntity.SetValue(SourceJournalProfile.Fields.SourceJournalName, id);
            var exist = _businessEntity.Read(false);

            var sourceJournal = new List <SourceCode>();

            int dataIndex = 1;

            var totalResultCount = 0;

            if (exist)
            {
                for (var i = 1; i <= SourceJournalProfileCount; i++)
                {
                    var iStringVal = i.ToString(CultureInfo.InvariantCulture);

                    string sourceLedgerColumnName;
                    string sourceTypeColumnName;

                    if (i <= 9)
                    {
                        sourceLedgerColumnName = SourceLedgerFieldName + "0" + iStringVal;
                        sourceTypeColumnName   = SourceTypeFieldName + "0" + iStringVal;
                    }
                    else
                    {
                        sourceLedgerColumnName = SourceLedgerFieldName + iStringVal;
                        sourceTypeColumnName   = SourceTypeFieldName + iStringVal;
                    }

                    var sourceLedger = _businessEntity.GetValue <string>(sourceLedgerColumnName);
                    var sourceType   = _businessEntity.GetValue <string>(sourceTypeColumnName);

                    if (!string.IsNullOrEmpty(sourceLedger) && !string.IsNullOrEmpty(sourceType))
                    {
                        using (var sourceCodeRepository = Resolve <ISourceCodeEntity <SourceCode> >())
                        {
                            var sourceCode = sourceCodeRepository.GetByIds(sourceLedger, sourceType);
                            var source     = sourceLedger + "-" + sourceType;
                            sourceCode.Source = source;
                            sourceCode.PreviousSourceValue = source;
                            sourceCode.SerialNumber        = dataIndex;
                            sourceCode.DisplayIndex        = dataIndex;
                            sourceJournal.Add(sourceCode);
                        }

                        totalResultCount = totalResultCount + 1;
                    }
                    else
                    {
                        break;
                    }

                    dataIndex = dataIndex + 1;
                }
            }

            //If Page size and Page Numer is -1 - Send all the records
            if (sourceJournal.Count > 0 && (pageSize >= 0 && pageNumber >= 0))
            {
                sourceJournal = sourceJournal.Skip(pageNumber * pageSize).Take(pageSize).ToList();
            }

            return(new EnumerableResponse <SourceCode> {
                Items = sourceJournal, TotalResultsCount = totalResultCount
            });
        }
Exemplo n.º 12
0
        /// <summary>
        /// Map fields from entity view to model
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override T Map(IBusinessEntity entity)
        {
            T model = base.Map(entity);

            model.CustomerNumber  = entity.GetValue <string>(FieldsIndex.CustomerNumber);
            model.ShortName       = entity.GetValue <string>(FieldsIndex.ShortName);
            model.GroupCode       = entity.GetValue <string>(FieldsIndex.GroupCode);
            model.CustomerName    = entity.GetValue <string>(FieldsIndex.CustomerName);
            model.AddressLine1    = entity.GetValue <string>(FieldsIndex.AddressLine1);
            model.City            = entity.GetValue <string>(FieldsIndex.City);
            model.StateOrProv     = entity.GetValue <string>(FieldsIndex.StateOrProv);
            model.ZipOrPostalCode = entity.GetValue <string>(FieldsIndex.ZipOrPostalCode);
            model.Country         = entity.GetValue <string>(FieldsIndex.Country);
            model.ContactName     = entity.GetValue <string>(FieldsIndex.ContactName);
            model.PhoneNumber     = entity.GetValue <string>(FieldsIndex.PhoneNumber);
            model.FaxNumber       = entity.GetValue <string>(FieldsIndex.FaxNumber);
            model.Email           = entity.GetValue <string>(FieldsIndex.Email);

            return(model);
        }
Exemplo n.º 13
0
        /// <summary>
        /// Get Mapper
        /// </summary>
        /// <param name="entity">Business Entity</param>
        /// <returns>Mapped Model</returns>
        public override ReceiptOptionalField Map(IBusinessEntity entity)
        {
            var model = base.Map(entity);

            model.SequenceNumber           = entity.GetValue <long>(ReceiptOptionalField.Index.SequenceNumber);
            model.OptionalField            = entity.GetValue <string>(ReceiptOptionalField.Index.OptionalField);
            model.Value                    = entity.GetValue <string>(ReceiptOptionalField.Index.Value);
            model.Type                     = EnumUtility.GetEnum <Enums.Type>(entity.GetValue <string>(ReceiptOptionalField.Index.Type));
            model.Length                   = entity.GetValue <int>(ReceiptOptionalField.Index.Length);
            model.Decimals                 = entity.GetValue <int>(ReceiptOptionalField.Index.Decimals);
            model.AllowBlank               = (entity.GetValue <string>(ReceiptOptionalField.Index.AllowBlank) == "False") ? Enums.AllowBlank.No : Enums.AllowBlank.Yes;
            model.Validate                 = (entity.GetValue <string>(ReceiptOptionalField.Index.Validate) == "False") ? Enums.Validate.No : Enums.Validate.Yes;
            model.ValueSet                 = EnumUtility.GetEnum <Enums.ValueSet>(entity.GetValue <string>(ReceiptOptionalField.Index.ValueSet));
            model.TypedValueFieldIndex     = entity.GetValue <long>(ReceiptOptionalField.Index.TypedValueFieldIndex);
            model.TextValue                = entity.GetValue <string>(ReceiptOptionalField.Index.TextValue);
            model.AmountValue              = entity.GetValue <decimal>(ReceiptOptionalField.Index.AmountValue);
            model.NumberValue              = entity.GetValue <decimal>(ReceiptOptionalField.Index.NumberValue);
            model.IntegerValue             = entity.GetValue <long>(ReceiptOptionalField.Index.IntegerValue);
            model.YesNoValue               = (entity.GetValue <string>(ReceiptOptionalField.Index.YesNoValue) == "False") ? Enums.YesNoValue.No : Enums.YesNoValue.Yes;
            model.DateValue                = entity.GetValue <DateTime>(ReceiptOptionalField.Index.DateValue);
            model.TimeValue                = entity.GetValue <DateTime>(ReceiptOptionalField.Index.TimeValue);
            model.OptionalFieldDescription = entity.GetValue <string>(ReceiptOptionalField.Index.OptionalFieldDescription);
            model.ValueDescription         = entity.GetValue <string>(ReceiptOptionalField.Index.ValueDescription);

            return(model);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Get Mapper
        /// </summary>
        /// <param name="entity">Business Entity</param>
        /// <returns>Mapped Model</returns>
        public override ReceiptDetail Map(IBusinessEntity entity)
        {
            var model = base.Map(entity);

            model.SequenceNumber           = entity.GetValue <long>(ReceiptDetail.Index.SequenceNumber);
            model.LineNumber               = entity.GetValue <int>(ReceiptDetail.Index.LineNumber);
            model.ItemNumber               = entity.GetValue <string>(ReceiptDetail.Index.ItemNumber);
            model.ItemDescription          = entity.GetValue <string>(ReceiptDetail.Index.ItemDescription);
            model.Category                 = entity.GetValue <string>(ReceiptDetail.Index.Category);
            model.Location                 = entity.GetValue <string>(ReceiptDetail.Index.Location);
            model.QuantityReceived         = entity.GetValue <decimal>(ReceiptDetail.Index.QuantityReceived);
            model.QuantityReturned         = entity.GetValue <decimal>(ReceiptDetail.Index.QuantityReturned);
            model.UnitOfMeasure            = entity.GetValue <string>(ReceiptDetail.Index.UnitOfMeasure);
            model.ConversionFactor         = entity.GetValue <decimal>(ReceiptDetail.Index.ConversionFactor);
            model.ProratedAddlCostFunc     = entity.GetValue <decimal>(ReceiptDetail.Index.ProratedAddlCostFunc);
            model.ProratedAddlCostSrc      = entity.GetValue <decimal>(ReceiptDetail.Index.ProratedAddlCostSrc);
            model.UnitCost                 = entity.GetValue <decimal>(ReceiptDetail.Index.UnitCost);
            model.AdjustedUnitCost         = entity.GetValue <decimal>(ReceiptDetail.Index.AdjustedUnitCost);
            model.AdjustedCost             = entity.GetValue <decimal>(ReceiptDetail.Index.AdjustedCost);
            model.AdjustedCostFunctional   = entity.GetValue <decimal>(ReceiptDetail.Index.AdjustedCostFunctional);
            model.ExtendedCost             = entity.GetValue <decimal>(ReceiptDetail.Index.ExtendedCost);
            model.ExtendedCostFunctional   = entity.GetValue <decimal>(ReceiptDetail.Index.ExtendedCostFunctional);
            model.ReturnCost               = entity.GetValue <decimal>(ReceiptDetail.Index.ReturnCost);
            model.CostingDate              = entity.GetValue <DateTime>(ReceiptDetail.Index.CostingDate);
            model.CostingSequenceNo        = entity.GetValue <long>(ReceiptDetail.Index.CostingSequenceNo);
            model.OriginalReceiptQty       = entity.GetValue <decimal>(ReceiptDetail.Index.OriginalReceiptQty);
            model.OriginalUnitCost         = entity.GetValue <decimal>(ReceiptDetail.Index.OriginalUnitCost);
            model.OriginalExtendedCost     = entity.GetValue <decimal>(ReceiptDetail.Index.OriginalExtendedCost);
            model.OriginalExtendedCostFunc = entity.GetValue <decimal>(ReceiptDetail.Index.OriginalExtendedCostFunc);
            model.Comments                 = entity.GetValue <string>(ReceiptDetail.Index.Comments);
            model.Labels    = entity.GetValue <int>(ReceiptDetail.Index.Labels);
            model.StockItem = entity.GetValue <bool>(ReceiptDetail.Index.StockItem);
            model.ManufacturersItemNumber   = entity.GetValue <string>(ReceiptDetail.Index.ManufacturersItemNumber);
            model.VendorItemNumber          = entity.GetValue <string>(ReceiptDetail.Index.VendorItemNumber);
            model.DetailLineNumber          = entity.GetValue <int>(ReceiptDetail.Index.DetailLineNumber);
            model.QuantityReturnedToDate    = entity.GetValue <decimal>(ReceiptDetail.Index.QuantityReturnedToDate);
            model.ReturnedExtCostToDate     = entity.GetValue <decimal>(ReceiptDetail.Index.ReturnedExtCostToDate);
            model.ReturnedExtCostFuncToDate = entity.GetValue <decimal>(ReceiptDetail.Index.ReturnedExtCostFuncToDate);
            model.AdjustedExtCostToDate     = entity.GetValue <decimal>(ReceiptDetail.Index.AdjustedExtCostToDate);
            model.AdjustedExtCostFuncToDate = entity.GetValue <decimal>(ReceiptDetail.Index.AdjustedExtCostFuncToDate);
            model.PreviousDayEndReceiptQty  = entity.GetValue <decimal>(ReceiptDetail.Index.PreviousDayEndReceiptQty);
            model.PreviousDayEndUnitCost    = entity.GetValue <decimal>(ReceiptDetail.Index.PreviousDayEndUnitCost);
            model.PreviousDayEndExtCost     = entity.GetValue <decimal>(ReceiptDetail.Index.PreviousDayEndExtCost);
            model.PreviousDayEndExtCostFunc = entity.GetValue <decimal>(ReceiptDetail.Index.PreviousDayEndExtCostFunc);
            model.UnformattedItemNumber     = entity.GetValue <string>(ReceiptDetail.Index.UnformattedItemNumber);
            model.CheckBelowZero            = entity.GetValue <bool>(ReceiptDetail.Index.CheckBelowZero);
            model.RevisionListLineNumber    = entity.GetValue <int>(ReceiptDetail.Index.RevisionListLineNumber);
            model.InterprocessCommID        = entity.GetValue <long>(ReceiptDetail.Index.InterprocessCommID);
            model.ForcePopupSN               = entity.GetValue <bool>(ReceiptDetail.Index.ForcePopupSN);
            model.PopupSN                    = entity.GetValue <int>(ReceiptDetail.Index.PopupSN);
            model.CloseSN                    = entity.GetValue <bool>(ReceiptDetail.Index.CloseSN);
            model.LTSetID                    = entity.GetValue <long>(ReceiptDetail.Index.LTSetID);
            model.ForcePopupLT               = entity.GetValue <bool>(ReceiptDetail.Index.ForcePopupLT);
            model.PopupLT                    = entity.GetValue <int>(ReceiptDetail.Index.PopupLT);
            model.CloseLT                    = entity.GetValue <bool>(ReceiptDetail.Index.CloseLT);
            model.OptionalFields             = entity.GetValue <long>(ReceiptDetail.Index.OptionalFields);
            model.ProcessCommand             = (ProcessCommand)(entity.GetValue <int>(ReceiptDetail.Index.ProcessCommand));
            model.SerialQuantity             = entity.GetValue <long>(ReceiptDetail.Index.SerialQuantity);
            model.LotQuantity                = entity.GetValue <decimal>(ReceiptDetail.Index.LotQuantity);
            model.SerialQuantityReturned     = entity.GetValue <long>(ReceiptDetail.Index.SerialQuantityReturned);
            model.LotQuantityReturned        = entity.GetValue <decimal>(ReceiptDetail.Index.LotQuantityReturned);
            model.SerialLotQuantityToProcess = entity.GetValue <decimal>(ReceiptDetail.Index.SerialLotQuantityToProcess);
            model.NumberOfLotsToGenerate     = entity.GetValue <decimal>(ReceiptDetail.Index.NumberOfLotsToGenerate);
            model.QuantityperLot             = entity.GetValue <decimal>(ReceiptDetail.Index.QuantityperLot);
            model.ReceiptType                = (ReceiptType)(entity.GetValue <int>(ReceiptDetail.Index.ReceiptType));
            model.AllocateFromSerial         = entity.GetValue <string>(ReceiptDetail.Index.AllocateFromSerial);
            model.AllocateFromLot            = entity.GetValue <string>(ReceiptDetail.Index.AllocateFromLot);
            model.SerialLotWindowHandle      = entity.GetValue <long>(ReceiptDetail.Index.SerialLotWindowHandle);
            return(model);
        }