コード例 #1
0
        public static PageErrors getErrors(DBManager db, System.Web.UI.Control ctrl)
        {
            foreach (Control c in ctrl.Controls)
            {
                PageErrors errors;
                if (c.GetType() == typeof(PageError))
                {
                    PageError pe = (PageError)c;
                    if (pe.Name == null)
                    {
                        errors = pe.getErrors();
                        if (db != null)
                        {
                            errors.db = db;
                        }
                        return(errors);
                    }
                }

                errors = getErrors(db, c);
                if (errors != null)
                {
                    return(errors);
                }
            }
            return(null);
        }
コード例 #2
0
 public void writeError(HtmlTextWriter output, StringBuilder b, Control ctrl, PageErrors errors)
 {
     foreach (Control c in ctrl.Controls)
     {
         if (c.GetType() == typeof(PageError))
         {
             PageError pe = (PageError)c;
             if (pe.Name != null)
             {
                 if (errors.hasError(pe.Name))
                 {
                     ResourceManager rm = DBUtils.getResourceManager();
                     Error           er = errors.getError(pe.Name);
                     b.Append("\n - " + er.getPrompt(errors.db, rm));
                 }
             }
         }
         writeError(output, b, c, errors);
     }
 }