Exemplo n.º 1
0
        public void Put(int id, [FromBody] Syncs newObj)
        {
            var oldObj = db.Syncs.Find(id);

            if (oldObj == null)
            {
                return;
            }
            newObj.Id = oldObj.Id;
            db.Entry(oldObj).CurrentValues.SetValues(newObj);
            db.SaveChanges();
        }
Exemplo n.º 2
0
 private void update(string objects, string dates, string users)
 {
     try
     {
         //Update(string objects, string dates, string users)
         _syncs = App.WimeaApp.Syncs.Add();
         _syncs.Update(objects, dates, users);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
Exemplo n.º 3
0
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            Button button = sender as System.Windows.Controls.Button;
            Syncs  syncs  = button.DataContext as Syncs;

            if (MessageBox.Show("Are you sure you want to delete " + syncs.Objects + " ?", "Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                syncs.Delete(syncs.Id.ToString());
                RefreshStationList();
            }
            else
            {
                return;
            }
        }
Exemplo n.º 4
0
 private void save(string objects, string dates, string users)
 {
     try
     {
         _syncs         = App.WimeaApp.Syncs.Add();
         _syncs.Objects = objects;
         _syncs.Dates   = dates;
         _syncs.Users   = users;
         _syncs.Save();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
Exemplo n.º 5
0
 public void Post(Syncs sync)
 {
     db.Syncs.Add(sync);
     db.SaveChanges();
 }