public static PersonalEvent CreateNew(User user, string title, string description, DateTime when) { var adapter = new dataDataSetTableAdapters.EventsTableAdapter(); var createdTime = DateTime.Now; adapter.Insert(user.Username, title, description, when, createdTime, createdTime, default); return(new PersonalEvent((dataDataSet.EventsRow)adapter.GetData().Select("Created=" + createdTime.ToString())[0])); }
public void Update(string _title, string _description, DateTime _when) { Title = _title; Description = _description; When = _when; Updated = DateTime.Now; var adapter = new dataDataSetTableAdapters.EventsTableAdapter(); adapter.UpdateData(Title, Description, When, Updated, ID); }