Esempio n. 1
0
        public void Add_RegEvent()
        {
            EventManager eventManager = (EventManager)container["EventManager"];
            RegEvent regEvent = new RegEvent
                                    {
                                        Id = 15,
                                        User = new User { Id = 1 },
                                        Date = new DateTime(2006, 7, 21)
                                    };

            eventManager.AddLoanEvent(regEvent, 1);
            Assert.AreNotEqual(0, regEvent.Id);
        }
Esempio n. 2
0
 private static void _AssertRegEvent(RegEvent pEvent, DateTime pDate, bool pDeleted)
 {
     Assert.AreEqual("REGE", pEvent.Code);
     Assert.AreEqual(pDate, pEvent.Date);
     Assert.AreEqual(pDeleted, pEvent.Deleted);
 }
Esempio n. 3
0
        public void Select_Added_RegEvent()
        {
            EventManager eventManager = (EventManager)container["EventManager"];
            RegEvent regEvent = new RegEvent
            {
                Id = 15,
                User = new User { Id = 1 },
                Date = new DateTime(2006, 7, 21)
            };

            eventManager.AddLoanEvent(regEvent, 1);

            EventStock eventStock = eventManager.SelectEvents(2);
            foreach (Event e in eventStock.GetEvents())
            {
                if (e is RegEvent)
                    _AssertRegEvent(e as RegEvent, new DateTime(2006, 7, 21),false);
            }
        }
Esempio n. 4
0
 public void AddLoanEvent(RegEvent pEvent, int contractId, SqlTransaction sqlTransac)
 {
     AddLoanEventHead(pEvent, contractId, sqlTransac);
 }
Esempio n. 5
0
 public void AddLoanEvent(RegEvent pEvent, int contractId)
 {
     using (SqlConnection connection = GetConnection())
     using (SqlTransaction transaction = connection.BeginTransaction())
     {
         try
         {
             AddLoanEvent(pEvent, contractId, transaction);
             transaction.Commit();
         }
         catch (Exception)
         {
             transaction.Rollback();
             throw;
         }
     }
 }
Esempio n. 6
0
        private Event ReadEvent(OpenCbsReader r)
        {
            Event e;

            if (r.GetNullInt("lde_id").HasValue)
            {
                e = GetLoanDisbursmentEvent(r);
            }
            else if (r.GetNullInt("woe_id").HasValue)
            {
                e = GetWriteOffEvent(r);
            }
            else if (r.GetNullInt("rle_id").HasValue)
            {
                e = GetReschedulingLoanEvent(r);
            }
            else if (r.GetNullInt("rpe_id").HasValue)
            {
                e = GetRepaymentEvent(r);
            }
            else if (r.GetNullInt("tranche_id").HasValue)
            {
                e = GetTrancheLoanEvent(r);
            }
            else if (r.GetNullInt("liae_id").HasValue)
            {
                e = GetLoanInterestAccruingEvent(r);
            }
            else if (r.GetNullInt("ov_id").HasValue)
            {
                e = GetOverdueEvent(r);
            }
            else if (r.GetNullInt("pe_id").HasValue)
            {
                e = GetProvisionEvent(r);
            }
            else if (r.GetNullInt("ef_id").HasValue)
            {
                e = GetEntryFeeEvent(r);
            }
            else if (r.GetNullInt("cie_id").HasValue)
            {
                e = GetCreditInsuranceEvent(r);
            }
            else if (r.GetString("code").StartsWith("S"))
            {
                e = GetSavingEvent(r);
            }
            else
            {
                if(r.GetString("code").Equals("LOVE"))
                    e = new LoanValidationEvent{Id = r.GetInt("event_id")};
                else if (r.GetString("code").Equals("LOCE"))
                    e = new LoanCloseEvent{Id = r.GetInt("event_id")};
                else
                    e = new RegEvent {Id = r.GetInt("event_id")};
            }

            GetEvent(r, e);

            return e;
        }