//public void InsertOrReplaceAll(IEnumerable collection, string tableName) //{ // foreach (var item in collection) // { // Dictionary<string, object> fields = new Dictionary<string, object>(); // if (item is LocationPoint) // { // var location = item as LocationPoint; // fields.Add("PositionDate", location.PositionDate); // fields.Add("Lat", location.Lat); // fields.Add("Lon", location.Lon); // fields.Add("Height", location.Height); // fields.Add("Accuracy", location.Accuracy); // fields.Add("Speed", location.Speed); // fields.Add("BatteryStatus", location.BatteryStatus); // } // //if (item is StatisticItem) // //{ // // var statisticItem = item as StatisticItem; // // fields.Add("Id", statisticItem.Id.ToString()); // // fields.Add("Date", statisticItem.Date.ToString()); // // fields.Add("ItemId", statisticItem.ItemId); // // fields.Add("Type", statisticItem.Type); // //} // Insert(tableName, fields); // } //} public void SaveTrinathlonTraining(TriathlonTraining item) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("Date", item.Date); fields.Add("Distance", item.Distance); fields.Add("Time", item.Time); fields.Add("Type", item.Type); }
public void SetCurrentItem(int id = -1) { if (id != -1) { currentItem = new TriathlonTraining(); } else { currentItem = DataBaseService.Instance.GetTriathlonTrainingById(id); } }