コード例 #1
0
        public int GetDecorativeColumnCost()
        {
            PriceAndCost priceAndCost = _context.PricesAndCosts
                                        .Where(p => p.PriceAndCostId == 5)
                                        .FirstOrDefault();

            return(priceAndCost.Cost);
        }
コード例 #2
0
        public int GetWallCost()
        {
            PriceAndCost priceAndCost = _context.PricesAndCosts
                                        .Where(p => p.PriceAndCostId == 1)
                                        .FirstOrDefault();

            return(priceAndCost.Cost);
        }
コード例 #3
0
        public int GetDoorPrice()
        {
            PriceAndCost priceAndCost = _context.PricesAndCosts
                                        .Where(p => p.PriceAndCostId == 4)
                                        .FirstOrDefault();

            return(priceAndCost.Price);
        }
コード例 #4
0
        public PriceAndCost GetPriceAndCostWindow()
        {
            Window       window       = windowHandler.GetFirst();
            PriceAndCost priceAndCost = _context.PricesAndCosts
                                        .Where(p => p.PriceAndCostId == 3)
                                        .FirstOrDefault();

            return(priceAndCost);
        }
コード例 #5
0
        public PriceAndCost GetPriceAndCostWallBeam()
        {
            WallBeam     wallBeam     = wallBeamHandler.GetFirst();
            PriceAndCost priceAndCost = _context.PricesAndCosts
                                        .Where(p => p.PriceAndCostId == 2)
                                        .FirstOrDefault();

            return(priceAndCost);
        }
コード例 #6
0
        public PriceAndCost GetPriceAndCostDoor()
        {
            Door         door         = doorHandler.GetFirst();
            PriceAndCost priceAndCost = _context.PricesAndCosts
                                        .Where(p => p.PriceAndCostId == 4)
                                        .FirstOrDefault();

            return(priceAndCost);
        }
コード例 #7
0
        public PriceAndCost GetPriceAndCostDecorativeColumn()
        {
            DecorativeColumn decorativeColumn = decorativeColumnHandler.GetFirst();
            PriceAndCost     priceAndCost     = _context.PricesAndCosts
                                                .Where(p => p.PriceAndCostId == 5)
                                                .FirstOrDefault();

            return(priceAndCost);
        }
コード例 #8
0
        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();
        }
コード例 #9
0
        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();
        }
コード例 #10
0
        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();
        }
コード例 #11
0
        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();
        }
コード例 #12
0
        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();
        }
コード例 #13
0
        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();
            //}
        }
コード例 #14
0
 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)
     {
     }
 }
コード例 #15
0
 public void Add(Grid grid, Wall wall, PriceAndCost priceAndCost)
 {
     this.IsValid(grid, wall);
     this.wallRepository.Add(grid, wall, priceAndCost);
 }
コード例 #16
0
 public void Add(Architect architect, GeneratedDoor generatedDoor, PriceAndCost priceAndCost)
 {
     this.generatedDoorRepository.Add(architect, generatedDoor, priceAndCost);
 }
コード例 #17
0
        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());
        }
コード例 #18
0
 public void Add(Grid grid, Window window, PriceAndCost priceAndCost)
 {
     isValid(window);
     this.windowRepository.Add(grid, window, priceAndCost);
 }
コード例 #19
0
 public void Add(Architect architect, GeneratedWindow generatedWindow, PriceAndCost priceAndCost)
 {
     this.generatedWindowRepository.Add(architect, generatedWindow);
 }
コード例 #20
0
ファイル: DoorHandler.cs プロジェクト: invict1/Graphic-Master
 public void Add(Grid grid, Door door, PriceAndCost priceAndCost)
 {
     isValid(door);
     this.doorRepository.Add(grid, door, priceAndCost);
 }
コード例 #21
0
 public void Add(Grid grid, WallBeam wallBeam, PriceAndCost priceAndCost)
 {
     this.wallBeamRepository.Add(grid, wallBeam, priceAndCost);
 }
コード例 #22
0
 public void Add(Grid grid, DecorativeColumn decorativeColumn, PriceAndCost priceAndCost)
 {
     this.IsValid(grid, decorativeColumn);
     this.decorativeColumnRepository.Add(grid, decorativeColumn, priceAndCost);
 }