Example #1
0
 public void Update_Image_Path(int imageID, string imagePath)
 {
     using (Entity ent = new Entity())
     {
         tbl_Project_Images image = (from context in ent.tbl_Project_Images
                                     where context.Image_ID == imageID
                                     select context).SingleOrDefault();
         image.Image_Path = imagePath;
         ent.SaveChanges();
     }
 }
Example #2
0
        public void Delete_Image(int imageID)
        {
            using (Entity ent = new Entity())
            {
                tbl_Project_Images image = (from context in ent.tbl_Project_Images
                                            where context.Image_ID == imageID
                                            select context).SingleOrDefault();

                ent.tbl_Project_Images.Remove(image);
                ent.SaveChanges();
            }
        }
Example #3
0
 public void Add_Project_Image(int projectID, string imagePath)
 {
     using (Entity ent = new Entity())
     {
         tbl_Project_Images image = new tbl_Project_Images()
         {
             Project_ID = projectID,
             Image_Path = imagePath
         };
         ent.tbl_Project_Images.Add(image);
         ent.SaveChanges();
     }
 }