コード例 #1
0
 public void UpdateLoanScaleTableInstance()
 {
     using (SqlConnection conn = _loanScaleManager.GetConnection())
         using (SqlTransaction sqlTransac = conn.BeginTransaction())
         {
             LoanScaleTable lT = LoanScaleTable.GetInstance(_user);
             try
             {
                 _loanScaleManager.Delete(sqlTransac);
                 int i = 1;
                 foreach (LoanScaleRate lR in lT.LoanScaleRates)
                 {
                     lR.Number = i;
                     _loanScaleManager.InsertLoanScale(lR, sqlTransac);
                     i++;
                 }
                 sqlTransac.Commit();
             }
             catch (Exception ex)
             {
                 sqlTransac.Rollback();
                 throw ex;
             }
         }
 }
コード例 #2
0
        public void AddLoanScale(LoanScaleRate lR)
        {
            LoanScaleTable lT = LoanScaleTable.GetInstance(_user);

            if (lR.ScaleMin == 0)
            {
                throw new OpenCbsAccountException(OpenCbsAccountExceptionsEnum.LoanScaleTableMin);
            }
            if (lR.ScaleMax == 0)
            {
                throw new OpenCbsAccountException(OpenCbsAccountExceptionsEnum.LoanScaleTableMax);
            }

            lR.Number = lT.LoanScaleRates.Count + 1;

            lT.AddLoanScaleRate(lR);
            using (SqlConnection conn = _loanScaleManager.GetConnection())
                using (SqlTransaction sqlTransac = conn.BeginTransaction())
                {
                    try
                    {
                        _loanScaleManager.InsertLoanScale(lR, sqlTransac);
                        sqlTransac.Commit();
                    }
                    catch (Exception ex)
                    {
                        sqlTransac.Rollback();
                        throw ex;
                    }
                }
        }
コード例 #3
0
        public void SelectLoanScale()
        {
            LoanScaleTable loanscaleTable = LoanScaleTable.GetInstance(_user);
            string         sqlText        = "Select id, ScaleMin, ScaleMax FROM LoanScale";
            SqlCommand     select         = new SqlCommand(sqlText, CurrentConnection);

            using (SqlDataReader reader = select.ExecuteReader())
            {
                while (reader.Read())
                {
                    LoanScaleRate lR = new LoanScaleRate();
                    lR.Number   = DatabaseHelper.GetInt32("id", reader);
                    lR.ScaleMin = DatabaseHelper.GetInt32("ScaleMin", reader);
                    lR.ScaleMax = DatabaseHelper.GetInt32("ScaleMax", reader);
                    loanscaleTable.AddLoanScaleRate(lR);
                }
            }
        }
コード例 #4
0
        public void SelectLoanScales()
        {
            LoanScaleTable loanscaleTable = LoanScaleTable.GetInstance(_user);
            const string   sqlText        = @"SELECT id, ScaleMin, ScaleMax 
                                     FROM LoanScale";

            using (SqlConnection conn = GetConnection())
            {
                using (OpenCbsCommand select = new OpenCbsCommand(sqlText, conn))
                {
                    using (OpenCbsReader reader = select.ExecuteReader())
                    {
                        if (reader.Empty)
                        {
                            return;
                        }
                        while (reader.Read())
                        {
                            loanscaleTable.AddLoanScaleRate(GetLoanScale(reader));
                        }
                    }
                }
            }
        }
コード例 #5
0
 public void CheckGeneralSettings()
 {
     ProvisionTable.GetInstance(_user).ProvisioningRates = _provisionningRuleManager.SelectAllProvisioningRates();
     LoanScaleTable.GetInstance(_user).LoanScaleRates    = new ArrayList();
     _loanScaleManager.SelectLoanScales();
 }
コード例 #6
0
        public void DeleteLoanScale(LoanScaleRate ls)
        {
            LoanScaleTable lt = LoanScaleTable.GetInstance(_user);

            lt.DeleteLoanScaleRate(ls);
        }
コード例 #7
0
 public LoanScaleTable GetLoanScaleTable()
 {
     return(LoanScaleTable.GetInstance(User.CurrentUser));
 }