public DataTuple ReadRow(List<string> row, int indexOfRow)
{
DataTuple dt = new DataTuple();
DataStructureManager dsm = new DataStructureManager();
string value = "";
// convert row to List<VariableValue>
for(int i=0;i< row.Count();i++ )
{
VariableIdentifier variableIdentifier = this.SubmitedVariableIdentifiers.ElementAt(i);
long variableId = 0;
if (variableIdentifier.id > 0)
variableId = this.SubmitedVariableIdentifiers.ElementAt(i).id;
else
variableId = getVariableUsage(variableIdentifier).Id;
// if variable from systemtype datatime
// maybee needs to convert into the default datetime culture format
if (this.StructuredDataStructure.Variables.Where(p => p.Id.Equals(variableId)).FirstOrDefault().DataAttribute.DataType.SystemType.Equals("DateTime"))
{
value = IOUtility.ConvertDateToCulture(row[i]);
}
else
{
if (this.StructuredDataStructure.Variables.Where(p => p.Id.Equals(variableId)).FirstOrDefault().DataAttribute.DataType.SystemType.Equals("Double")||
this.StructuredDataStructure.Variables.Where(p => p.Id.Equals(variableId)).FirstOrDefault().DataAttribute.DataType.SystemType.Equals("Decimal")||
this.StructuredDataStructure.Variables.Where(p => p.Id.Equals(variableId)).FirstOrDefault().DataAttribute.DataType.SystemType.Equals("Float"))
{
value = row[i];
if (Info.Decimal.Equals(DecimalCharacter.comma))
{
if(value.Contains(".")) value = value.Replace(".","");
if(value.Contains(",")) value = value.Replace(',', '.');
}
if (Info.Decimal.Equals(DecimalCharacter.point))
{
if (value.Contains(",")) value = value.Remove(',');
}
}
else
{
value = row[i];
}
}
dt.VariableValues.Add(DatasetManager.CreateVariableValue(value,"", DateTime.Now, DateTime.Now, new ObtainingMethod(), variableId, new List<ParameterValue>()));
}
return dt;
}