Beispiel #1
0
 public void SaveReconcilation(Reconciliation[] recons)
 {
     foreach (var recon in recons)
     {
         Reconciliation.SaveReconciliation(recon);
     }
 }
Beispiel #2
0
        private static List<Reconciliation> ReadContents(ReconciliationFile rec)
        {
            var reconciliations = new List<Reconciliation>();
            using (var stream = new StreamReader(new MemoryStream(rec.Contents), Encoding.Default))
            {
                var str = stream.ReadLine();
                while (str != null)
                {
                    var flag = str.AsRecordType();
                    if (flag.ToUpper().Equals("D")) //Detail
                    {
                        var recDto = new Reconciliation
                            {
                                ReconciliationFileId = rec.Id,
                                PaymentMethod = rec.FileType,
                                PaymentCode = str.AsCustomerNoRef1(),
                                PaymentDate = str.AsPaymentDateTime(),
                                PaymentBy = str.AsCustomerName(),
                                Amount = str.AsAmount()
                            };

                        reconciliations.Add(recDto);
                    }

                    str = stream.ReadLine();
                }
            }
            return reconciliations;
        }
 private static void UpdateInstallmentGalileo(Reconciliation reconciliation, int seq)
 {
     using (var client = new GalileoInternalServiceWcfClient())
     {
         client.UpdateInstallment(new UpdateInstallmentRequest()
                                 {
                                     PaymentCode = reconciliation.PaymentCode,
                                     Amount = reconciliation.Amount,
                                     InstallmentSeq = (byte)seq,
                                     Method = reconciliation.PaymentMethod,
                                     ReconciliationId = reconciliation.Id,
                                     InstallmentBy = reconciliation.PaymentBy,
                                     InstallmentDate = reconciliation.PaymentDate
                                 });
     }
 }
        public static bool SaveReconciliation(Reconciliation reconciliation)
        {
            Exception exception = null;
            try
            {
                using (var container = new TransactionModelContainer())
                {
                    container.Reconciliations.AddObject(reconciliation);
                    container.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                CreateLogs(ex);
                exception = ex;
            }

            return exception == null;
        }
        public static Reconciliation[] CreateCreditCardToBBL(DataTable dt, string paymentMethod, long reconciliationFileId)
        {
            var result = new List<Reconciliation>();
            for (var i = 0; i < dt.Rows.Count; i++)
            {
                var recon = new Reconciliation
                {
                    PaymentCode = dt.Rows[i]["Merchant Ref."].ToString(),
                    Amount = dt.Rows[i]["Amount"].ToString().ToDecimal(),
                    PaymentDate = Convert.ToDateTime(dt.Rows[i]["Transaction Date"].ToString(), new CultureInfo("en-US")),
                    PaymentBy = dt.Rows[i]["Name"].ToString(),
                    PaymentMethod = paymentMethod,
                    ReconciliationFileId = reconciliationFileId
                };

                result.Add(recon);
            }
            return result.ToArray();
        }
        public static bool SaveReconciliation(Reconciliation reconciliation)
        {
            Exception exception = null;

            try
            {
                using (var container = new TransactionModelContainer())
                {
                    container.Reconciliations.AddObject(reconciliation);
                    container.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                CreateLogs(ex);
                exception = ex;
            }

            return(exception == null);
        }
 /// <summary>
 /// Create a new Reconciliation object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="paymentCode">Initial value of the PaymentCode property.</param>
 /// <param name="amount">Initial value of the Amount property.</param>
 /// <param name="paymentDate">Initial value of the PaymentDate property.</param>
 /// <param name="paymentBy">Initial value of the PaymentBy property.</param>
 /// <param name="paymentMethod">Initial value of the PaymentMethod property.</param>
 /// <param name="reconciliationFileId">Initial value of the ReconciliationFileId property.</param>
 /// <param name="isRead">Initial value of the IsRead property.</param>
 public static Reconciliation CreateReconciliation(global::System.Int64 id, global::System.String paymentCode, global::System.Decimal amount, global::System.DateTime paymentDate, global::System.String paymentBy, global::System.String paymentMethod, global::System.Int64 reconciliationFileId, global::System.Boolean isRead)
 {
     Reconciliation reconciliation = new Reconciliation();
     reconciliation.Id = id;
     reconciliation.PaymentCode = paymentCode;
     reconciliation.Amount = amount;
     reconciliation.PaymentDate = paymentDate;
     reconciliation.PaymentBy = paymentBy;
     reconciliation.PaymentMethod = paymentMethod;
     reconciliation.ReconciliationFileId = reconciliationFileId;
     reconciliation.IsRead = isRead;
     return reconciliation;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Reconciliations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToReconciliations(Reconciliation reconciliation)
 {
     base.AddObject("Reconciliations", reconciliation);
 }