Exemplo n.º 1
0
        public int CreateProperty(double estimatedPrice, int caseID, int postalCode, string adressLine1)
        {
            var database = new EstateBrokerContext();
            var property = new Database.Property()
            {
                EstimatedPrice = estimatedPrice,
                PostalCode     = postalCode,
                AddressLine1   = adressLine1,
                CaseID         = caseID
            };

            database.Properties.Add(property);
            database.SaveChanges();
            return(property.PropertyID);
        }
Exemplo n.º 2
0
 public bool UpdateProperty(int ID, double estimatedPrice, int caseID, int postalCode, string adressLine1)
 {
     try
     {
         using (var database = new EstateBrokerContext())
         {
             Database.Property property = database.Properties.Find(ID);
             property.EstimatedPrice = estimatedPrice;
             property.CaseID         = caseID;
             property.PostalCode     = postalCode;
             property.AddressLine1   = adressLine1;
             database.SaveChanges();
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }