/// <summary>
 /// CheckSourceCode
 /// </summary>
 /// <param name="sourceLedger">Source Ledger</param>
 /// <param name="sourceType">Source Type</param>
 /// <returns>True/False</returns>
 public bool CheckValidSourceCode(string sourceLedger, string sourceType)
 {
     _businessEntity = CreateBusinessEntities();
     _businessEntity.SetValue(SourceJournalProfile.Fields.SourceCodeID01, sourceLedger);
     _businessEntity.SetValue(SourceJournalProfile.Fields.SourceType01, sourceType, true);
     return(true);
 }
예제 #2
0
        /// <summary>
        /// Set Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        public override void Map(T model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SetValue(SourceCode.Index.SourceLedger, model.SourceLedger);
            entity.SetValue(SourceCode.Index.SourceType, model.SourceType);
            entity.SetValue(SourceCode.Index.Description, model.Description);
        }
예제 #3
0
        /// <summary>
        /// Set Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        public override void Map(T model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SetValue(SegmentCodes.Index.SegmentNumber, model.SegmentNumber);
            entity.SetValue(SegmentCodes.Index.SegmentCode, model.SegmentCode);
            entity.SetValue(SegmentCodes.Index.Description, model.Description);
        }
        /// <summary>
        /// SetValue Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        public override void Map(ReceiptDetailOptionalField model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SetValue(ReceiptDetailOptionalField.Index.SequenceNumber, model.SequenceNumber);
            entity.SetValue(ReceiptDetailOptionalField.Index.LineNumber, model.LineNumber);
            entity.SetValue(ReceiptDetailOptionalField.Index.OptionalField, model.OptionalField);

            if (model.ValueSet == TypeEnum.ValueSet.No)
            {
                return;
            }
            switch (model.Type)
            {
            case Models.Enums.Type.Text:
                entity.SetValue(ReceiptDetailOptionalField.Index.TextValue, model.Value, model.Validate == TypeEnum.Validate.Yes);
                break;

            case Models.Enums.Type.Integer:
                entity.SetValue(ReceiptDetailOptionalField.Index.IntegerValue, model.Value, model.Validate == TypeEnum.Validate.Yes);
                break;

            case Models.Enums.Type.Amount:
                entity.SetValue(ReceiptDetailOptionalField.Index.AmountValue, model.Value, model.Validate == TypeEnum.Validate.Yes);
                break;

            case Models.Enums.Type.Number:
                entity.SetValue(ReceiptDetailOptionalField.Index.NumberValue, model.Value, model.Validate == TypeEnum.Validate.Yes);
                break;

            case Models.Enums.Type.Date:
                if (string.IsNullOrEmpty(model.Value))
                {
                    model.Value = null;
                }
                entity.SetValue(ReceiptDetailOptionalField.Index.DateValue, model.Value, model.Validate == TypeEnum.Validate.Yes);
                break;

            case Models.Enums.Type.Time:
                entity.SetValue(ReceiptDetailOptionalField.Index.TimeValue, model.Value, model.Validate == TypeEnum.Validate.Yes);
                break;

            case Models.Enums.Type.YesOrNo:
                entity.SetValue(ReceiptDetailOptionalField.Index.YesNoValue, model.Value, model.Validate == TypeEnum.Validate.Yes);
                break;
            }
        }
