public void TestGetCatalogs() { //Test get by Id CatalogBL catalogBL = new CatalogBL(connectionString); List <SelectableModel> brands = catalogBL.GetAgriculturalBrands(); Assert.IsTrue(brands.Count() > 0); List <SelectableModel> civilStatus = catalogBL.GetCivilStatus(); Assert.IsTrue(civilStatus.Count() > 0); List <SelectableModel> genders = catalogBL.GetGenders(); Assert.IsTrue(genders.Count() > 0); List <SelectableModel> presentations = catalogBL.GetPresentations(); Assert.IsTrue(presentations.Count() > 0); List <SelectableModel> productGroups = catalogBL.GetProductGroups(); Assert.IsTrue(productGroups.Count() > 0); List <SelectableModel> regimes = catalogBL.GetRegimes(); Assert.IsTrue(regimes.Count() > 0); List <SelectableModel> units = catalogBL.GetUnits(); Assert.IsTrue(units.Count() > 0); List <SelectableModel> states = catalogBL.GetStates(); Assert.IsTrue(states.Count() > 0); }
public CatalogController() { string connectionString = "Server=tcp:lasmargaritas.database.windows.net,1433;Initial Catalog=LasMargaritasDBDev;Persist Security Info=False;User ID=LasMargaritasDbUser;Password=LasMargaritasPassw0rd!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"; if (ConfigurationManager.ConnectionStrings["LasMargaritasDb"] != null) { connectionString = ConfigurationManager.ConnectionStrings["LasMargaritasDb"].ConnectionString; } catalogBL = new CatalogBL(connectionString); }
public PartialViewResult ManageCatalog(int id) { tblCatalog catalog = new tblCatalog(); if (id != 0) { catalog = new CatalogBL().GetById(id); } ViewBag.Types = new CatalogTypeBL().GetAllCatalogTypes(); return(PartialView("_Manage", catalog)); }