개정판 128c844f
dev issue #1240 : get drawing list
Change-Id: Ia856ca0ce242ee081dcc536296934b8ad2ead609
DTI_PID/APIDConverter/Form/APIDConverter.cs | ||
---|---|---|
102 | 102 |
|
103 | 103 |
if (dia.ShowDialog() == DialogResult.OK) |
104 | 104 |
{ |
105 |
DataTable drawingTable = Project_DB.SelectDrawingTable(); |
|
106 |
|
|
105 | 107 |
foreach (var fileName in dia.FileNames) |
106 | 108 |
{ |
107 | 109 |
Document document = new Document(fileName, ID2SymbolTypeTable); |
... | ... | |
110 | 112 |
if (rows.Length == 0) |
111 | 113 |
{ |
112 | 114 |
DataRow row = _ConverterDT.NewRow(); |
113 |
row["colDrawingFileName"] = Path.GetFileNameWithoutExtension(fileName); |
|
115 |
string drawingName = Path.GetFileNameWithoutExtension(fileName); |
|
116 |
row["colDrawingFileName"] = drawingName; |
|
114 | 117 |
row["colDrawingFilePath"] = fileName; |
115 | 118 |
if (document.Enable) |
116 | 119 |
row["colStatus"] = "Ready"; |
... | ... | |
118 | 121 |
row["colStatus"] = "Error"; |
119 | 122 |
row["colUID"] = ""; |
120 | 123 |
|
124 |
row["colDrawingNumber"] = drawingName; |
|
125 |
row["colSheetNumber"] = GetSheetNumber(drawingTable, drawingName); |
|
126 |
|
|
121 | 127 |
_ConverterDT.Rows.Add(row); |
122 | 128 |
|
123 | 129 |
if (document.Enable) |
... | ... | |
145 | 151 |
} |
146 | 152 |
} |
147 | 153 |
|
154 |
private string GetSheetNumber(DataTable drawingTable, string drawingName) |
|
155 |
{ |
|
156 |
string result = string.Empty; |
|
157 |
List<DataRow> rows = drawingTable.Select(string.Format("XDNLABEL = '{0}'", drawingName)).ToList(); |
|
158 |
if (rows.Count != 0) |
|
159 |
{ |
|
160 |
int index = 1; |
|
161 |
while (true) |
|
162 |
{ |
|
163 |
DataRow row = rows.Find(x => !DBNull.Value.Equals(x["XDSLABEL"]) && x["XDSLABEL"].ToString() == index.ToString()); |
|
164 |
if (row == null) |
|
165 |
{ |
|
166 |
result = index.ToString(); |
|
167 |
break; |
|
168 |
} |
|
169 |
} |
|
170 |
} |
|
171 |
return result; |
|
172 |
} |
|
173 |
|
|
148 | 174 |
private void APIDConverter_Load(object sender, EventArgs e) |
149 | 175 |
{ |
150 | 176 |
Project_Info project = Project_Info.GetInstance(); |
내보내기 Unified diff