예제 #5
0
        /// <summary>
        /// Get the source code based on primary key
        /// </summary>
        /// <param name="sourceLedger">Source Ledger</param>
        /// <param name="sourceType">Source Type</param>
        /// <returns>Source Code</returns>
        public T GetByIds(string sourceLedger, string sourceType)
        {
            _businessEntity = CreateBusinessEntities();
            CheckRights(_businessEntity, SecurityType.Inquire);

            _businessEntity.SetValue(SourceCode.Fields.SourceLedger, sourceLedger);
            _businessEntity.SetValue(SourceCode.Fields.SourceType, sourceType);
            if (!_businessEntity.Read(false))
            {
                return(null);
            }
            var sourceCodeMapper = new SourceCodeMapper <T>(Context);

            return(sourceCodeMapper.Map(_businessEntity));
        }
        /// <summary>
        /// SetValue Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        public override void Map(T model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SetValue(ReceiptOptionalField.Index.SequenceNumber, model.SequenceNumber);
            entity.SetValue(ReceiptOptionalField.Index.OptionalField, model.OptionalField);

            if (model.ValueSet == Enums.ValueSet.No)
            {
                return;
            }
            switch (model.Type)
            {
            case Enums.Type.Text:
                entity.SetValue(ReceiptOptionalField.Index.TextValue, model.Value, model.Validate == Enums.Validate.Yes);
                break;

            case Enums.Type.Integer:
                entity.SetValue(ReceiptOptionalField.Index.IntegerValue, model.Value, model.Validate == Enums.Validate.Yes);
                break;

            case Enums.Type.Amount:
                entity.SetValue(ReceiptOptionalField.Index.AmountValue, model.Value, model.Validate == Enums.Validate.Yes);
                break;

            case Enums.Type.Number:
                entity.SetValue(ReceiptOptionalField.Index.NumberValue, model.Value, model.Validate == Enums.Validate.Yes);
                break;

            case Enums.Type.Date:
                if (model.Value == "")
                {
                    model.Value = null;
                }
                entity.SetValue(ReceiptOptionalField.Index.DateValue, model.Value, model.Validate == Enums.Validate.Yes);
                break;

            case Enums.Type.Time:
                entity.SetValue(ReceiptOptionalField.Index.TimeValue, model.Value, model.Validate == Enums.Validate.Yes);
                break;

            case Enums.Type.YesOrNo:
                entity.SetValue(ReceiptOptionalField.Index.YesNoValue, model.Value, model.Validate == Enums.Validate.Yes);
                break;
            }
        }
예제 #7
0
 /// <summary>
 /// Map model fields to business entity view fields
 /// </summary>
 /// <param name="model"></param>
 /// <param name="entity"></param>
 public override void Map(T model, IBusinessEntity entity)
 {
     entity.SetValue(FieldsIndex.CustomerNumber, model.CustomerNumber);
     entity.SetValue(FieldsIndex.OptionalField, model.OptionalField);
     entity.SetValue(FieldsIndex.OptionalFieldDescription, model.OptionalFieldDescription);
     entity.SetValue(FieldsIndex.Value, model.Value);
     entity.SetValue(FieldsIndex.ValueDescription, model.ValueDescription);
     entity.SetValue(FieldsIndex.ValueSet, model.ValueSet);
     entity.SetValue(FieldsIndex.Decimals, model.Decimals);
     entity.SetValue(FieldsIndex.Validate, model.Validate);
 }
        /// <summary>
        /// Set Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        /// <exception cref="System.NotImplementedException"></exception>
        public override void Map(T model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SetValue(SourceJournalProfile.Index.SourceJournalName, model.SourceJournalName);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID01, model.SourceCodeID01);
            entity.SetValue(SourceJournalProfile.Index.SourceType01, model.SourceType01);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID02, model.SourceCodeID02);
            entity.SetValue(SourceJournalProfile.Index.SourceType02, model.SourceType02);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID03, model.SourceCodeID03);
            entity.SetValue(SourceJournalProfile.Index.SourceType03, model.SourceType03);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID04, model.SourceCodeID04);
            entity.SetValue(SourceJournalProfile.Index.SourceType04, model.SourceType04);
        }
        /// <summary>
        /// Se tValue Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        public override void Map(T model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SetValue(ReceiptDetailLotNumber.Index.SequenceNumber, model.SequenceNumber);
            entity.SetValue(ReceiptDetailLotNumber.Index.LineNumber, model.LineNumber);
            entity.SetValue(ReceiptDetailLotNumber.Index.LotNumber, model.LotNumber);
            entity.SetValue(ReceiptDetailLotNumber.Index.ExpiryDate, model.ExpiryDate);
            entity.SetValue(ReceiptDetailLotNumber.Index.TransactionQuantity, model.TransactionQuantity);
            entity.SetValue(ReceiptDetailLotNumber.Index.LotQuantityInStockingUOM, model.LotQuantityInStockingUOM);
            entity.SetValue(ReceiptDetailLotNumber.Index.LotQuantityReturned, model.LotQuantityReturned);
            entity.SetValue(ReceiptDetailLotNumber.Index.LotQtyReturnedInStockingUOM, model.LotQtyReturnedInStockingUOM);
        }
        /// <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>
        /// SetValue Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        public override void Map(T model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SetValue(ReceiptDetailSerialNumber.Index.SequenceNumber, model.SequenceNumber);
            entity.SetValue(ReceiptDetailSerialNumber.Index.LineNumber, model.LineNumber);
            entity.SetValue(ReceiptDetailSerialNumber.Index.SerialNumber, model.SerialNumber);
            entity.SetValue(ReceiptDetailSerialNumber.Index.SerialReturned, model.SerialReturned);
            entity.SetValue(ReceiptDetailSerialNumber.Index.TransactionQuantity, model.TransactionQuantity);
            entity.SetValue(ReceiptDetailSerialNumber.Index.SerialQuantityReturned, model.SerialQuantityReturned);
        }
        /// <summary>
        /// Delete
        /// </summary>
        /// <param name="id">Source Journal Name</param>
        /// <returns>SourceJournalProfile</returns>
        public T Delete(string id)
        {
            _businessEntity = CreateBusinessEntities();
            _businessEntity.SetValue(SourceJournalProfile.Fields.SourceJournalName, id);

            if (_businessEntity.Read(false))
            {
                _businessEntity.Delete();
            }
            else
            {
                throw ExceptionHelper.RowNotFoundException(CommonResx.DeleteFailedNoRecordMessage);
            }

            _businessEntity.Cancel();

            var mapper = new SourceJournalProfileMapper <T>(_context);

            return(mapper.Map(_businessEntity));
        }
