protected void InitDetailContent() { try { UISyncContext = TaskScheduler.FromCurrentSynchronizationContext(); ErrorTip = new ErrorTip(); if (Backend == null) { Backend = new FISCA.Data.QueryHelper(); } } catch { } }
/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnSaveButtonClick(EventArgs e) { base.OnSaveButtonClick(e); ErrorTip.Clear(); Dictionary <Control, string> errors = new Dictionary <Control, string>(); try { RemoveErrorPanel(); OnValidateData(errors); } catch (Exception ex) { ShowErrorPanel(ex); return; } if (errors.Count > 0) { foreach (KeyValuePair <Control, string> error in errors) { ErrorTip.SetError(error.Key, error.Value); } return; } try { RemoveErrorPanel(); OnSaveData(); } catch (Exception ex) { ShowErrorPanel(ex); } }