示例#1
0
 public void CloneTransactionProto(TransactionProto proto)
 {
     this.TransactionID          = proto.TransactionID;
     this.CustomerID             = proto.CustomerID;
     this.OutgoingBatchID        = proto.OutgoingBatchID;
     this.UploadedCustomerFileID = proto.UploadedCustomerFileID;
     this.EffectiveEntryDate     = proto.EffectiveEntryDate;
     this.ProcessingDate         = proto.ProcessingDate;
     this.SettlementDate         = proto.SettlementDate;
     this.IsOffset = proto.IsOffset;
     this.Amount   = proto.Amount;
 }
示例#2
0
        public void CloneTransactionProto(TransactionProto proto)
        {
            this.TransactionID = proto.TransactionID;
            this.CustomerID = proto.CustomerID;
            this.OutgoingBatchID = proto.OutgoingBatchID;
            this.UploadedCustomerFileID = proto.UploadedCustomerFileID;
            this.EffectiveEntryDate = proto.EffectiveEntryDate;
            this.ProcessingDate = proto.ProcessingDate;
            this.SettlementDate = proto.SettlementDate;
            this.IsOffset = proto.IsOffset;
            this.Amount = proto.Amount;

        }
示例#3
0
        public void LoadRedisFromFile()
        {
            var watch = Stopwatch.StartNew();

            int counter            = 0;
            TransactionProto proto = null;

            using (var file = File.OpenRead(STR_Ctransactionsbin))
            {
                bool successful = true;
                do
                {
                    try
                    {
                        proto = Serializer.DeserializeWithLengthPrefix <TransactionProto>(file, PrefixStyle.Base128);
                    }
                    catch (EndOfStreamException ex)
                    {
                        successful = false;
                    }

                    int id   = proto.TransactionID;
                    var node = new TransactionNode();
                    node.InitKey();
                    node.CloneTransactionProto(proto);
                    AddTransactionNode(id, node);
                    counter++;

                    LinkTransactionToDateNode(node, proto.EffectiveEntryDate, _EffectiveEntryDateNode, "EED");
                    LinkTransactionToDateNode(node, proto.ProcessingDate, _ProcessingDateNode, "PD");
                    LinkTransactionToDateNode(node, proto.SettlementDate, _SettlementDateNode, "SD");
                } while (successful && counter <= 10000);
                "Loaded {0} records in {1} miliseconds. \r\n\t{2} calls ops per second.\r\n\t{3} miliseconds per operation. \r\n\t{4} writes total. \r\n\t{5} writes per second\r\n\t{6} miliseconds per write."
                .ToDebug <NetGraphDemo>(
                    counter,
                    watch.ElapsedMilliseconds,
                    (counter * 9) / watch.Elapsed.TotalSeconds,
                    watch.Elapsed.TotalMilliseconds / (counter * 9),
                    (counter * 9),
                    (counter * 9) / watch.Elapsed.TotalSeconds,
                    watch.Elapsed.TotalMilliseconds / (counter * 9)
                    );
            }
        }