예제 #13
0
        /// <summary>
        /// Set Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        public override void Map(T model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SetValue(TaxAuthorities.Index.TaxAuthority, model.TaxAuthority);
            entity.SetValue(TaxAuthorities.Index.Description, model.Description);
            entity.SetValue(TaxAuthorities.Index.TaxReportingCurrency, model.TaxReportingCurrency);
            entity.SetValue(TaxAuthorities.Index.MaximumTaxAllowable, model.MaximumTaxAllowable);
            entity.SetValue(TaxAuthorities.Index.NoTaxChargedBelow, model.NoTaxChargedBelow);
            entity.SetValue(TaxAuthorities.Index.TaxBase, model.TaxBase);
            entity.SetValue(TaxAuthorities.Index.AllowTaxInPrice, model.AllowTaxInPrice);
            entity.SetValue(TaxAuthorities.Index.TaxLiabilityAccount, model.TaxLiabilityAccount);
            entity.SetValue(TaxAuthorities.Index.ReportLevel, model.ReportLevel);
            entity.SetValue(TaxAuthorities.Index.TaxRecoverable, model.TaxRecoverable);
            entity.SetValue(TaxAuthorities.Index.RecoverableRate, model.RecoverableRate);
            entity.SetValue(TaxAuthorities.Index.RecoverableTaxAccount, model.RecoverableTaxAccount);
            entity.SetValue(TaxAuthorities.Index.ExpenseSeparately, model.ExpenseSeparately);
            entity.SetValue(TaxAuthorities.Index.ExpenseAccount, model.ExpenseAccount);
            // entity.SetValue(TaxAuthorities.Index.LastMaintained, model.LastMaintained);
            entity.SetValue(TaxAuthorities.Index.TaxType, model.TaxType);
            entity.SetValue(TaxAuthorities.Index.ReportTaxonRetainageDocument, model.ReportTaxonRetainageDocument);
        }
예제 #14
0
 /// <summary>
 /// Map Key
 /// </summary>
 /// <param name="model">Model</param>
 /// <param name="entity">Business Entity</param>
 public override void MapKey(T model, IBusinessEntity entity)
 {
     entity.SetValue(TaxAuthorities.Index.TaxAuthority, model.TaxAuthority);
 }
예제 #15
0
 /// <summary>
 /// Map Key
 /// </summary>
 /// <param name="model">Model</param>
 /// <param name="entity">Business Entity</param>
 public override void MapKey(T model, IBusinessEntity entity)
 {
     entity.SetValue(SourceJournalProfile.Index.SourceJournalName, model.SourceJournalName);
 }
