예제 #1
0
 public List <StopsModel> GetAll()
 {
     try
     {
         StopsDataLayerRealm    dl     = new StopsDataLayerRealm();
         List <StopsModel>      list   = new List <StopsModel>();
         List <StopsRealmModel> models = dl.GetAll();
         foreach (StopsRealmModel model in models)
         {
             StopsModel realmModel = new StopsModel();
             realmModel.stop_code          = model.stop_code;
             realmModel.stop_id            = model.stop_id;
             realmModel.stop_lat           = model.stop_lat;
             realmModel.stop_lon           = model.stop_lon;
             realmModel.stop_name          = model.stop_name;
             realmModel.routes_short_names = model.routes_short_names;
             list.Add(realmModel);
         }
         //list = list.OrderBy(x => x.a_descrizione).ToList();
         return(list);
     }
     catch (Exception pException)
     {
         System.Diagnostics.Debug.WriteLine("Error StopsBusinness->GetAll " + pException.Message);
     }
     return(null);
 }
예제 #2
0
 public void Insert(List <StopsModel> model)
 {
     try
     {
         StopsDataLayerRealm dl = new StopsDataLayerRealm();
         dl.Insert(model);
     }
     catch (Exception pException)
     {
         System.Diagnostics.Debug.WriteLine("Error StopsBusinness->Insert " + pException.Message);
     }
 }