public void DeleteLoanScaleRate(LoanScaleRate lt) { _loanscaleRates.Remove(lt); int number = 1; foreach (LoanScaleRate lsr in _loanscaleRates) { lsr.Number = number; number++; } }
public void InsertLoanScale(LoanScaleRate pLoanScaleRate, SqlTransaction pSqlTransaction) { const string sqlText = @"INSERT INTO LoanScale(id,ScaleMin, ScaleMax) VALUES(@number,@Min, @Max)"; using (OpenCbsCommand insert = new OpenCbsCommand(sqlText, pSqlTransaction.Connection, pSqlTransaction)) { SetLoanScale(insert, pLoanScaleRate); insert.ExecuteNonQuery(); } }
public void DeleteLoanScaleRate(LoanScaleRate lt) { _loanscaleRates.Remove(lt); int number = 1; foreach (LoanScaleRate lsr in _loanscaleRates) { lsr.Number = number; number++; } }
private void listViewLoanScale_Click(object sender, EventArgs e) { lR = (LoanScaleRate)listViewLoanScale.SelectedItems[0].Tag; InitializeLoanScaleRate(); }
public FrmGeneralSettings() { pR = new ProvisioningRate(); lR = new LoanScaleRate(); InitializeComponent(); InitializeListViewProvisioningTables(); InitializeListViewGeneralParameters(); InitializeListViewPublicHolidays(); InitializeListViewLoanScaleTables(); InitializeListBoxPendingSavings(); }
public FrmGeneralSettings() { pR = new ProvisioningRate(); lR = new LoanScaleRate(); InitializeComponent(); InitializeListViewProvisioningTables(); InitializeListViewGeneralParameters(); InitializeListViewPublicHolidays(); InitializeListViewLoanScaleTables(); InitializeListBoxPendingSavings(); dateTimePickerPublicHoliday.Format = DateTimePickerFormat.Custom; dateTimePickerPublicHoliday.CustomFormat = ApplicationSettings.GetInstance("").SHORT_DATE_FORMAT; }
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; } } }
public void DeleteLoanScale(LoanScaleRate ls) { LoanScaleTable lt = LoanScaleTable.GetInstance(_user); lt.DeleteLoanScaleRate(ls); }
public void AddLoanScaleRate(LoanScaleRate lt) { _loanscaleRates.Add(lt); }
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); } } }
public void InsertLoanScaleValue(LoanScaleRate lR, SqlTransaction sqlTransac) { string sqlText = "INSERT INTO LoanScale(id,ScaleMin, ScaleMax) " + "VALUES(@number,@Min, @Max)"; SqlCommand insert = new SqlCommand(sqlText, CurrentConnection, sqlTransac); DatabaseHelper.InsertInt32Param("@number", insert, lR.Number); DatabaseHelper.InsertInt32Param("@Min", insert, lR.ScaleMin); DatabaseHelper.InsertInt32Param("@Max", insert, lR.ScaleMax); insert.ExecuteNonQuery(); }
public void AddLoanScaleRate(LoanScaleRate lt) { _loanscaleRates.Add(lt); }
private static void SetLoanScale(OpenCbsCommand octCmd, LoanScaleRate pLoanScaleRate) { octCmd.AddParam("@number", pLoanScaleRate.Number); octCmd.AddParam("@Min", pLoanScaleRate.ScaleMin); octCmd.AddParam("@Max", pLoanScaleRate.ScaleMax); }