예제 #16
0
        /// <summary>
        /// Set Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        public override void Map(T model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SetValue(SourceJournalProfile.Index.SourceJournalName, model.SourceJournalName);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID01, model.SourceCodeID01);
            entity.SetValue(SourceJournalProfile.Index.SourceType01, model.SourceType01);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID02, model.SourceCodeID02);
            entity.SetValue(SourceJournalProfile.Index.SourceType02, model.SourceType02);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID03, model.SourceCodeID03);
            entity.SetValue(SourceJournalProfile.Index.SourceType03, model.SourceType03);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID04, model.SourceCodeID04);
            entity.SetValue(SourceJournalProfile.Index.SourceType04, model.SourceType04);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID05, model.SourceCodeID05);
            entity.SetValue(SourceJournalProfile.Index.SourceType05, model.SourceType05);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID06, model.SourceCodeID06);
            entity.SetValue(SourceJournalProfile.Index.SourceType06, model.SourceType06);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID07, model.SourceCodeID07);
            entity.SetValue(SourceJournalProfile.Index.SourceType07, model.SourceType07);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID08, model.SourceCodeID08);
            entity.SetValue(SourceJournalProfile.Index.SourceType08, model.SourceType08);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID09, model.SourceCodeID09);
            entity.SetValue(SourceJournalProfile.Index.SourceType09, model.SourceType09);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID10, model.SourceCodeID10);
            entity.SetValue(SourceJournalProfile.Index.SourceType10, model.SourceType10);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID11, model.SourceCodeID11);
            entity.SetValue(SourceJournalProfile.Index.SourceType11, model.SourceType11);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID12, model.SourceCodeID12);
            entity.SetValue(SourceJournalProfile.Index.SourceType12, model.SourceType12);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID13, model.SourceCodeID13);
            entity.SetValue(SourceJournalProfile.Index.SourceType13, model.SourceType13);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID14, model.SourceCodeID14);
            entity.SetValue(SourceJournalProfile.Index.SourceType14, model.SourceType14);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID15, model.SourceCodeID15);
            entity.SetValue(SourceJournalProfile.Index.SourceType15, model.SourceType15);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID16, model.SourceCodeID16);
            entity.SetValue(SourceJournalProfile.Index.SourceType16, model.SourceType16);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID17, model.SourceCodeID17);
            entity.SetValue(SourceJournalProfile.Index.SourceType17, model.SourceType17);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID18, model.SourceCodeID18);
            entity.SetValue(SourceJournalProfile.Index.SourceType18, model.SourceType18);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID19, model.SourceCodeID19);
            entity.SetValue(SourceJournalProfile.Index.SourceType19, model.SourceType19);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID20, model.SourceCodeID20);
            entity.SetValue(SourceJournalProfile.Index.SourceType20, model.SourceType20);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID21, model.SourceCodeID21);
            entity.SetValue(SourceJournalProfile.Index.SourceType21, model.SourceType21);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID22, model.SourceCodeID22);
            entity.SetValue(SourceJournalProfile.Index.SourceType22, model.SourceType22);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID23, model.SourceCodeID23);
            entity.SetValue(SourceJournalProfile.Index.SourceType23, model.SourceType23);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID24, model.SourceCodeID24);
            entity.SetValue(SourceJournalProfile.Index.SourceType24, model.SourceType24);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID25, model.SourceCodeID25);
            entity.SetValue(SourceJournalProfile.Index.SourceType25, model.SourceType25);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID26, model.SourceCodeID26);
            entity.SetValue(SourceJournalProfile.Index.SourceType26, model.SourceType26);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID27, model.SourceCodeID27);
            entity.SetValue(SourceJournalProfile.Index.SourceType27, model.SourceType27);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID28, model.SourceCodeID28);
            entity.SetValue(SourceJournalProfile.Index.SourceType28, model.SourceType28);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID29, model.SourceCodeID29);
            entity.SetValue(SourceJournalProfile.Index.SourceType29, model.SourceType29);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID30, model.SourceCodeID30);
            entity.SetValue(SourceJournalProfile.Index.SourceType30, model.SourceType30);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID31, model.SourceCodeID31);
            entity.SetValue(SourceJournalProfile.Index.SourceType31, model.SourceType31);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID32, model.SourceCodeID32);
            entity.SetValue(SourceJournalProfile.Index.SourceType32, model.SourceType32);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID33, model.SourceCodeID33);
            entity.SetValue(SourceJournalProfile.Index.SourceType33, model.SourceType33);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID34, model.SourceCodeID34);
            entity.SetValue(SourceJournalProfile.Index.SourceType34, model.SourceType34);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID35, model.SourceCodeID35);
            entity.SetValue(SourceJournalProfile.Index.SourceType35, model.SourceType35);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID36, model.SourceCodeID36);
            entity.SetValue(SourceJournalProfile.Index.SourceType36, model.SourceType36);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID37, model.SourceCodeID37);
            entity.SetValue(SourceJournalProfile.Index.SourceType37, model.SourceType37);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID38, model.SourceCodeID38);
            entity.SetValue(SourceJournalProfile.Index.SourceType38, model.SourceType38);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID39, model.SourceCodeID39);
            entity.SetValue(SourceJournalProfile.Index.SourceType39, model.SourceType39);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID40, model.SourceCodeID40);
            entity.SetValue(SourceJournalProfile.Index.SourceType40, model.SourceType40);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID41, model.SourceCodeID41);
            entity.SetValue(SourceJournalProfile.Index.SourceType41, model.SourceType41);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID42, model.SourceCodeID42);
            entity.SetValue(SourceJournalProfile.Index.SourceType42, model.SourceType42);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID43, model.SourceCodeID43);
            entity.SetValue(SourceJournalProfile.Index.SourceType43, model.SourceType43);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID44, model.SourceCodeID44);
            entity.SetValue(SourceJournalProfile.Index.SourceType44, model.SourceType44);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID45, model.SourceCodeID45);
            entity.SetValue(SourceJournalProfile.Index.SourceType45, model.SourceType45);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID46, model.SourceCodeID46);
            entity.SetValue(SourceJournalProfile.Index.SourceType46, model.SourceType46);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID47, model.SourceCodeID47);
            entity.SetValue(SourceJournalProfile.Index.SourceType47, model.SourceType47);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID48, model.SourceCodeID48);
            entity.SetValue(SourceJournalProfile.Index.SourceType48, model.SourceType48);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID49, model.SourceCodeID49);
            entity.SetValue(SourceJournalProfile.Index.SourceType49, model.SourceType49);
            entity.SetValue(SourceJournalProfile.Index.SourceCodeID50, model.SourceCodeID50);
            entity.SetValue(SourceJournalProfile.Index.SourceType50, model.SourceType50);
            entity.SetValue(SourceJournalProfile.Index.RESERVEDFunctionalReportName, model.RESERVEDFunctionalReportName);
            entity.SetValue(SourceJournalProfile.Index.RESERVEDSourceReportName, model.RESERVEDSourceReportName);
        }
