public static void delete(int id) { DB sample = new DB(); SliderImage deleteitem = sample.SliderImages.Single(item => item.ID == id); sample.SliderImages.Remove(deleteitem); sample.SaveChanges(); }
public static void updateimage(SliderImage slider) { DB sample = new DB(); SliderImage oldimage = sample.SliderImages.Single(item => item.ID == slider.ID); oldimage.Title = slider.Title; oldimage.ImagePath = slider.ImagePath; oldimage.Status = slider.Status; sample.SaveChanges(); }
public static void insertcontact(contactu cmt) { DB person = new DB(); person.contactus.Add(cmt); person.SaveChanges(); }
public static SliderImage selectsingle(int id) { DB sample = new DB(); return sample.SliderImages.Single(item => item.ID == id); }
public static List<SliderImage> selectimage() { DB sample = new DB(); return sample.SliderImages.ToList(); }
public static void Addimages(SliderImage slider) { DB sample = new DB(); sample.SliderImages.Add(slider); sample.SaveChanges(); }
public static bool Isvalid(string user, string pass) { DB entity = new DB(); bool result = entity.Users.Any(item => item.username == user && item.password == pass && item.status == true); return result; }