UserTask prepareObject(){ UserTask task = new UserTask (); task.taskName = addTaskEntry.Text; task.taskDate = dtPicker.Date; task.taskTime = DateTime.Today + taskTime.Time; return task; }
// update / insert record in database public int SaveRecord(UserTask task) { lock (locker) { if (task.taskID != 0) { connection.Update (task); return task.taskID; } else { return connection.Insert (task); } } }