예제 #17
0
        /// <summary>
        /// Set Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        public override void Map(ReceiptHeader model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SystemAccess = ViewSystemAccess.Activation;
            entity.SetValue(ReceiptHeader.Index.SequenceNumber, model.SequenceNumber);
            entity.SetValue(ReceiptHeader.Index.ReceiptNumber, model.ReceiptNumber);
            entity.SetValue(ReceiptHeader.Index.Description, model.Description);
            entity.SetValue(ReceiptHeader.Index.ReceiptDate, model.ReceiptDate);
            entity.SetValue(ReceiptHeader.Index.FiscalYear, model.FiscalYear);
            entity.SetValue(ReceiptHeader.Index.FiscalPeriod, model.FiscalPeriod);
            entity.SetValue(ReceiptHeader.Index.PurchaseOrderNumber, model.PurchaseOrderNumber);
            entity.SetValue(ReceiptHeader.Index.Reference, model.Reference);
            entity.SetValue(ReceiptHeader.Index.ReceiptCurrency, model.ReceiptCurrency, true);
            entity.SetValue(ReceiptHeader.Index.AdditionalCost, model.AdditionalCost, true);
            entity.SetValue(ReceiptHeader.Index.AdditionalCostCurrency, model.AdditionalCostCurrency, true);
            entity.SetValue(ReceiptHeader.Index.VendorNumber, model.VendorNumber, true);
            entity.SetValue(ReceiptHeader.Index.RateType, model.RateType, true);
            entity.SetValue(ReceiptHeader.Index.RateDate, model.RateDate, true);
            //entity.SetValue(ReceiptHeader.Index.ExchangeRate, model.ExchangeRate, true);
            entity.SetValue(ReceiptHeader.Index.RateOverride, model.RateOverride);
            entity.SetValue(ReceiptHeader.Index.RequireLabels, model.RequireLabels);
            entity.SetValue(ReceiptHeader.Index.Complete, model.Complete);
            entity.SetValue(ReceiptHeader.Index.ICUniqueDocumentNumber, model.ICUniqueDocumentNumber);
            entity.SetValue(ReceiptHeader.Index.RecordDeleted, model.RecordDeleted);
            entity.SetValue(ReceiptHeader.Index.RecordStatus, model.RecordStatus);
            entity.SetValue(ReceiptHeader.Index.RecordPrinted, model.RecordPrinted);
            entity.SetValue(ReceiptHeader.Index.EnteredBy, model.EnteredBy);
            entity.SetValue(ReceiptHeader.Index.PostingDate, model.PostingDate);
            if (model.ReceiptType != ReceiptType.Receipt)
            {
                entity.SetValue(ReceiptHeader.Index.ReceiptType, model.ReceiptType);
            }
        }
        /// <summary>
        /// Set Mapper
        /// </summary>
        /// <param name="model">Model</param>
        /// <param name="entity">Business Entity</param>
        public override void Map(ReceiptDetail model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            entity.SystemAccess = ViewSystemAccess.Activation;
            entity.SetValue(ReceiptDetail.Index.LineNumber, model.LineNumber);
            entity.SetValue(ReceiptDetail.Index.ItemNumber, model.ItemNumber);
            entity.SetValue(ReceiptDetail.Index.ItemDescription, model.ItemDescription);
            entity.SetValue(ReceiptDetail.Index.Category, model.Category);
            entity.SetValue(ReceiptDetail.Index.Location, model.Location);
            entity.SetValue(ReceiptDetail.Index.QuantityReceived, model.QuantityReceived);
            entity.SetValue(ReceiptDetail.Index.QuantityReturned, model.QuantityReturned);
            entity.SetValue(ReceiptDetail.Index.UnitOfMeasure, model.UnitOfMeasure);
            entity.SetValue(ReceiptDetail.Index.UnitCost, model.UnitCost);
            entity.SetValue(ReceiptDetail.Index.AdjustedUnitCost, model.AdjustedUnitCost);
            entity.SetValue(ReceiptDetail.Index.AdjustedCost, model.AdjustedCost);
            entity.SetValue(ReceiptDetail.Index.ExtendedCost, model.ExtendedCost);
            entity.SetValue(ReceiptDetail.Index.ReturnCost, model.ReturnCost);
            entity.SetValue(ReceiptDetail.Index.Comments, model.Comments);
            entity.SetValue(ReceiptDetail.Index.Labels, model.Labels);
            entity.SetValue(ReceiptDetail.Index.VendorItemNumber, model.VendorItemNumber);
            entity.SetValue(ReceiptDetail.Index.DetailLineNumber, model.DetailLineNumber);
            entity.SetValue(ReceiptDetail.Index.UnformattedItemNumber, model.UnformattedItemNumber);
            entity.SetValue(ReceiptDetail.Index.CheckBelowZero, model.CheckBelowZero);
            entity.SetValue(ReceiptDetail.Index.RevisionListLineNumber, model.RevisionListLineNumber);
            entity.SetValue(ReceiptDetail.Index.InterprocessCommID, model.InterprocessCommID);
            entity.SetValue(ReceiptDetail.Index.ForcePopupSN, model.ForcePopupSN);
            entity.SetValue(ReceiptDetail.Index.PopupSN, model.PopupSN);
            entity.SetValue(ReceiptDetail.Index.CloseSN, model.CloseSN);
            entity.SetValue(ReceiptDetail.Index.LTSetID, model.LTSetID);
            entity.SetValue(ReceiptDetail.Index.ForcePopupLT, model.ForcePopupLT);
            entity.SetValue(ReceiptDetail.Index.PopupLT, model.PopupLT);
            entity.SetValue(ReceiptDetail.Index.CloseLT, model.CloseLT);
            entity.SetValue(ReceiptDetail.Index.ReceiptType, model.ReceiptType);
            entity.SetValue(ReceiptDetail.Index.ManufacturersItemNumber, model.ManufacturersItemNumber);
        }
        /// <summary>
        /// Save Source Journal Profile
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public override T Save(T model)
        {
            _businessEntity = CreateBusinessEntities();

            var sourceCodes = model.SourceCodeList.Items.ToList();

            var sourceCodeCount = sourceCodes.Count;

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

            CheckETag(_businessEntity, model);

            for (var i = 1; i <= sourceCodeCount; 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    sourceCode             = sourceCodes[i - 1].Source;
                string sourceLedgerFieldValue = string.Empty;
                string sourceTypeFieldValue   = string.Empty;

                if (!string.IsNullOrEmpty(sourceCode))
                {
                    if (!sourceCodes[i - 1].IsDeleted)
                    {
                        var source = sourceCode.Split('-');

                        if (source.Length > 1)
                        {
                            sourceLedgerFieldValue = source[0];
                            sourceTypeFieldValue   = source[1];
                        }
                        else
                        {
                            sourceLedgerFieldValue = sourceCode;
                        }
                    }
                }

                sourceLedgerFieldValue = sourceCodes[i - 1].IsDeleted ? string.Empty : sourceLedgerFieldValue;
                sourceTypeFieldValue   = sourceCodes[i - 1].IsDeleted ? string.Empty : sourceTypeFieldValue;

                _businessEntity.SetValue(sourceLedgerColumnName, sourceLedgerFieldValue);
                _businessEntity.SetValue(sourceTypeColumnName, sourceTypeFieldValue);
            }

            if (exist)
            {
                _businessEntity.Update();
            }
            else
            {
                _businessEntity.Insert();
            }

            model.ETag  = _businessEntity.ETag;
            model.Exist = true;

            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
            });
        }
