예제 #1
0
        public void DeleteHardware(HardwareSolutionVM ids)
        {
            Solution_Hardware model;

            using (ApplicationDbContext db = new ApplicationDbContext())
            {
                model             = db.Solution_Hardware.FirstOrDefault(x => x.HardwareID == ids.HardwareID && x.SolutionID == ids.SolutionID);
                model.DateDeleted = DateTime.Now;
                db.SaveChanges();
            }
        }
예제 #2
0
        public void AddHardwareSolu(HardwareSolutionVM ids)
        {
            Solution_Hardware model = new Solution_Hardware()
            {
                HardwareID = ids.HardwareID,
                SolutionID = ids.SolutionID
            };

            using (ApplicationDbContext db = new ApplicationDbContext())
            {
                db.Solution_Hardware.Add(model);
                db.SaveChanges();
            };
        }
예제 #3
0
 //adds a hardware to a solution
 public IHttpActionResult Post(HardwareSolutionVM ids)
 {
     _adapter.AddHardwareSolu(ids);
     return(Ok());
 }
 //Deletes a hardware from a solution
 public IHttpActionResult Post(HardwareSolutionVM ids)
 {
     //_adapter.DeleteHardware(ids);
     return(Ok());
 }