장비목록 통합작업
This commit is contained in:
		| @@ -71,7 +71,7 @@ namespace FEQ0000 | ||||
|         { | ||||
|             List<string> datas = new List<string>(); | ||||
|             var charlist = line.ToCharArray(); | ||||
|            // int c = 0; | ||||
|             // int c = 0; | ||||
|             System.Text.StringBuilder sb = new StringBuilder(); | ||||
|             Boolean findCom = false; | ||||
|             foreach (var ch in charlist) | ||||
| @@ -102,13 +102,13 @@ namespace FEQ0000 | ||||
|         } | ||||
|         private void button1_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             if(textBox1.Text.isEmpty()) | ||||
|             if (textBox1.Text.isEmpty()) | ||||
|             { | ||||
|                 FCOMMON.Util.MsgE("파일을 선택하세요"); | ||||
|                 textBox1.Focus(); | ||||
|                 return; | ||||
|             } | ||||
|             if(!System.IO.File.Exists(textBox1.Text)) | ||||
|             if (!System.IO.File.Exists(textBox1.Text)) | ||||
|             { | ||||
|                 FCOMMON.Util.MsgE("입력하신 파일이 존재하지 않습니다."); | ||||
|                 textBox1.Focus(); | ||||
| @@ -119,14 +119,15 @@ namespace FEQ0000 | ||||
|             dtExcel.Columns.Clear(); | ||||
|             dtExcel.Rows.Clear(); | ||||
|             dtExcel.AcceptChanges(); | ||||
|              | ||||
|  | ||||
|             libxl.Book book;// = new libxl.BinBook(); | ||||
|             book = new libxl.XmlBook(); | ||||
|             book.setKey(FCOMMON.info.libxlCompany, FCOMMON.info.libxlKey); | ||||
|             try | ||||
|             { | ||||
|                 book.load(textBox1.Text); | ||||
|             }catch (Exception ex) | ||||
|             } | ||||
|             catch (Exception ex) | ||||
|             { | ||||
|                 FCOMMON.Util.MsgE(ex.Message); | ||||
|                 return; | ||||
| @@ -146,11 +147,12 @@ namespace FEQ0000 | ||||
|             var MinCol = sheet.firstCol(); | ||||
|             List<string> cols = new List<string>(); | ||||
|             bool firstRow = true; | ||||
|             try{ | ||||
|             try | ||||
|             { | ||||
|                 for (int r = MinRow; r <= MaxRow; r++) | ||||
|                 { | ||||
|                     DataRow dr = null; | ||||
|                     if (firstRow ==false) dr = dtExcel.NewRow(); | ||||
|                     if (firstRow == false) dr = dtExcel.NewRow(); | ||||
|  | ||||
|                     Boolean nullColumn = false; | ||||
|                     for (int c = MinCol; c <= MaxCol; c++) | ||||
| @@ -179,7 +181,7 @@ namespace FEQ0000 | ||||
|                 } | ||||
|                 dtExcel.AcceptChanges(); | ||||
|             } | ||||
|            catch(Exception ex) | ||||
|             catch (Exception ex) | ||||
|             { | ||||
|                 FCOMMON.Util.MsgE("불러오는 중 오류 발생\n" + ex.Message); | ||||
|             } | ||||
| @@ -190,7 +192,7 @@ namespace FEQ0000 | ||||
|             this.dataGridView1.DataSource = dtExcel; | ||||
|             this.bn.BindingSource = this.bs; | ||||
|  | ||||
|             if(this.bs.Count < 1) | ||||
|             if (this.bs.Count < 1) | ||||
|             { | ||||
|                 FCOMMON.Util.MsgE("입력된 자료가 없습니다.\n\n지정된 엑셀의 1번째 칸에 값이 없다면 입력되지 않습니다."); | ||||
|             } | ||||
| @@ -236,30 +238,28 @@ namespace FEQ0000 | ||||
|  | ||||
|         private void button3_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             if(dtExcel == null || dtExcel.Rows.Count < 1) | ||||
|             if (dtExcel == null || dtExcel.Rows.Count < 1) | ||||
|             { | ||||
|                 FCOMMON.Util.MsgE("등록 가능한 자료가 없습니다."); | ||||
|                 return; | ||||
|             } | ||||
|  | ||||
|  | ||||
|  | ||||
|             System.Text.StringBuilder sb = new StringBuilder(); | ||||
|             sb.AppendLine("다음 자료를 추가하시겠습니까?"); | ||||
|             sb.AppendLine(); | ||||
|             sb.AppendLine("등록일 : " + dateTimePicker1.Value.ToShortDateString()); | ||||
|             sb.AppendLine();             | ||||
|             sb.AppendLine(); | ||||
|             sb.AppendLine("'저장 완료' 메세지가 나올때 까지 기다려 주세요."); | ||||
|             sb.AppendLine(); | ||||
|             sb.AppendLine("실행 하려면 '예' 를 누르세요"); | ||||
|             var dlg = FCOMMON.Util.MsgQ(sb.ToString()); | ||||
|             if (dlg != System.Windows.Forms.DialogResult.Yes) return; | ||||
|  | ||||
|            | ||||
|  | ||||
|              | ||||
|  | ||||
|             //라인코드를 읽어서 값을 기록해준다. | ||||
|             var taLine = new  dsEQTableAdapters.LineCodeTableAdapter(); | ||||
|             var taLine = new dsEQTableAdapters.LineCodeTableAdapter(); | ||||
|             var lineTd = taLine.GetData(); | ||||
|             lineTd.AcceptChanges(); | ||||
|  | ||||
| @@ -300,17 +300,34 @@ namespace FEQ0000 | ||||
|             } | ||||
|  | ||||
|             //12,13 | ||||
|             var i = 0; | ||||
|             foreach (DataRow dr in dtExcel.Rows) | ||||
|             { | ||||
|                 this.progressBar1.Value += 1; | ||||
|                 i += 1; | ||||
|                 if (i % 1000 == 0) Application.DoEvents(); | ||||
|  | ||||
|                 var linecode = dr[12].ToString(); | ||||
|                 var linedesc = dr[13].ToString(); | ||||
|                 var lineT = string.Empty; | ||||
|                 var lineP = string.Empty; | ||||
|                 var grp2 = string.Empty; | ||||
|                 var rcsflag = dr[1].ToString(); | ||||
|                 //if (rcsflag != "M") continue; | ||||
|  | ||||
|                 if (linecode.StartsWith("AJ900T")) continue;    //해외장비 제거 | ||||
|                 if (linecode.StartsWith("AJ9000E")) continue;    //해외장비 제거 | ||||
|                 if (linecode.StartsWith("AJ9000S")) continue;    //해외장비 제거 | ||||
|  | ||||
|                 if (linecode.StartsWith("AF900T")) continue;    //해외장비 제거 | ||||
|                 if (linecode.StartsWith("AF9000E")) continue;    //해외장비 제거 | ||||
|                 if (linecode.StartsWith("AF9000S")) continue;    //해외장비 제거 | ||||
|  | ||||
|                 if (linecode.StartsWith("AS900T")) continue;    //해외장비 제거 | ||||
|                 if (linecode.StartsWith("AS9000E")) continue;    //해외장비 제거 | ||||
|                 if (linecode.StartsWith("AS9000S")) continue;    //해외장비 제거 | ||||
|  | ||||
|  | ||||
|                 //없는 라인코드는 추가 | ||||
|                 var lineDrows = lineTd.Select("code='" + linecode + "'"); | ||||
|                 if (lineDrows.Length == 0) | ||||
| @@ -343,6 +360,8 @@ namespace FEQ0000 | ||||
|                     var lineDr = lineDrows[0] as dsEQ.LineCodeRow; | ||||
|                     lineT = lineDr.team; | ||||
|                     lineP = lineDr.part; | ||||
|                     grp2 = lineDr.grp2; | ||||
|  | ||||
|                 } | ||||
|  | ||||
|                 //데이터추가 | ||||
| @@ -355,6 +374,7 @@ namespace FEQ0000 | ||||
|                 newdr["linecode"] = linecode; | ||||
|                 newdr["lineT"] = lineT; | ||||
|                 newdr["lineP"] = lineP; | ||||
|                 newdr["grp2"] = grp2; | ||||
|                 newdr["serial"] = dr[7].ToString(); | ||||
|                 newdr["manu"] = dr[9].ToString(); | ||||
|                 newdr["primary"] = true; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 chi
					chi