예제 #21
0
 /// <summary>
 /// Map model fields to business entity view fields
 /// </summary>
 /// <param name="model"></param>
 /// <param name="entity"></param>
 public override void Map(T model, IBusinessEntity entity)
 {
     entity.SetValue(FieldsIndex.CustomerNumber, model.CustomerNumber);
     entity.SetValue(FieldsIndex.ShortName, model.ShortName);
     entity.SetValue(FieldsIndex.GroupCode, model.GroupCode);
     entity.SetValue(FieldsIndex.CustomerName, model.CustomerName);
     entity.SetValue(FieldsIndex.AddressLine1, model.AddressLine1);
     entity.SetValue(FieldsIndex.City, model.City);
     entity.SetValue(FieldsIndex.StateOrProv, model.StateOrProv);
     entity.SetValue(FieldsIndex.ZipOrPostalCode, model.ZipOrPostalCode);
     entity.SetValue(FieldsIndex.Country, model.Country);
     entity.SetValue(FieldsIndex.ContactName, model.ContactName);
     entity.SetValue(FieldsIndex.PhoneNumber, model.PhoneNumber);
     entity.SetValue(FieldsIndex.FaxNumber, model.FaxNumber);
     entity.SetValue(FieldsIndex.Email, model.Email);
 }
예제 #22
0
 /// <summary>
 /// Map key from model field to entity field
 /// </summary>
 /// <param name="model"></param>
 /// <param name="entity"></param>
 public override void MapKey(T model, IBusinessEntity entity)
 {
     entity.SetValue(FieldsIndex.CustomerNumber, model.CustomerNumber);
 }
