Example #1
0
        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;
            }
        }
Example #2
0
        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;
            }
        }
Example #3
0
        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;
                    }
                }
            }
        }