Beispiel #1
0
        public User GetUser(int id)
        {
            DynamicDBContext data = new DynamicDBContext();

            return(data.users.ToList().Find(x => x.UserID == id));
            //throw new NotImplementedException();
        }
Beispiel #2
0
        public List <User> GetUser()
        {
            DynamicDBContext data = new DynamicDBContext();

            return(data.users.ToList());

            // throw new NotImplementedException();
        }
Beispiel #3
0
        public List <Vendor> GetVendor()
        {
            DynamicDBContext data = new DynamicDBContext();

            return(data.vendors.ToList());

            //throw new NotImplementedException();
        }
Beispiel #4
0
 public void AddVendor(Vendor vendor)
 {
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         data.vendors.Add(vendor);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
 }
Beispiel #5
0
 public void Add(Admin admin)
 {
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         data.admin.Add(admin);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
 }
Beispiel #6
0
 public void RemoveVendor(int id)
 {
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         Vendor           user = data.vendors.ToList().Find(x => x.VendorId == id);
         data.vendors.Remove(user);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
 }
Beispiel #7
0
 public void Remove(int id)
 {
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         Admin            user = data.admin.ToList().Find(x => x.Id == id);
         data.admin.Remove(user);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
 }
Beispiel #8
0
 public void AddUser(User users)
 {
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         data.users.Add(users);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
     //throw new NotImplementedException();
 }
Beispiel #9
0
 public void UpdateVendor(Vendor user)
 {
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         data.Entry(user).State = System.Data.Entity.EntityState.Modified;
         // data.vendors.Add(user);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
 }
Beispiel #10
0
 public void Update(Admin admin)
 {
     //  Admin user = data.admin.ToList().Find(x => x.Id == id);
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         data.Entry(admin).State = System.Data.Entity.EntityState.Modified;
         //data.admin.Add(user);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
 }
Beispiel #11
0
 public void RemoveUser(int id)
 {
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         User             user = data.users.ToList().Find(x => x.UserID == id);
         data.users.Remove(user);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
     //throw new NotImplementedException();
 }
Beispiel #12
0
        public Vendor GetVendor(int Id)
        {
            DynamicDBContext data = new DynamicDBContext();

            return(data.vendors.ToList().Find(x => x.VendorId == Id));
        }
Beispiel #13
0
        public Admin GetAdmin(int Id)
        {
            DynamicDBContext data = new DynamicDBContext();

            return(data.admin.ToList().Find(x => x.Id == Id));
        }
Beispiel #14
0
        public List <Admin> GetAdmin()
        {
            DynamicDBContext data = new DynamicDBContext();

            return(data.admin.ToList());
        }