예제 #23
0
        /// <summary>
        /// Set Value Mapper
        /// </summary>
        /// <param name="model">Clear Statistics Model</param>
        /// <param name="entity">Clear Statistics Business Entity</param>
        public override void Map(T model, IBusinessEntity entity)
        {
            if (model == null)
            {
                return;
            }

            if (model.ClearCustomerStatistics == ClearCustomerStatistics.Yes)
            {
                entity.SetValue(ClearStatistics.Index.ClearCustomerStatistics,
                                model.ClearCustomerStatistics);
                entity.SetValue(ClearStatistics.Index.FromCustomerNo, model.FromCustomerNo);
                entity.SetValue(ClearStatistics.Index.ToCustomerNo, model.ToCustomerNo);
                entity.SetValue(ClearStatistics.Index.ThroughCustomerYear, model.ThroughCustomerYear);
                entity.SetValue(ClearStatistics.Index.ThroughCustomerPeriod, model.ThroughCustomerPeriod);
            }

            if (model.ClearGroupStatistics == ClearGroupStatistics.Yes)
            {
                entity.SetValue(ClearStatistics.Index.ClearGroupStatistics,
                                model.ClearGroupStatistics);
                entity.SetValue(ClearStatistics.Index.FromGroupCode, model.FromGroupCode);
                entity.SetValue(ClearStatistics.Index.ToGroupCode, model.ToGroupCode);
                entity.SetValue(ClearStatistics.Index.ThroughGroupYear, model.ThroughGroupYear);
                entity.SetValue(ClearStatistics.Index.ThroughGroupPeriod,
                                model.ThroughGroupPeriod);
            }

            if (model.ClearNationalAcctStatistics == ClearNationalAccountStatistics.Yes)
            {
                entity.SetValue(ClearStatistics.Index.ClearNationalAcctStatistics,
                                model.ClearNationalAcctStatistics);
                entity.SetValue(ClearStatistics.Index.FromNationalAccount, model.FromNationalAccount);
                entity.SetValue(ClearStatistics.Index.ToNationalAccount, model.ToNationalAccount);
                entity.SetValue(ClearStatistics.Index.ThroughNationalAcctYear, model.ThroughNationalAcctYear);
                entity.SetValue(ClearStatistics.Index.ThroughNationalAcctPeriod,
                                model.ThroughNationalAcctPeriod);
            }

            if (model.ClearSalesPersonStatistics == ClearSalespersonStatistics.Yes)
            {
                entity.SetValue(ClearStatistics.Index.ClearSalesPersonStatistics,
                                model.ClearSalesPersonStatistics);
                entity.SetValue(ClearStatistics.Index.FromSalesPerson, model.FromSalesPerson);
                entity.SetValue(ClearStatistics.Index.ToSalesPerson, model.ToSalesPerson);
                entity.SetValue(ClearStatistics.Index.ThroughSalesPersonYear, model.ThroughSalesPersonYear);
                entity.SetValue(ClearStatistics.Index.ThroughSalesPersonPeriod,
                                model.ThroughSalesPersonPeriod);
            }
            if (model.ClearItemStatistics == ClearItemStatistics.Yes)
            {
                entity.SetValue(ClearStatistics.Index.ClearItemStatistics,
                                model.ClearItemStatistics);
                entity.SetValue(ClearStatistics.Index.FromItemNumber, model.FromItemNumber);
                entity.SetValue(ClearStatistics.Index.ToItemNumber, model.ToItemNumber);
                entity.SetValue(ClearStatistics.Index.ThroughItemYear, model.ThroughItemYear);
                entity.SetValue(ClearStatistics.Index.ThroughItemPeriod,
                                model.ThroughItemPeriod);
            }
        }
