Пример #1
0
 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();
 }
Пример #2
0
 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();
 }
Пример #3
0
 public static void insertcontact(contactu cmt)
 {
     DB person = new DB();
     person.contactus.Add(cmt);
     person.SaveChanges();
 }
Пример #4
0
 public static SliderImage selectsingle(int id)
 {
     DB sample = new DB();
     return sample.SliderImages.Single(item => item.ID == id);
 }
Пример #5
0
 public static List<SliderImage> selectimage()
 {
     DB sample = new DB();
     return sample.SliderImages.ToList();
 }
Пример #6
0
 public static void Addimages(SliderImage slider)
 {
     DB sample = new DB();
     sample.SliderImages.Add(slider);
     sample.SaveChanges();
 }
Пример #7
0
 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;
 }