private void load_Database() { /* add content from database */ IoDatastorage mydatastorage = new IoDatastorage(); string myInput = mydatastorage.string_IoDataStorage_ReadDataFromStorage(Storage.s_PathTextfile); try { /* try to print data from data storage to the gui */ DeleteContentFromAllTextboxes(); WriteCalendarNameFromDatabaseToTextBoxes(SplitDataFromStorageName(myInput)); WriteDateFromDatabaseToTextBoxes(SplitDataFromStorageDate(myInput)); } catch (System.ArgumentOutOfRangeException outofRange) { System.Diagnostics.Debug.WriteLine(outofRange.Message); } catch (FileNotFoundException e) { this.richTextBox3.Text = "An error occured."; System.Diagnostics.Debug.WriteLine(e.Message); } return; }
public void btn_Save_Click(object sender, EventArgs e) { /* Write content to Gui (1), into data storage (2) and check if date is today to write it to another text box (3). */ IoDatastorage myModel = new IoDatastorage(); DateTime dateTime = new DateTime(); WriteContentIntoTextboxes(); /* 1 */ myModel.int_IoDatastorage_WriteDataToStorage(FormalizeContentToString(), Storage.s_PathTextfile); /* 2 */ if ((Storage.myLocalAlarm) && (0 != (DateTime.Compare(Storage.myLocalDate.Date, dateTime.Date)))) /* 3 */ { WriteContentIntoEmptyRichTextBox(); } return; }