public void TestFixtureSetUp() { User.CurrentUser = new User(); User.CurrentUser.Id = 1; GeneralSettings dataParam = GeneralSettings.GetInstance(""); dataParam.DeleteAllParameters(); dataParam.AddParameter(OGeneralSettings.USECENTS, true); ChartOfAccounts chartOfAccounts = ChartOfAccounts.GetInstance(User.CurrentUser); chartOfAccounts.Accounts = chartOfAccounts.DefaultAccounts; ProvisioningTable provisioningTable = ProvisioningTable.GetInstance(User.CurrentUser); provisioningTable.AddProvisioningRate(new ProvisioningRate(1, 0, 0, 2)); }
/// <summary> /// This method Fill the instance of the ProvisioningTable object accessed by singleton /// </summary> public void SelectAllProvisioningRates() { ProvisioningTable provisioningTable = ProvisioningTable.GetInstance(_user); string sqlText = "SELECT id,number_of_days_min, number_of_days_max, provisioning_value FROM ProvisioningRules"; SqlCommand select = new SqlCommand(sqlText, CurrentConnection); using (SqlDataReader reader = select.ExecuteReader()) { while (reader.Read()) { ProvisioningRate pR = new ProvisioningRate(); pR.Number = DatabaseHelper.GetInt32("id", reader); pR.NbOfDaysMin = DatabaseHelper.GetInt32("number_of_days_min", reader); pR.NbOfDaysMax = DatabaseHelper.GetInt32("number_of_days_max", reader); pR.Rate = DatabaseHelper.GetDouble("provisioning_value", reader); provisioningTable.AddProvisioningRate(pR); } } }