예제 #24
0
 /// <summary>
 /// Map Key
 /// </summary>
 /// <param name="model">Model</param>
 /// <param name="entity">Business Entity</param>
 public override void MapKey(ReceiptOptionalField model, IBusinessEntity entity)
 {
     entity.SetValue(ReceiptOptionalField.Index.SequenceNumber, model.SequenceNumber);
     entity.SetValue(ReceiptOptionalField.Index.OptionalField, model.OptionalField);
 }
예제 #25
0
 /// <summary>
 /// Map Key
 /// </summary>
 /// <param name="model">Model</param>
 /// <param name="entity">Business Entity</param>
 public override void MapKey(ReceiptHeader model, IBusinessEntity entity)
 {
     entity.SetValue(ReceiptHeader.Index.SequenceNumber, model.SequenceNumber);
     entity.SetValue(ReceiptHeader.Index.ReceiptNumber, model.ReceiptNumber);
 }
예제 #26
0
 /// <summary>
 /// Map Key
 /// </summary>
 /// <param name="model">Model</param>
 /// <param name="entity">Business Entity</param>
 public override void MapKey(T model, IBusinessEntity entity)
 {
     entity.SetValue(SegmentCodes.Index.SegmentNumber, model.SegmentNumber);
     entity.SetValue(SegmentCodes.Index.SegmentCode, model.SegmentCode);
 }
예제 #27
0
 /// <summary>
 /// Map Key
 /// </summary>
 /// <param name="model">Model</param>
 /// <param name="entity">Business Entity</param>
 public override void MapKey(T model, IBusinessEntity entity)
 {
     entity.SetValue(SourceCode.Index.SourceLedger, model.SourceLedger);
 }
 /// <summary>
 /// Map Key
 /// </summary>
 /// <param name="model">Model</param>
 /// <param name="entity">Business Entity</param>
 public override void MapKey(T model, IBusinessEntity entity)
 {
     entity.SetValue(ReceiptDetailLotNumber.Index.SequenceNumber, model.SequenceNumber);
     entity.SetValue(ReceiptDetailLotNumber.Index.LineNumber, model.LineNumber);
     entity.SetValue(ReceiptDetailLotNumber.Index.LotNumber, model.LotNumber);
 }