public ProgrammeListElementContainer(IProgrammeService programmeService, ExistingProgrammeJson programme) { InitializeComponent(); this.programmeService = programmeService; this.Programme = programme; this.DataContext = this.Programme; this.programmeOldValue = null; }
public void UpdateProgramme(string programmeID, ExistingProgrammeJson programme) { var request = new RestRequest("api/programme/" + programmeID, Method.PUT); request.AddJsonBody(programme); request.AddHeader("Content-Type", "application/json"); var response = this.restClient.Execute(request); if (response.StatusCode != HttpStatusCode.OK) { throw new InvalidOperationException(response.Content); } }
private void RestoreValue() { this.Programme = this.programmeOldValue; this.programmeOldValue = null; this.DataContext = this.Programme; }
private void ClearBackupValue() { this.programmeOldValue = null; this.DataContext = this.Programme; }
private void StoreBackupValue() { this.programmeOldValue = new ExistingProgrammeJson(this.Programme.Id, this.Programme.Title, this.Programme.Description); }