Exemplo n.º 1
0
        public long SaveRemittanceDocument(Guid txID, long remittanceID)
        {
            FnRemittanceDataset remittanceDS = (FnRemittanceDataset)TransactionService.GetDS(txID);

            FnRemittanceDataset.FnRemittanceRow remittanceRow = remittanceDS.FnRemittance.FindByRemittanceID(remittanceID);
            long documentID = remittanceRow.DocumentID;

            documentID = SCGDocumentService.SaveSCGDocument(txID, documentID);

            remittanceID = ScgeAccountingDaoProvider.FnRemittanceDao.Persist(remittanceDS.FnRemittance);

            ScgeAccountingDaoProvider.FnRemittanceDao.DeleteAllRemittanceItemAndRemittanceAdvance(remittanceRow.RemittanceID);

            FnRemittanceItemService.SaveRemittanceItem(txID, remittanceID);

            FnRemittanceAdvanceService.SaveRemittanceAdvance(txID, remittanceID);

            // Add code for update clearing advance by Anuwat S on 19/04/2009

            AvAdvanceDocumentService.UpdateRemittanceAdvance(remittanceID, double.Parse("0" + remittanceDS.FnRemittance.Rows[0]["TotalAmount"].ToString()), false);

            if (!remittanceRow.IsIsRepOfficeNull() && remittanceRow.IsRepOffice)
            {
                AvAdvanceDocumentService.UpdateRemittanceAdvanceForRepOffice(remittanceID, double.Parse("0" + remittanceDS.FnRemittance.Rows[0]["MainCurrencyAmount"].ToString()), false);
            }
            return(remittanceID);
        }
        public long SaveFixedAdvance(Guid txid, long fixedadvanceId)
        {
            FixedAdvanceDataSet fixedadvanceDataset = (FixedAdvanceDataSet)TransactionService.GetDS(txid);

            FixedAdvanceDataSet.FixedAdvanceDocumentRow row = fixedadvanceDataset.FixedAdvanceDocument.FindByFixedAdvanceID(fixedadvanceId);
            long documentID = row.DocumentID;

            documentID     = SCGDocumentService.SaveSCGDocument(txid, documentID);
            fixedadvanceId = ScgeAccountingDaoProvider.FixedAdvanceDocumentDao.Persist(fixedadvanceDataset.FixedAdvanceDocument);
            return(fixedadvanceId);
        }
Exemplo n.º 3
0
        public long SaveAvAdvance(Guid txid, long advanceId)
        {
            AdvanceDataSet advanceDataset = (AdvanceDataSet)TransactionService.GetDS(txid);

            AdvanceDataSet.AvAdvanceDocumentRow row = advanceDataset.AvAdvanceDocument.FindByAdvanceID(advanceId);
            long documentID = row.DocumentID;

            documentID = SCGDocumentService.SaveSCGDocument(txid, documentID);
            //insert update or delete AvAdvanveDocument
            advanceId = ScgeAccountingDaoProvider.AvAdvanceDocumentDao.Persist(advanceDataset.AvAdvanceDocument);

            //inset update or delete AvAdvanceItem
            AvAdvanceItemService.saveAdvanceItem(txid, advanceId);

            return(advanceId);
        }
        public long SaveMPADocument(Guid txID, long mpaDocumentID)
        {
            MPADocumentDataSet mpaDocumentDS = (MPADocumentDataSet)TransactionService.GetDS(txID);

            MPADocumentDataSet.MPADocumentRow mpaDocumentRow = mpaDocumentDS.MPADocument.FindByMPADocumentID(mpaDocumentID);
            long documentID = mpaDocumentRow.DocumentID;

            // Insert, Update SCGDocument.
            // Insert, Update, Delete DocumentInitiator.
            // Insert, Delete DocumentAttachment.
            documentID = SCGDocumentService.SaveSCGDocument(txID, documentID);

            // Insert, Update, Delete MPADocument.
            mpaDocumentID = ScgeAccountingDaoProvider.MPADocumentDao.Persist(mpaDocumentDS.MPADocument);

            // Insert, Update, Delete MPAItem.
            MPAItemService.SaveMPAItem(txID, documentID);

            return(mpaDocumentID);
        }
        public long SaveCADocument(Guid txID, long caDocumentID)
        {
            CADocumentDataSet caDocumentDS = (CADocumentDataSet)TransactionService.GetDS(txID);

            CADocumentDataSet.CADocumentRow caDocumentRow = caDocumentDS.CADocument.FindByCADocumentID(caDocumentID);
            long documentID = caDocumentRow.DocumentID;

            // Insert, Update SCGDocument.
            // Insert, Update, Delete DocumentInitiator.
            // Insert, Delete DocumentAttachment.
            documentID = SCGDocumentService.SaveSCGDocument(txID, documentID);

            // Insert, Update, Delete MPADocument.
            caDocumentID = ScgeAccountingDaoProvider.CADocumentDao.Persist(caDocumentDS.CADocument);

            // Insert, Update, Delete MPAItem.
            //MPAItemService.SaveMPADocumentItem(txID, mpaDocumentID);

            return(caDocumentID);
        }
        public long SaveTADocument(Guid txID, long taDocumentID)
        {
            TADocumentDataSet taDocumentDS = (TADocumentDataSet)TransactionService.GetDS(txID);

            TADocumentDataSet.TADocumentRow taDocumentRow = taDocumentDS.TADocument.FindByTADocumentID(taDocumentID);
            long documentID = taDocumentRow.DocumentID;

            // Insert, Update SCGDocument.
            // Insert, Update, Delete DocumentInitiator.
            // Insert, Delete DocumentAttachment.
            documentID = SCGDocumentService.SaveSCGDocument(txID, documentID);

            // Insert, Update, Delete TADocument.
            taDocumentID = ScgeAccountingDaoProvider.TADocumentDao.Persist(taDocumentDS.TADocument);

            // Insert, Update, Delete TADocumentTraveller.
            TADocumentTravellerService.SaveTADocumentTraveller(txID, taDocumentID);

            // Insert, Update, Delete TADocumentSchedule.
            TADocumentScheduleService.SaveTADocumentSchedule(txID, taDocumentID);

            return(taDocumentID);
        }