Exemplo n.º 1
0
        public void UpdateAppointment(Appointment appointment, DateTime date, DateTime StartTime, DateTime EndTime,
            string category, string descricption, string status)
        {
            appointment.Date = date;
            appointment.StarTime = StartTime;
            appointment.EndTime = EndTime;
            appointment.Category = category;
            appointment.Description = descricption;
            appointment.Status = status;

            using (var ctx = new SystemContext())
            {
                ctx.Entry(appointment).State = System.Data.Entity.EntityState.Modified;
                ctx.SaveChanges();
            }
        }
Exemplo n.º 2
0
 public void UpdateBuyer(Buyer buyer, List<Property> properties, string name, string address, string zipCode, string phone, string mobile, string email, string misc, string estateType, double minPrice, double maxPrice,
     double lotSizeMin, double lotSizeMax, double probertySizeMin, double probertySizeMax, double desiredRoomsMin, double desiredRoomsMax, List<Location> locations, string otherPref, Boolean contactAllowedByBoligOne,
     Boolean contactAllowedByReal, Boolean allowedEmailSpam, Boolean inRKI, Boolean buyerApproved, string bank, Boolean ownesHouse, Boolean livesForRent)
 {
     buyer.Name = name;
     buyer.Properties = properties;
     buyer.Address = address;
     buyer.ZipCode = zipCode;
     buyer.Phone = phone;
     buyer.Mobile = mobile;
     buyer.Email = email;
     buyer.Misc = misc;
     buyer.EstateType = estateType;
     buyer.MinPrice = minPrice;
     buyer.MaxPrice = maxPrice;
     buyer.LotSizeMin = lotSizeMin;
     buyer.LotSizeMax = lotSizeMax;
     buyer.ProbertySizeMin = probertySizeMin;
     buyer.ProbertySizeMax = probertySizeMax;
     buyer.DesiredRoomsMin = desiredRoomsMin;
     buyer.DesiredRoomsMax = desiredRoomsMax;
     buyer.Locations = locations;
     buyer.OtherPref = otherPref;
     buyer.ContactAllowedByBoligOne = contactAllowedByBoligOne;
     buyer.ContactAllowedByReal = contactAllowedByReal;
     buyer.AllowedEmailSpam = allowedEmailSpam;
     buyer.InRKI = inRKI;
     buyer.BuyerApproved = buyerApproved;
     buyer.Bank = bank;
     buyer.OwnesHouse = ownesHouse;
     buyer.LivesForRent = livesForRent;
     using (var ctx = new SystemContext())
     {
         ctx.Entry(buyer).State = System.Data.Entity.EntityState.Modified;
         ctx.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public void UpdateBuyer(Buyer buyer)
 {
     //Fire up a new DB context
     using (var ctx = new SystemContext())
     {
         //Match buyer from input with buyer to update from database
         Buyer dbBuyer = ctx.Buyers.Find(buyer.Id);
         //Set the values of the dbBuyer to the values of the buyer from input
         ctx.Entry(dbBuyer).CurrentValues.SetValues(buyer);
         //Save the changes back to the database.
         ctx.SaveChanges();
     }
 }
Exemplo n.º 4
0
 public void UpdateLocation(Location loc, string zipCode, string city)
 {
     loc.ZipCode = zipCode;
     loc.City = city;
     using (var ctx = new SystemContext())
     {
         ctx.Entry(loc).State = System.Data.Entity.EntityState.Modified;
         ctx.SaveChanges();
     }
 }
Exemplo n.º 5
0
 public void UpdateUser(User user, List<Appointment> appointments, string name, string address, string zipCode, string phone, string mobil, string email, string misc)
 {
     user.Name = name;
     user.Appointments = appointments;
     user.Address = address;
     user.ZipCode = zipCode;
     user.Phone = phone;
     user.Mobile = mobil;
     user.Email = email;
     user.Misc = misc;
     using (var ctx = new SystemContext())
     {
         ctx.Entry(user).State = System.Data.Entity.EntityState.Modified;
         ctx.SaveChanges();
     }
 }
Exemplo n.º 6
0
 public void UpdateSeller(Seller seller)
 {
     using (var ctx = new SystemContext())
     {
         Seller dbSeller = ctx.Sellers.Find(seller.Id);
         ctx.Entry(dbSeller).CurrentValues.SetValues(seller);
         ctx.SaveChanges();
     }
 }
Exemplo n.º 7
0
        public void UpdateSeller(Seller seller, List<Property> properties, string name, string address, string zipCode, string phone, string mobil, string email, string misc)
        {
            using (var ctx = new SystemContext())
            {
                Seller s = ctx.Sellers.Where(x => x.Id == seller.Id).SingleOrDefault();
                s.Name = name;
                s.Properties = properties;
                s.Address = address;
                s.ZipCode = zipCode;
                s.Phone = phone;
                s.Mobile = mobil;
                s.Email = email;
                s.Misc = misc;

                ctx.Entry(s).State = System.Data.Entity.EntityState.Modified;
                ctx.SaveChanges();
            }
        }
Exemplo n.º 8
0
 public void UpdateProperty(Property property, string address, string zipCode, string type, int rooms, int floors, double price,
     double propertySize, double houseSize, int constructionYear)
 {
     using (var ctx = new SystemContext())
     {
         Property p = ctx.Properties.Where(x => x.Id == property.Id).SingleOrDefault();
         p.Address = address;
         p.ZipCode = zipCode;
         p.Type = type;
         p.Rooms = rooms;
         p.Floors = floors;
         p.Price = price;
         p.PropertySize = propertySize;
         p.HouseSize = houseSize;
         p.ConstructionYear = constructionYear;
         ctx.Entry(p).State = System.Data.Entity.EntityState.Modified;
         ctx.SaveChanges();
     }
 }