예제 #1
0
 public override void UpdateTable(string TName, params object[] list)
 {
     try
     {
         bs = new BindingSource();
         SixZAttri _sixZAttri = new SixZAttri();
         _sixZAttri = _DSixZAttri[TName];
         Type           myType     = typeof(SixZAttri);
         PropertyInfo[] myProperty = myType.GetProperties();
         string[]       strRow     = new string[myProperty.Length];
         for (int i = 0; i < list.Length; i++)
         {
             if (!list[i].Equals(-1))
             {
                 myProperty[i].SetValue(_sixZAttri, list[i]);
             }
         }
         for (int i = 0; i < myProperty.Length; i++)
         {
             strRow[i] = myProperty[i].GetValue(_sixZAttri).ToString();
         }
         _DSixZAttri[TName] = _sixZAttri;
         bs.DataSource      = _DSixZAttri.Values;
         xmlOperate.SetXMLRowValue(TName, strRow);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
 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);
 }
예제 #3
0
        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);
        }
예제 #4
0
        public override void UpdateTable(string TName, params object[] list)
        {
            bs = new BindingSource();
            SixZAttri _sixZAttri = new SixZAttri();

            _sixZAttri = _DSixZAttri[TName];
            Type myType = typeof(SixZAttri);

            PropertyInfo[] myProperty = myType.GetProperties();
            string[]       strRow     = new string[myProperty.Length];
            for (int i = 0; i < myProperty.Length; i++)
            {
                myProperty[i].SetValue(TName, list[i]);
                strRow[i] = list[i].ToString();
            }
            _DSixZAttri[TName] = _sixZAttri;
            bs.DataSource      = _DSixZAttri.Values;
            xmlOperate.SetXMLRowValue(TName, strRow);
        }
예제 #5
0
        public override FromTableClass GetTableInfo(string TName)
        {
            SixZAttri _sixZAttri = _DSixZAttri[TName];

            return(_sixZAttri);
        }