示例#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
     });
 }
示例#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;
     }
 }
示例#3
0
 public bool UpdateAddress(LocationsViewModel location)
 {
     db.Entry(GetLocationById(location.LocationId)).CurrentValues.SetValues(ModelFactory.CreateLocation(location));
     return(SaveAll());
 }