private void Update() { DateTime oldPurchaseDate = Entity.PurchaseDate; int oldTicketsPurchased = Entity.TicketsPurchased; double oldAmount = Entity.Amount; Entity.PurchaseDate = PurchaseDate; Entity.TicketsPurchased = TicketsPurchased; Entity.Amount = Amount; _commentRequester.Update(Entity, "booking/" + Id); UpdateCommand.RaiseCanExecuteChanged(); if (!_commentRequester.Update(Entity, "booking/" + Id)) { Entity.PurchaseDate = oldPurchaseDate; Entity.TicketsPurchased = oldTicketsPurchased; Entity.Amount = oldAmount; } //bw.Close(); }
private void Update() { DateTime oldDate = Entity.Date; string oldContent = Entity.Content; Entity.Date = Date; Entity.Content = Content; UpdateCommand.RaiseCanExecuteChanged(); if (!_apiRequester.Update(Entity, "reply/" + Id)) { Entity.Date = oldDate; Entity.Content = oldContent; } //rw.Close(); }
private void Update() { DateTime oldDate = Entity.Date; string oldContent = Entity.Content; Entity.Date = Date; Entity.Content = Content; UpdateCommand.RaiseCanExecuteChanged(); if (!_apiRequester.Update(Entity, "comment/" + Id)) { Entity.Date = oldDate; Entity.Content = oldContent; } CommentWindow commentWindow = App.Current.Windows.OfType <CommentWindow>().FirstOrDefault(); commentWindow.Close(); //cw.Close(); }