public void TestInsertFinType() { var tempConnection = DataBaseLink.Fabricate.CreateConnection(_connection, DataBaseLink.ConnectionType.Npgsql); DataBaseLink.DbLink dbLink = new DbLink(tempConnection); fin_type fin_type = new fin_type("FX_RATE", "Валютный курс"); if (FinType.FindId(dbLink, fin_type.ident) == null) { FinType.Insert(dbLink, fin_type); } }
public void TestRemoveFinType() { var tempConnection = DataBaseLink.Fabricate.CreateConnection(_connection, DataBaseLink.ConnectionType.Npgsql); DataBaseLink.DbLink dbLink = new DbLink(tempConnection); fin_type fin_type = new fin_type("BUSHEUV", "BUSHUEV"); if (FinType.FindId(dbLink, fin_type.ident) == null) { FinType.Insert(dbLink, fin_type); var t = FinType.FindId(dbLink, fin_type.ident); Console.WriteLine(t.ft_id); FinType.Remove(dbLink, t.ft_id); } else { var t = FinType.FindId(dbLink, fin_type.ident); Console.WriteLine(t.ft_id); FinType.Remove(dbLink, t.ft_id); } }