예제 #1
0
 public void Add(DataModel.Task task)
 {
     using (var db = new SQLiteConnection(FileName))
     {
         db.Insert(task);
     }
 }
예제 #2
0
 public DataModel.Task Get(Guid id)
 {
     using (var db = new SQLiteConnection(FileName))
     {
         DataModel.Task task = (from t in db.Table <DataModel.Task>() where t.ID == id select t).FirstOrDefault();
         return(task);
     }
 }
예제 #3
0
 public void Add(DataModel.Task task)
 {
     using (var ctx = new TaskContext(ConnectionString))
     {
         TaskContext.Tasks.AddOrUpdate(task);
         TaskContext.SaveChanges();
     }
 }
예제 #4
0
 public void Update(DataModel.Task task)
 {
     using (var db = new SQLiteConnection(FileName))
     {
         //var y = db.Table<DataModel.Task>().Where(x => x.ID == task.ID).FirstOrDefault();
         //Mapper.Map(task,y);
         db.Update(task);
     }
 }
예제 #5
0
 public void Update(DataModel.Task task)
 {
     DataModel.Task Update = GetAll().FirstOrDefault(e => e.ID == task.ID);
     Update = task;
     TaskManagementEntities.SaveChanges();
 }
예제 #6
0
 public void Add(DataModel.Task task)
 {
     TaskManagementEntities.Tasks.AddOrUpdate(task);
     TaskManagementEntities.SaveChanges();
 }
예제 #7
0
 public void Update(DataModel.Task task)
 {
     Add(task);
 }
예제 #8
0
 public void Update(DataModel.Task task)
 {
     DataModel.Task updateTask = Tasks.FirstOrDefault(t => t.ID == task.ID);
     Mapper.Map(task, updateTask);
     WriteData(Tasks, JsonData);
 }
예제 #9
0
 public void Add(DataModel.Task task)
 {
     Tasks.Add(task);
     WriteData(Tasks, JsonData);
 }