private void LoadPipeData() { if (dataset == null) { return; } if (Sr == null || Er == null) { return; } int spr = GetNumber(Sr), epr = GetNumber(Er); int spc = GetChar(Sr), epc = GetChar(Er); List <PipeSheetData> listsheet = new List <PipeSheetData>(); for (; spr <= epr; spr++) { PipeSheetData sheet = new PipeSheetData(); DataRow dr = dataset.Tables[0].Rows[spr - 2]; int j = spc; DataColumn dc = dataset.Tables[0].Columns[j++]; sheet.PipeName = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.RoadName = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.PipeCategory = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.InCode = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.OutCode = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; string tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) { sheet.In_UpEle = GetFloat(tmp); } dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) { sheet.In_BottomEle = GetFloat(tmp); } dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) { sheet.Out_UpEle = GetFloat(tmp); } dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) { sheet.Out_BottomEle = GetFloat(tmp); } dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) { sheet.In_R = GetFloat(tmp); } dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) { sheet.Out_R = GetFloat(tmp); } dc = dataset.Tables[0].Columns[j++]; sheet.ShapeType = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.ShapeData = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.Matrial = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) { sheet.Roughness = GetFloat(tmp); } dc = dataset.Tables[0].Columns[j++]; sheet.DataSource = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) { sheet.DataTime = Convert.ToDateTime(tmp); } dc = dataset.Tables[0].Columns[j++]; sheet.RecordDept = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) { sheet.RecordTime = Convert.ToDateTime(tmp); } dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) { sheet.DataFull = GetBool(tmp); } dc = dataset.Tables[0].Columns[j++]; sheet.LoseReson = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.Remark = dr[dc].ToString(); listsheet.Add(sheet); } SaverTodb(listsheet); }
private void LoadPipeData() { if (dataset == null) return; if (Sr == null || Er == null) return; int spr = GetNumber(Sr), epr = GetNumber(Er); int spc = GetChar(Sr), epc = GetChar(Er); List<PipeSheetData> listsheet = new List<PipeSheetData>(); for (; spr <= epr; spr++) { PipeSheetData sheet = new PipeSheetData(); DataRow dr = dataset.Tables[0].Rows[spr - 2]; int j = spc; DataColumn dc = dataset.Tables[0].Columns[j++]; sheet.PipeName = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.RoadName = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.PipeCategory = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.InCode = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.OutCode = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; string tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) sheet.In_UpEle = GetFloat(tmp); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) sheet.In_BottomEle = GetFloat(tmp); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) sheet.Out_UpEle = GetFloat(tmp); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) sheet.Out_BottomEle = GetFloat(tmp); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) sheet.In_R = GetFloat(tmp); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) sheet.Out_R = GetFloat(tmp); dc = dataset.Tables[0].Columns[j++]; sheet.ShapeType = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.ShapeData = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.Matrial = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) sheet.Roughness = GetFloat(tmp); dc = dataset.Tables[0].Columns[j++]; sheet.DataSource = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) sheet.DataTime = Convert.ToDateTime(tmp); dc = dataset.Tables[0].Columns[j++]; sheet.RecordDept = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) sheet.RecordTime = Convert.ToDateTime(tmp); dc = dataset.Tables[0].Columns[j++]; tmp = dr[dc].ToString(); if (tmp != null && tmp.Length > 0) sheet.DataFull = GetBool(tmp); dc = dataset.Tables[0].Columns[j++]; sheet.LoseReson = dr[dc].ToString(); dc = dataset.Tables[0].Columns[j++]; sheet.Remark = dr[dc].ToString(); listsheet.Add(sheet); } SaverTodb(listsheet); }