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

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

            return(data.users.ToList());

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

            return(data.vendors.ToList());

            //throw new NotImplementedException();
        }
示例#4
0
 public void AddVendor(Vendor vendor)
 {
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         data.vendors.Add(vendor);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
 }
示例#5
0
 public void Add(Admin admin)
 {
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         data.admin.Add(admin);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
 }
示例#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;
     }
 }
示例#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;
     }
 }
示例#8
0
 public void AddUser(User users)
 {
     try
     {
         DynamicDBContext data = new DynamicDBContext();
         data.users.Add(users);
         data.SaveChanges();
     }
     catch (Exception)
     {
         // throw;
     }
     //throw new NotImplementedException();
 }
示例#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;
     }
 }
示例#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;
     }
 }
示例#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();
 }
示例#12
0
        public Vendor GetVendor(int Id)
        {
            DynamicDBContext data = new DynamicDBContext();

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

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

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