public void UpdateDTO(DataContent dc, String name, Object value) { Control textBox = (Control)comps[name]; try { dc.SetProperty(name, value); }catch (Exception exc) { SetControlText(textBox, ""); throw exc; } }
public void UpdateData(DataContent dc, String name, Object value) { Control textBox = (Control)comps[name]; try { dc.SetProperty(name, value); }catch (Exception exc) { if (textBox is TextBox) { textBox.Text = ""; textBox.Focus(); } throw exc; } }
public void UpdateData(DataContent dc, PropertyList includeList, PropertyList excludeList, PropertyList ignoreIfEmptyList) { ArrayList theList = includeList == null?new ArrayList(comps.Keys) : new ArrayList(includeList.KeySet()); foreach (String k in theList) { Control textBox = (Control)comps[k]; bool doExcludeThis = false; if (excludeList != null && excludeList.ContainsProperty(textBox.Name)) { doExcludeThis = true; } if (!doExcludeThis) { try { Object o = GetFieldValue(k); if (!doExcludeThis && o == null) { if (ignoreIfEmptyList != null && ignoreIfEmptyList.ContainsProperty(textBox.Name)) { doExcludeThis = true; } } if (!doExcludeThis) { dc.SetProperty(k, o); } }catch (Exception exc) { if (textBox is TextBox) { textBox.Text = ""; textBox.Focus(); } throw exc; } } } }