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