コード例 #1
0
ファイル: tblCarsDAO.cs プロジェクト: Joachim8790/CSCBelgium
 public void editCar(tblCars car)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         db.Entry(car).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
コード例 #2
0
 public void UpdateSlide(tblSlides slide)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         db.Entry(slide).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
コード例 #3
0
 public void UpdateImage(tblImages image)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         db.Entry(image).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
コード例 #4
0
 public void UpdatePost(tblPosts post)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         db.Entry(post).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
コード例 #5
0
 public void deleteColor(int colorid)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         tblColors color = getColor(colorid);
         db.Entry(color).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
コード例 #6
0
 public void deleteSlide(int slideID)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         tblSlides slide = getSlide(slideID);
         db.Entry(slide).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
コード例 #7
0
 public void deletePost(int postID)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         tblPosts post = getPost(postID);
         db.Entry(post).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
コード例 #8
0
 public void deleteBrand(int brandid)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         tblBrands brand = getBrand(brandid);
         db.Entry(brand).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
コード例 #9
0
ファイル: tblCarsDAO.cs プロジェクト: Joachim8790/CSCBelgium
 public void SellCar(tblCars car, bool sold)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         if (sold)
         {
             car.Sold            = (byte)1;
             db.Entry(car).State = EntityState.Modified;
             db.SaveChanges();
         }
         else
         {
             car.Sold            = (byte)0;
             db.Entry(car).State = EntityState.Modified;
             db.SaveChanges();
         }
     }
 }
コード例 #10
0
 public void SellRim(tblRims rim, bool sold)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         if (sold)
         {
             rim.Sold            = (byte)1;
             db.Entry(rim).State = EntityState.Modified;
             db.SaveChanges();
         }
         else
         {
             rim.Sold            = (byte)0;
             db.Entry(rim).State = EntityState.Modified;
             db.SaveChanges();
         }
     }
 }
コード例 #11
0
 public void UpdateOrder(tblSlides slide, int txtOrder)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         System.Diagnostics.Debug.WriteLine(txtOrder);
         slide.SlideOrder      = txtOrder;
         db.Entry(slide).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
コード例 #12
0
 public void deleteRim(int rimID)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         deleteImagesOfRim(rimID);
         tblRims rim = getRim(rimID);
         db.Entry(rim).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
コード例 #13
0
ファイル: tblCarsDAO.cs プロジェクト: Joachim8790/CSCBelgium
 public void deleteCar(int CarID)
 {
     using (var db = new CSCbelgiumDatabaseEntities())
     {
         tblImagesDAO imagesdao = new tblImagesDAO();
         imagesdao.DeleteAllImagesOfCar(getCar(CarID));
         tblCars car = getCar(CarID);
         db.Entry(car).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
コード例 #14
0
        public void updateAlignment(tblSlides slide, int ddlID)
        {
            using (var db = new CSCbelgiumDatabaseEntities())
            {
                switch (ddlID)
                {
                case 0:
                    slide.CaptionAlignment = "Links";
                    break;

                case 1:
                    slide.CaptionAlignment = "Midden";
                    break;

                case 2:
                    slide.CaptionAlignment = "Rechts";
                    break;
                }
                db.Entry(slide).State = EntityState.Modified;
                db.SaveChanges();
            }
        }