예제 #1
0
        public void ResetIncludeFields(NoteTemplate template)
        {
            if (template == null)
            {
                _inclFields.Clear(); return;
            }

            _inclFields.Clear();
            if (template.TableColums >= 0)
            {
                PropertyInfo[] pInfos = template.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
                foreach (PropertyInfo pInfo in pInfos)
                {
                    if (pInfo.Name.StartsWith("ColumName"))
                    {
                        string colName = Convert.ToString(pInfo.GetValue(template, null));
                        if (string.IsNullOrEmpty(colName) == false)
                        {
                            string sRet = NoteInclude.GetNameByHeader(colName);
                            if (string.IsNullOrEmpty(sRet) == false)
                            {
                                _inclFields.Add(sRet);
                            }
                        }
                    }
                }
            }
        }