Esempio n. 1
0
 public static List<Order> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Order> orders = dbContext.Orders                        
                 .ToList();
     return orders;
 }
Esempio n. 2
0
 public static List<Refill> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Refill> refill = dbContext.Refills                        
                 .ToList();
     return refill;
 }
Esempio n. 3
0
 public static List<OrderItem> GetList()
 {
     var dbContext = new DatabaseContext();
     List<OrderItem> orderItem = dbContext.OrderItems                        
                 .ToList();
     return orderItem;
 }
Esempio n. 4
0
 public static List<Vehicle> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Vehicle> vehicles = dbContext.Vehicles                        
                 .ToList();
     return vehicles;
 }
Esempio n. 5
0
 public static List<Trip> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Trip> trip = dbContext.Trips                        
                 .ToList();
     return trip;
 }
Esempio n. 6
0
 public static List<Photo> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Photo> photos = dbContext.Photos                        
                 .ToList();
     return photos;
 }
Esempio n. 7
0
 public static List<Driver> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Driver> drivers = dbContext.Drivers                        
                 .ToList();
     return drivers;
 }
Esempio n. 8
0
 public static List<PollVote> GetList()
 {
     var dbContext = new DatabaseContext();
     List<PollVote> pollVotes = (from pollvt in dbContext.PollVotes
                                 orderby pollvt.Id descending
                                 select pollvt).ToList();
     return pollVotes;
 }
Esempio n. 9
0
 public static List<Poll> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Poll> polls = (from poll in dbContext.Polls
                         orderby poll.Id descending
                         select poll).ToList();
     return polls;
 }
Esempio n. 10
0
 public static List<Work> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Work> works = (from wk in dbContext.Works
                         orderby wk.Id descending
                         select wk).ToList();
     return works;
 }
Esempio n. 11
0
 public static List<Article> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Article> articles = (from art in dbContext.Articles
                               orderby art.Id descending
                               select art).ToList();
     return articles;
 }
Esempio n. 12
0
        public void UpdateViews(int id, int views)
        {
            try
            {
                using (var ctx = new DatabaseContext())
                {
                    ctx.Database.ExecuteSqlCommand("UPDATE works SET  views = {1} where id = {0}", id, views);
                    ctx.SaveChanges();
                }
            }
            catch (Exception ex)
            {
            }

        }
Esempio n. 13
0
        public bool UpdatePassword(int id, string password)
        {
            bool updated = false;
            try
            { 
                using (var ctx = new DatabaseContext())
                {

                    ctx.Database.ExecuteSqlCommand("UPDATE users SET  password = {1} where id = {0}", id, password);

                    ctx.SaveChanges();
                    updated = true;
                }   
            }
            catch(Exception ex)
            {
                updated = false;
            }

            return updated;
        }
Esempio n. 14
0
 public PollDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Esempio n. 15
0
 public WorkDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Esempio n. 16
0
 public static List<User> GetList()
 {
     var dbContext = new DatabaseContext();
     List<User> users = (from usr in dbContext.Users
                         orderby usr.Id descending
                         select usr).ToList();
     return users;
 }
Esempio n. 17
0
 public UserDa(DatabaseContext databasecontext)
 {
     _databasecontext = databasecontext;
 }
Esempio n. 18
0
 public VehicleDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Esempio n. 19
0
 public static List<Role> GetRoleList()
 {
     var dbContext = new DatabaseContext();
     List<Role> roles = dbContext.Roles
                 .ToList();
     return roles;
 }
Esempio n. 20
0
 public TripDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Esempio n. 21
0
 public PhotoDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Esempio n. 22
0
 public OrderItemDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Esempio n. 23
0
 public RefillDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Esempio n. 24
0
 public DriverDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }