public string GetExcelCell(int columnIndex, int rowIndex)
{
if (columnIndex < 1 || rowIndex < 1)
throw new InvalidOperationException("incorrect number");
Range range = (Range)ws.Cells[rowIndex, columnIndex];
return (string)range.Value2;
}
public void GetExcelColumn(int startRowIndex, int rowNum, int columnIndex, string[] rowContextArray)
{
if (rowContextArray.Length != rowNum || rowNum < 1 || columnIndex < 1 || startRowIndex < 1)
throw new InvalidOperationException("incorrect number");
Range range = (Range)ws.get_Range(ws.Cells[startRowIndex, columnIndex], ws.Cells[startRowIndex + rowNum - 1, columnIndex]);
object[,] allItems = (object[,])range.Value2;
for (int i = 0; i < rowNum ; i++)
{
rowContextArray[i] = (string)allItems[i + 1, 1];
}
}
public void GetExcelRow(int startColumnIndex, int columnNum, int rowIndex, string[] columnContextArray)
{
if (columnContextArray.Length != columnNum || columnNum < 1 || rowIndex < 1 || startColumnIndex < 1)
throw new InvalidOperationException("incorrect number");
Range range = (Range)ws.get_Range(ws.Cells[rowIndex, startColumnIndex], ws.Cells[rowIndex, startColumnIndex + columnNum - 1]);
object[,] allItems = (object[,])range.Value2;
for (int i = 0; i < columnNum; i++)
{
columnContextArray[i] = (string)allItems[1, i + 1];
}
}
Requirement r = new Requirement();
r.delta = deltas[i];
string[] temp1 = new string[context.verificationColumnIndex];
ws.GetExcelRow(context.rsColumnIndex, temp1.Length, context.startRowNum + i, temp1);
string temp = temp1[context.rsColumnIndex - context.rsColumnIndex];
r.index = int.Parse(temp.Substring(temp.IndexOf("_R") + 2));
r.description = temp1[context.descColumnIndex - context.rsColumnIndex];
r.verification = temp1[context.verificationColumnIndex - context.rsColumnIndex];
r.informative = temp1[context.informativeColumnIndex - context.rsColumnIndex];