BExIS.IO.Transform.Input.DataReader.ReadRow C# (CSharp) Метод

ReadRow() публичный Метод

Read Row and convert each value into a variableValue and each row to a Datatuple
public ReadRow ( List row, int indexOfRow ) : DataTuple
row List List of values in one row
indexOfRow int Currently row index
Результат BExIS.Dlm.Entities.Data.DataTuple
        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;
        }