Exemplo n.º 1
0
 public static List<Order> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Order> orders = dbContext.Orders                        
                 .ToList();
     return orders;
 }
Exemplo n.º 2
0
 public static List<Refill> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Refill> refill = dbContext.Refills                        
                 .ToList();
     return refill;
 }
Exemplo n.º 3
0
 public static List<OrderItem> GetList()
 {
     var dbContext = new DatabaseContext();
     List<OrderItem> orderItem = dbContext.OrderItems                        
                 .ToList();
     return orderItem;
 }
Exemplo n.º 4
0
 public static List<Vehicle> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Vehicle> vehicles = dbContext.Vehicles                        
                 .ToList();
     return vehicles;
 }
Exemplo n.º 5
0
 public static List<Trip> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Trip> trip = dbContext.Trips                        
                 .ToList();
     return trip;
 }
Exemplo n.º 6
0
 public static List<Photo> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Photo> photos = dbContext.Photos                        
                 .ToList();
     return photos;
 }
Exemplo n.º 7
0
 public static List<Driver> GetList()
 {
     var dbContext = new DatabaseContext();
     List<Driver> drivers = dbContext.Drivers                        
                 .ToList();
     return drivers;
 }
Exemplo 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;
 }
Exemplo 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;
 }
Exemplo 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;
 }
Exemplo 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;
 }
Exemplo 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)
            {
            }

        }
Exemplo 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;
        }
Exemplo n.º 14
0
 public PollDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Exemplo n.º 15
0
 public WorkDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Exemplo 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;
 }
Exemplo n.º 17
0
 public UserDa(DatabaseContext databasecontext)
 {
     _databasecontext = databasecontext;
 }
Exemplo n.º 18
0
 public VehicleDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Exemplo n.º 19
0
 public static List<Role> GetRoleList()
 {
     var dbContext = new DatabaseContext();
     List<Role> roles = dbContext.Roles
                 .ToList();
     return roles;
 }
Exemplo n.º 20
0
 public TripDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Exemplo n.º 21
0
 public PhotoDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Exemplo n.º 22
0
 public OrderItemDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Exemplo n.º 23
0
 public RefillDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }
Exemplo n.º 24
0
 public DriverDa(DatabaseContext databasecontext)
 {
    _databasecontext = databasecontext;
 }