public static void downloadArea() { String StationID = ManageLOG.getValueFromRegistry(Configurations.AppRegName, "StationID"); int total = 0; int success = 0; AreaDao dao = new AreaDao(); List <ModelArea> lists = dao.Select(" Where area_station=" + StationID); if (lists != null) { total = lists.Count; logger.Debug("# Start download [AREA] from server."); foreach (ModelArea model in lists) { List <ModelArea> tmp = dao.SelectOffine(" Where id='" + model.id + "'"); if (tmp != null) { if (tmp.Count > 0) { } else { if (dao.InsertOffline(model)) { success++; } } } } logger.Debug("# Summary=> Total Download total: " + total + " success: " + success + " fail: " + (total - success)); logger.Debug("# End Download data from server."); } }