public object[] GetValue(string type) { int[] index = GetNameId(type); object[] obj = null; if (index.Length == 1) { FromTableClass fromTableClass = LTableModel[index[0]].GetTableInfo(type); if (fromTableClass is SixZAttri) { SixZAttri _sixZAttri = fromTableClass as SixZAttri; Type myType = typeof(SixZAttri); PropertyInfo[] myProperty = myType.GetProperties(); obj = new object[myProperty.Length]; for (int i = 0; i < myProperty.Length; i++) { obj[i] = myProperty[i].GetValue(_sixZAttri); } } } else { List <object> Lobj = new List <object>(); for (int j = 0; j < index.Length; j++) { FromTableClass fromTableClass = LTableModel[index[j]].GetTableInfo(type); if (fromTableClass is TwoXAttri) { TwoXAttri _sixZAttri = fromTableClass as TwoXAttri; Type myType = typeof(TwoXAttri); PropertyInfo[] myProperty = myType.GetProperties(); for (int i = 0; i < myProperty.Length; i++) { Lobj.Add(myProperty[i].GetValue(_sixZAttri)); } } else if (fromTableClass is YAttri) { YAttri _sixZAttri = fromTableClass as YAttri; Type myType = typeof(YAttri); PropertyInfo[] myProperty = myType.GetProperties(); for (int i = 0; i < myProperty.Length; i++) { Lobj.Add(myProperty[i].GetValue(_sixZAttri)); } } } obj = Lobj.ToArray(); } return(obj); }
public override void UpdateTable(string TName, FromTableClass TClass) { bs = new BindingSource(); SixZAttri _sixZAttri = TClass as SixZAttri; _DSixZAttri[TName] = _sixZAttri; bs.DataSource = _DSixZAttri.Values; Type myType = typeof(SixZAttri); PropertyInfo[] myProperty = myType.GetProperties(); string[] strRow = new string[myProperty.Length]; for (int i = 0; i < myProperty.Length; i++) { strRow[i] = myProperty[i].GetValue(_sixZAttri).ToString(); } xmlOperate.SetXMLRowValue(TName, strRow); }
public abstract void UpdateTable(string TName, FromTableClass TClass);