Beispiel #1
0
 public LOCATIONS CreateLocation(LocationsViewModel loc)
 {
     return(new LOCATIONS
     {
         LOCATION_ID = loc.LocationId,
         ADDRESS1 = loc.Address1,
         ADDRESS2 = loc.Address2,
         CITY = loc.City,
         STATE = loc.State,
         ZIP_CODE = loc.ZipCode
     });
 }
Beispiel #2
0
 public int AddLocationInfo(LocationsViewModel location)
 {
     try
     {
         var loc = ModelFactory.CreateLocation(location);
         db.LOCATIONS.Add(loc);
         SaveAll();
         return(loc.LOCATION_ID);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         throw;
     }
 }
Beispiel #3
0
 public bool UpdateAddress(LocationsViewModel location)
 {
     db.Entry(GetLocationById(location.LocationId)).CurrentValues.SetValues(ModelFactory.CreateLocation(location));
     return(SaveAll());
 }