Пример #1
0
 /// <summary>
 /// Method that converts DB locations to Business Logic locations
 /// </summary>
 /// <param name="l"></param>
 /// <returns></returns>
 public BusinessLogic.Location ParseLocation(Entities.Location l)
 {
     return(new BusinessLogic.Location()
     {
         LocID = l.LocationId,
         BranchName = l.BranchName,
         City = l.City,
         Street = l.Street,
         State = (States)Enum.Parse(typeof(States), l.State, true),
         Zipcode = int.Parse(l.ZipCode)
     });
 }
Пример #2
0
 /// <summary>
 /// A method that converts the DataAcess.Entities.Location => Library.Modals.Location
 /// </summary>
 /// <param name="location"> DataAcess.Entities.Location to be converted to Library.Modals.Location </param>
 /// <returns> return a Library.Modals.Location</returns>
 public static Project1.Library.Modals.Location Map(Entities.Location location)
 {
     Library.Modals.Location obj = new Project1.Library.Modals.Location
     {
         ID          = location.StoreId,
         Name        = location.Store.Name,
         Description = location.Store.Description,
         Rules       = location.Store.Rules,
         LocationID  = location.LocationId,
         Address     = new Library.Modals.Address
         {
             X = location.X,
             Y = location.Y
         },
     };
     return(obj);
 }