Beispiel #1
0
 public static MiMFa_Table ConcatTable(MiMFa_Table mainDT, MiMFa_Table dt)
 {
     if (dt == null)
     {
         return(mainDT);
     }
     if (mainDT == null)
     {
         return(dt);
     }
     for (int i = 1; i < dt.MainTable.Rows.Count; i++)
     {
         mainDT.AddRowSafe();
         for (int j = 0; j < dt.MainTable.Columns.Count; j++)
         {
             mainDT.AddInLastRowCellSafe(dt.MainTable.Rows[i][j], dt.MainTable.Rows[0][j] + "");
         }
     }
     return(mainDT);
 }
Beispiel #2
0
        public static MiMFa_Table Transpose(MiMFa_Table dt, bool toRight = true)
        {
            MiMFa_Table mdt = new MiMFa_Table();

            if (toRight)
            {
                for (int i = 0; i < dt.MainTable.Rows.Count; i++)
                {
                    mdt.AddColumnSafe(i, dt.MainTable.Rows[i].ItemArray);
                }
            }
            else
            {
                for (int i = dt.MainTable.Rows.Count - 1; i >= 0; i--)
                {
                    mdt.AddColumnSafe(i, dt.MainTable.Rows[i].ItemArray.Reverse());
                }
            }
            return(mdt);
        }
Beispiel #3
0
        public static MiMFa_Table AddInTable(MiMFa_Table mainDT, object str, string colName, MiMFa_TableValuePositionType put)
        {
            switch (put)
            {
            case MiMFa_TableValuePositionType.NextRowCell:
                mainDT.AddRowSafe();
                if (string.IsNullOrWhiteSpace(colName))
                {
                    mainDT.AddInLastRowCellSafe(str);
                }
                else
                {
                    mainDT.AddInLastRowCellSafe(str, colName);
                }
                break;

            case MiMFa_TableValuePositionType.Null:
            case MiMFa_TableValuePositionType.NextColumnCell:
                if (string.IsNullOrWhiteSpace(colName))
                {
                    mainDT.AddInLastRowCellSafe(str);
                }
                else
                {
                    mainDT.AddInLastRowCellSafe(str, colName);
                }
                break;

            case MiMFa_TableValuePositionType.NextSubCell:
                if (string.IsNullOrWhiteSpace(colName))
                {
                    mainDT.AppendInLastRowCellSafe(str);
                }
                else
                {
                    mainDT.AppendInLastRowCellSafe(str, colName);
                }
                break;
            }
            return(mainDT);
        }
Beispiel #4
0
 public MiMFa_Table ConcatTable(MiMFa_Table dt)
 {
     return(ConcatTable(this, dt));
 }