public TodoModel GetTodoById(int id)
        {
            TodoModel result = null;

            lock (syncObject) {
                result = database.Table <TodoModel> ().FirstOrDefault(x => x.Id == id);
            }
            return(result);
        }
 public void AddOrUpdateTodo(TodoModel item)
 {
     lock (syncObject) {
         if (item.Id == 0) {
             database.Insert (item);
         } else {
             database.Update (item);
         }
     }
 }
 public void AddOrUpdateTodo(TodoModel item)
 {
     lock (syncObject) {
         if (item.Id == 0)
         {
             database.Insert(item);
         }
         else
         {
             database.Update(item);
         }
     }
 }
		public TodoDetailsPage (ContentPage page, TodoModel todo) : base()
		{
			InitializeComponent ();
			if (todo.Id == 0) {
				todosDate.Text = DateTime.Now.ToString ("ddd MMM dd yyyy HH:mm:ss");
			} else {
				todosDate.Text = todo.Date;
				todosType.Text = (todo.Type == TodoModel.TypeBug ? TYPE_BUG : TYPE_FEATURE);
				todosStatus.Text = (todo.Status == TodoModel.StatusNew ? STATUS_NEW : todo.Type == TodoModel.TypeBug ? STATUS_FIXED : STATUS_IMPLEMENTED);
				description.Text = todo.Description;
			}
			model = todo;
			rootPage = page;
		}
Example #5
0
 public TodoDetailsPage(ContentPage page, TodoModel todo) : base()
 {
     InitializeComponent();
     if (todo.Id == 0)
     {
         todosDate.Text = DateTime.Now.ToString("ddd MMM dd yyyy HH:mm:ss");
     }
     else
     {
         todosDate.Text   = todo.Date;
         todosType.Text   = (todo.Type == TodoModel.TypeBug ? TYPE_BUG : TYPE_FEATURE);
         todosStatus.Text = (todo.Status == TodoModel.StatusNew ? STATUS_NEW : todo.Type == TodoModel.TypeBug ? STATUS_FIXED : STATUS_IMPLEMENTED);
         description.Text = todo.Description;
     }
     model    = todo;
     rootPage = page;
 }
Example #6
0
 public EventSaveArgs(TodoModel model) : base()
 {
     Todo = model;
 }
			public EventSaveArgs(TodoModel model) : base()
			{
				Todo = model;
			}