void ControllerMainStoreWindow_HtmlReportButtonClicked(object sender, ObjectEventArgs e) { string message = string.Empty; if (!ControllerXMLManager.TryConvertFromXMLAndResourcesToHTML((string)e.Data, "doc.xml", Challenge.Properties.Resources.bookstoreStyle, controllerBookStore, out message)) { ControlerMessager.ShowMessage(message); } }
void ControllerMainStoreWindow_SaveButtonClicked(object sender, ObjectEventArgs e) { string message; string path = (string)e.Data; if (!ControllerXMLManager.TrySerializeToXML(path, controllerBookStore, out message)) { ControlerMessager.ShowMessage(message); } }
void ControllerMainStoreWindow_OpenButtonClicked(object sender, ObjectEventArgs e) { string message; string path = (string)e.Data; if (!ControllerXMLManager.TryDeserializeFromXML(path, ref controllerBookStore, out message)) { ControlerMessager.ShowError(message); } else { ControllerMainStoreWindow.DGVStoreSource = controllerBookStore.StoreBooksBindingList; } }
void ControllerMainStoreWindow_AddButtonClicked(object sender, ObjectEventArgs e) { controllerBookStore.AddBook((Book)e.Data); }
void ControllerMainStoreWindow_DeleteButtonClicked(object sender, ObjectEventArgs e) { controllerBookStore.RemoveBookAt((int)e.Data); }
void ControllerMainStoreWindow_EditButtonClicked(object sender, ObjectEventArgs e) { ControllerMainStoreWindow.EditingBook = controllerBookStore.ReturnBookAt((int)e.Data); }
void ControllerMainStoreWindow_ErrorOccurred(object sender, ObjectEventArgs e) { ControlerMessager.ShowError((string)e.Data); }