Exemplo n.º 1
0
        public List <BusinessEntities.ErrorObj> GetVoucherValidation(AccountingInformation xmlJournal)
        {
            var accounting = xmlJournal;

            var lstErrorObjs = new List <BusinessEntities.ErrorObj>();

            BusinessEntities.ErrorObj objAccountingInformation = null;

            var stringWriter = new StringWriter();
            var serializer   = new XmlSerializer(accounting.GetType());

            serializer.Serialize(stringWriter, accounting);

            var vResult = _dbContext.spGetSIACValidation(stringWriter.ToString());


            foreach (var item in vResult.ToList())
            {
                objAccountingInformation = new BusinessEntities.ErrorObj
                {
                    ProcessId        = item.ProcessId,
                    ErrorDescription = item.ErrorDescription,
                    ValidationId     = item.ValidationId,
                    RecordId         = item.RecordId
                };
                lstErrorObjs.Add(objAccountingInformation);
            }

            return(lstErrorObjs);
        }
        public static AccountingInformation InitializeAccountingInformation(long QuestionnaireId)
        {
            AccountingInformation accountingInformation = new AccountingInformation();

            accountingInformation.QuestionnaireId                    = QuestionnaireId;
            accountingInformation.CurrentAccountingSoftware          = "";
            accountingInformation.CurrentAccountingSoftwareUsingTime = "";
            accountingInformation.LastCompletedDate                  = DateTime.Now;

            return(accountingInformation);
        }
        public ActionResult AccountingInformation(long?id, long?questionnaire)
        {
            AccountingInformation accountingInformation = null;

            if (id.HasValue)
            {
                accountingInformation = db.AccountingInformation.Find(id.Value);
            }
            if (questionnaire.HasValue)
            {
                accountingInformation = db.AccountingInformation.Single(oi => oi.QuestionnaireId == questionnaire.Value);
            }

            if (accountingInformation != null)
            {
                return(View(accountingInformation));
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 4
0
 public List <BusinessEntities.ErrorObj> GetJournalValidation(AccountingInformation xmlJournal)
 {
     return(_objValidacionSiacDA.GetVoucherValidation(xmlJournal));
 }
        public override Abaseguros.Finanzas.SIAC.MessageContracts.VoucherInformationResponse GetVoucherValidation(
            Abaseguros.Finanzas.SIAC.MessageContracts.VoucherInformationRequest request)
        {
            MessageContracts.VoucherInformationResponse objVoucherInformationResponse = new MessageContracts.VoucherInformationResponse();
            List <BusinessEntities.ErrorObj>            lstErrorObjs = null;

            DataContracts.ErrorCollectionDC lstErrorCollectionDc = new DataContracts.ErrorCollectionDC();
            DataContracts.ErrorDC           objErrorDc           = null;

            var objHeader = new Header()
            {
                AccountingDate = request.AccountingInformation.Header.AccountingDate,
                Branch         = request.AccountingInformation.Header.Branch,
                BusinessUnit   = request.AccountingInformation.Header.BusinessUnit,
                RegisterCount  = request.AccountingInformation.Header.RegisterCount,
                RecordType     = request.AccountingInformation.Header.RecordType,
                SourceSystemId = request.AccountingInformation.Header.SourceSystemId
            };

            var lstObjDetails = new List <Detail>();

            foreach (var detail in request.AccountingInformation.AccountingDetail)
            {
                var addDetail = new Detail()
                {
                    Affiliate           = detail.Affiliate,
                    DepId               = detail.DepId,
                    DistributionChannel = detail.DistributionChannel,
                    Function            = detail.Function,
                    JrnlLnRef           = detail.JrnlLnRef,
                    Ledger              = detail.Ledger,
                    LineDescription     = detail.LineDescription,
                    Location            = detail.Location,
                    Mcc              = detail.Mcc,
                    MonetaryAmount   = detail.MonetaryAmount,
                    OperatingUnit    = detail.OperatingUnit,
                    OriginalAmount   = detail.OriginalAmount,
                    OriginalCurrency = detail.OriginalCurrency,
                    PoliceYear       = detail.PoliceYear,
                    Product          = detail.Product,
                    ProjectId        = detail.ProjectId,
                    RegisterId       = detail.RegisterId,
                    TransactionCode  = detail.TransactionCode,
                    Year             = detail.Year,

                    AltAccount = detail.AltAccount,
                    PsAccount  = detail.PsAccount
                };

                lstObjDetails.Add(addDetail);
            }



            var objAccountingInformation = new AccountingInformation()
            {
                Detail = lstObjDetails,
                Header = objHeader
            };


            lstErrorObjs = _objValidacionSiacBL.GetJournalValidation(objAccountingInformation);

            foreach (BusinessEntities.ErrorObj objError in lstErrorObjs)
            {
                objErrorDc                  = new DataContracts.ErrorDC();
                objErrorDc.ProcessId        = objError.ProcessId;
                objErrorDc.ValidationId     = objError.ValidationId;
                objErrorDc.ErrorDescription = objError.ErrorDescription;
                objErrorDc.RecordId         = objError.RecordId;

                lstErrorCollectionDc.Add(objErrorDc);
            }

            objVoucherInformationResponse.Error = lstErrorCollectionDc;

            return(objVoucherInformationResponse);
        }