public void IsTheAmountCycleStockNameAlreadyExist_DontExist()
        {
            LoanProductManager loanProductManager = (LoanProductManager)container["LoanProductManager"];
            bool exist = loanProductManager.IsLoanCycleNameAlreadyExist("SDQSD");

            Assert.IsFalse(exist);
        }
        public void IsTheAmountCycleStockNameAlreadyExist_ReallyExist()
        {
            LoanProductManager loanProductManager = (LoanProductManager)container["LoanProductManager"];
            bool exist = loanProductManager.IsLoanCycleNameAlreadyExist("Cycle");

            Assert.IsTrue(exist);
        }
Beispiel #3
0
 public int InsertLoanCycle(LoanCycle loanCycle)
 {
     if (_productManager.IsLoanCycleNameAlreadyExist(loanCycle.Name))
     {
         throw new OpenCbsPackageSaveException(OpenCbsPackageSaveExceptionEnum.LoanCycleNameAlreadyExists);
     }
     using (SqlConnection conn = _productManager.GetConnection())
         using (SqlTransaction t = conn.BeginTransaction())
         {
             try
             {
                 loanCycle.Id = _productManager.InsertLoanCycle(loanCycle, t);
                 t.Commit();
                 return(loanCycle.Id);
             }
             catch (Exception ex)
             {
                 t.Rollback();
                 throw ex;
             }
         }
 }