Exemple #1
0
 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);
            }
        }
Exemple #3
0
 private void RestoreValue()
 {
     this.Programme         = this.programmeOldValue;
     this.programmeOldValue = null;
     this.DataContext       = this.Programme;
 }
Exemple #4
0
 private void ClearBackupValue()
 {
     this.programmeOldValue = null;
     this.DataContext       = this.Programme;
 }
Exemple #5
0
 private void StoreBackupValue()
 {
     this.programmeOldValue = new ExistingProgrammeJson(this.Programme.Id, this.Programme.Title, this.Programme.Description);
 }