public int GetDecorativeColumnCost() { PriceAndCost priceAndCost = _context.PricesAndCosts .Where(p => p.PriceAndCostId == 5) .FirstOrDefault(); return(priceAndCost.Cost); }
public int GetWallCost() { PriceAndCost priceAndCost = _context.PricesAndCosts .Where(p => p.PriceAndCostId == 1) .FirstOrDefault(); return(priceAndCost.Cost); }
public int GetDoorPrice() { PriceAndCost priceAndCost = _context.PricesAndCosts .Where(p => p.PriceAndCostId == 4) .FirstOrDefault(); return(priceAndCost.Price); }
public PriceAndCost GetPriceAndCostWindow() { Window window = windowHandler.GetFirst(); PriceAndCost priceAndCost = _context.PricesAndCosts .Where(p => p.PriceAndCostId == 3) .FirstOrDefault(); return(priceAndCost); }
public PriceAndCost GetPriceAndCostWallBeam() { WallBeam wallBeam = wallBeamHandler.GetFirst(); PriceAndCost priceAndCost = _context.PricesAndCosts .Where(p => p.PriceAndCostId == 2) .FirstOrDefault(); return(priceAndCost); }
public PriceAndCost GetPriceAndCostDoor() { Door door = doorHandler.GetFirst(); PriceAndCost priceAndCost = _context.PricesAndCosts .Where(p => p.PriceAndCostId == 4) .FirstOrDefault(); return(priceAndCost); }
public PriceAndCost GetPriceAndCostDecorativeColumn() { DecorativeColumn decorativeColumn = decorativeColumnHandler.GetFirst(); PriceAndCost priceAndCost = _context.PricesAndCosts .Where(p => p.PriceAndCostId == 5) .FirstOrDefault(); return(priceAndCost); }
public void WindowModifyPriceCost(int cost, int price) { PriceAndCost priceAndCost = _context.PricesAndCosts .Where(p => p.PriceAndCostId == 3) .FirstOrDefault(); priceAndCost.Cost = cost; priceAndCost.Price = price; _context.SaveChanges(); }
public void Add(Grid grid, Door door, PriceAndCost priceAndCost) { PriceAndCost priceCost = _context.PricesAndCosts .Where(w => w.PriceAndCostId == priceAndCost.PriceAndCostId) .FirstOrDefault(); door.PriceAndCost = priceCost; _context.Grids.Attach(grid); door.Grid = grid; _context.Doors.Add(door); _context.SaveChanges(); }
public void Add(Grid grid, Wall wall, PriceAndCost priceAndCost) { PriceAndCost p = _context.PricesAndCosts .Where(w => w.PriceAndCostId == priceAndCost.PriceAndCostId) .FirstOrDefault(); _context.Grids.Attach(grid); wall.Grid = grid; wall.PriceAndCost = p; _context.Walls.Add(wall); _context.SaveChanges(); }
public void Add(Grid grid, Window window, PriceAndCost priceAndCost) { PriceAndCost priceCost = _context.PricesAndCosts .Where(w => w.PriceAndCostId == priceAndCost.PriceAndCostId) .FirstOrDefault(); window.PriceAndCost = priceCost; _context.Grids.Attach(grid); window.Grid = grid; _context.Windows.Add(window); _context.SaveChanges(); }
public void Add(Grid grid, DecorativeColumn decorativeColumn, PriceAndCost priceAndCost) { PriceAndCost priceCost = _context.PricesAndCosts .Where(w => w.PriceAndCostId == priceAndCost.PriceAndCostId) .FirstOrDefault(); decorativeColumn.PriceAndCost = priceCost; _context.Grids.Attach(grid); decorativeColumn.Grid = grid; _context.DecorativeColumns.Add(decorativeColumn); _context.SaveChanges(); }
public void Add(Architect architect, GeneratedDoor generatedDoor, PriceAndCost priceAndCost) { //using (DatabaseContext _context = new DatabaseContext()) //{ // PriceAndCost priceAndCostToFind = _context.PricesAndCosts // .Where(p => p.PriceAndCostId == 3) // .FirstOrDefault(); // generatedDoor.PriceAndCost = priceAndCostToFind; // _context.Architects.Attach(architect); // generatedDoor.Architect = architect; // _context.GeneratedDoors.Add(generatedDoor); // _context.SaveChanges(); //} }
public void Add(Grid grid, WallBeam wallBeam, PriceAndCost priceAndCost) { try { PriceAndCost priceCost = _context.PricesAndCosts .Where(w => w.PriceAndCostId == priceAndCost.PriceAndCostId) .FirstOrDefault(); wallBeam.PriceAndCost = priceCost; _context.Grids.Attach(grid); wallBeam.Grid = grid; _context.WallBeams.Add(wallBeam); _context.SaveChanges(); } catch (Exception e) { } }
public void Add(Grid grid, Wall wall, PriceAndCost priceAndCost) { this.IsValid(grid, wall); this.wallRepository.Add(grid, wall, priceAndCost); }
public void Add(Architect architect, GeneratedDoor generatedDoor, PriceAndCost priceAndCost) { this.generatedDoorRepository.Add(architect, generatedDoor, priceAndCost); }
static void Main() { using (DatabaseContext context = new DatabaseContext()) { #region Administrator if (!context.Administrators.Any()) { Administrator admin = new Administrator("admin", "admin", "Joaquin", "Touris", new DateTime(2018, 05, 05), new DateTime(2018, 05, 05)); context.Administrators.Add(admin); context.SaveChanges(); } #endregion #region Default Costs and Prices if (!context.PricesAndCosts.Any()) { PriceAndCost priceWall = new PriceAndCost { Cost = 50, Price = 100, PriceAndCostId = 1 }; PriceAndCost priceWallBeam = new PriceAndCost { Cost = 50, Price = 100, PriceAndCostId = 2 }; PriceAndCost priceWindow = new PriceAndCost { Cost = 50, Price = 75, PriceAndCostId = 3 }; PriceAndCost priceDoor = new PriceAndCost { Cost = 50, Price = 100, PriceAndCostId = 4 }; PriceAndCost priceDecorativeColumn = new PriceAndCost { Cost = 25, Price = 50, PriceAndCostId = 5 }; context.PricesAndCosts.Add(priceWall); context.PricesAndCosts.Add(priceWallBeam); context.PricesAndCosts.Add(priceWindow); context.PricesAndCosts.Add(priceDoor); context.PricesAndCosts.Add(priceDecorativeColumn); context.SaveChanges(); } } #endregion Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Login()); }
public void Add(Grid grid, Window window, PriceAndCost priceAndCost) { isValid(window); this.windowRepository.Add(grid, window, priceAndCost); }
public void Add(Architect architect, GeneratedWindow generatedWindow, PriceAndCost priceAndCost) { this.generatedWindowRepository.Add(architect, generatedWindow); }
public void Add(Grid grid, Door door, PriceAndCost priceAndCost) { isValid(door); this.doorRepository.Add(grid, door, priceAndCost); }
public void Add(Grid grid, WallBeam wallBeam, PriceAndCost priceAndCost) { this.wallBeamRepository.Add(grid, wallBeam, priceAndCost); }
public void Add(Grid grid, DecorativeColumn decorativeColumn, PriceAndCost priceAndCost) { this.IsValid(grid, decorativeColumn); this.decorativeColumnRepository.Add(grid, decorativeColumn, priceAndCost); }