dock 관련, 제거
This commit is contained in:
1690
Epole.fp13/업로드폼/XLSoldtonew.Designer.vb
generated
Normal file
1690
Epole.fp13/업로드폼/XLSoldtonew.Designer.vb
generated
Normal file
File diff suppressed because it is too large
Load Diff
1595
Epole.fp13/업로드폼/XLSoldtonew.resx
Normal file
1595
Epole.fp13/업로드폼/XLSoldtonew.resx
Normal file
File diff suppressed because it is too large
Load Diff
728
Epole.fp13/업로드폼/XLSoldtonew.vb
Normal file
728
Epole.fp13/업로드폼/XLSoldtonew.vb
Normal file
@@ -0,0 +1,728 @@
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
|
||||
Public Class XLSOldtonew
|
||||
|
||||
Structure Str_Macro
|
||||
Dim FileName As String
|
||||
Dim Desc As String
|
||||
End Structure
|
||||
|
||||
' Dim FN As String = vbNullString
|
||||
' Dim Arin As New CommonClassv2.ARINCLASS
|
||||
|
||||
Dim Srcfile As String = "" '//원본파일 현재 불러온 이거나 이전에 불러왓던
|
||||
Dim findCnt As Integer = 0
|
||||
Dim ListOk As ArrayList
|
||||
Dim ListOld As ArrayList
|
||||
Dim ListOK4 As ArrayList
|
||||
Dim ListOld4 As ArrayList
|
||||
|
||||
|
||||
Dim MacroPattern As String = "oton"
|
||||
Dim IniFile As String = My.Application.Info.DirectoryPath & "\macro\" & MacroPattern & "\default.ini"
|
||||
Dim MacroPath As String = My.Application.Info.DirectoryPath & "\macro\" & MacroPattern
|
||||
Dim Macro() As Str_Macro
|
||||
|
||||
Private Sub Load_Macro()
|
||||
Dim Ini As MyINI2
|
||||
Dim DI As New DirectoryInfo(Me.MacroPath)
|
||||
If Not DI.Exists Then DI.Create()
|
||||
|
||||
Dim FI() As FileInfo = DI.GetFiles(Me.MacroPattern & "*.ini")
|
||||
ReDim Macro(FI.GetUpperBound(0)) '//매크로 등록한다.
|
||||
|
||||
Dim I As Integer = 0
|
||||
Me.cmb_macro.Items.Clear()
|
||||
Me.cmb_macro.Items.Add("이전설정")
|
||||
For Each F As FileInfo In FI
|
||||
Me.Macro(I).FileName = F.FullName
|
||||
Ini = New MyINI2(F.FullName)
|
||||
Me.Macro(I).Desc = Ini.Read("main", "desc", "기본설명")
|
||||
Me.cmb_macro.Items.Add(Me.Macro(I).Desc)
|
||||
I += 1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub AddNewList(ByVal Stext As String)
|
||||
'//list ok 에 신관리구를 집어넣는다.
|
||||
'//중복된다면 넣지않는다.
|
||||
If ListOk.IndexOf(Stext.ToUpper) >= 0 OrElse Stext.Length = 0 Then Return
|
||||
ListOk.Add(Stext.ToUpper)
|
||||
End Sub
|
||||
Private Sub AddoldList(ByVal Stext As String)
|
||||
'//list ok 에 신관리구를 집어넣는다.
|
||||
'//중복된다면 넣지않는다.
|
||||
If ListOld.IndexOf(Stext.ToUpper) >= 0 OrElse Stext.Length = 0 Then Return
|
||||
ListOld.Add(Stext.ToUpper)
|
||||
End Sub
|
||||
Private Sub AddNewList4(ByVal Satext As String)
|
||||
'//list ok 에 신관리구를 집어넣는다.
|
||||
'//중복된다면 넣지않는다.
|
||||
Dim Ntext As String = Satext
|
||||
If Satext.Length >= 4 Then Ntext = Satext.Substring(0, 4)
|
||||
If ListOK4.IndexOf(Ntext.ToUpper) >= 0 OrElse Ntext.Length = 0 Then Return
|
||||
ListOK4.Add(Ntext.ToUpper)
|
||||
|
||||
End Sub
|
||||
Private Sub AddoldList4(ByVal Satext As String)
|
||||
'//list ok 에 신관리구를 집어넣는다.
|
||||
'//중복된다면 넣지않는다.
|
||||
Dim Ntext As String = Satext
|
||||
If Satext.Length >= 4 Then Ntext = Satext.Substring(0, 4)
|
||||
If ListOld4.IndexOf(Ntext.ToUpper) >= 0 OrElse Ntext.Length = 0 Then Return
|
||||
ListOld4.Add(Ntext.ToUpper)
|
||||
End Sub
|
||||
Private Sub XLSImport_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
|
||||
' Me.ListView3.COLSIZE_SAVE()
|
||||
Me.Save_Setting()
|
||||
End Sub
|
||||
|
||||
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
||||
'Load_Setting()
|
||||
Load_Macro()
|
||||
Me.cmb_macro.SelectedIndex = 0
|
||||
|
||||
|
||||
Try
|
||||
Me.srcview.Font = New Font(ViewFont.FontName, ViewFont.FontSize, Me.Font.Style)
|
||||
' Me.viewnew.Font = New Font(ViewFont.FontName, ViewFont.FontSize, Me.Font.Style)
|
||||
|
||||
Me.ToolStrip1.Font = New Font(MenuFont.FontName, MenuFont.FontSize, Me.Font.Style) '//글자정보 불러오기
|
||||
Me.ToolStrip3.Font = New Font(MenuFont.FontName, MenuFont.FontSize, Me.Font.Style) '//글자정보 불러오기
|
||||
Me.ToolStrip2.Font = New Font(MenuFont.FontName, MenuFont.FontSize, Me.Font.Style) '//글자정보 불러오기
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Load_Setting(Optional ByVal Macroindex As Integer = 0)
|
||||
Dim ini As MyINI2
|
||||
If Macroindex = 0 Then
|
||||
ini = New MyINI2(IniFile)
|
||||
Else
|
||||
ini = New MyINI2(Me.Macro(Macroindex - 1).FileName)
|
||||
End If
|
||||
|
||||
If ini.Exist = False Then
|
||||
MsgBox("환경파일이 존재하지 않아서 기존의 설정을 불러오지 못했습니다", MsgBoxStyle.Critical, "확인")
|
||||
Return
|
||||
End If
|
||||
|
||||
Me.tb_srcstt.Text = ini.Read("normal", "srcstartpos", "1") '//시작
|
||||
Me.tb_srcend.Text = ini.Read("normal", "srcendpos", "0") '//종료
|
||||
|
||||
Me.Srcfile = ini.Read("normal", "srcfile", "")
|
||||
|
||||
For Each A As MyControlOLEDBv2.ImpCtl In Me.TableLayoutPanel3.Controls
|
||||
A.열번호 = ini.Read("CURSETNUMsrc", A.Name)
|
||||
A.문자열자르기 = ini.Read("CURSETSPLsrc", A.Name)
|
||||
A.빈값체크 = ini.Read("CURSETNULsrc", A.Name, False)
|
||||
Next
|
||||
|
||||
For Each A As MyControlOLEDBv2.ImpCtl In Me.TableLayoutPanel6.Controls
|
||||
A.열번호 = ini.Read("CURSETNUMdes", A.Name)
|
||||
A.문자열자르기 = ini.Read("CURSETSPLdes", A.Name)
|
||||
A.빈값체크 = ini.Read("CURSETNULdes", A.Name, False)
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Save_Setting(Optional ByVal Macroindex As Integer = 0) '//현재 셋팅을 저장합니다.
|
||||
'//저장목록은 시작/종료 열번호 아이템의 텍스트이다.
|
||||
|
||||
|
||||
Dim Macroname As String
|
||||
Dim ini As MyINI2
|
||||
Dim FileName As String
|
||||
If Macroindex = 0 Then
|
||||
ini = New MyINI2(IniFile)
|
||||
Macroname = "기본설정"
|
||||
FileName = IniFile
|
||||
WLog2(Auto_Log, "SaveSetting(기본:" & IniFile & ")", "\Macro.txt")
|
||||
ElseIf Macroindex = -999 Then '//이건 새로운 매크로의 추가다. 매크로 파일명을 새로지어야한다.
|
||||
Macroname = InputBox("매크로 설명을 입력하세요", "설명입력", "신규매크로")
|
||||
Dim i As Integer = 0
|
||||
Dim NewName As String = ""
|
||||
NewName:
|
||||
i += 1
|
||||
NewName = Me.MacroPath & "\" & Me.MacroPattern & Format(Me.Macro.GetUpperBound(0) + i + 1, "00") & ".ini"
|
||||
' MsgBox(MacroPath & "/" & MacroPattern & "/" & Format(Me.Macro.GetUpperBound(0) + i + 1) & "/" & NewName)
|
||||
WLog2(Auto_Log, "SaveSetting(신규:" & NewName & ")", "\Macro.txt")
|
||||
If File.Exists(NewName) Then GoTo NewName
|
||||
ini = New MyINI2(NewName)
|
||||
'WLog2(Auto_Log, "SaveSetting(" & NewName & ")", "\Macro.txt")
|
||||
FileName = NewName
|
||||
Else
|
||||
ini = New MyINI2(Me.Macro(Macroindex - 1).FileName)
|
||||
Macroname = Me.Macro(Macroindex - 1).Desc
|
||||
WLog2(Auto_Log, "SaveSetting(기존:" & Me.Macro(Macroindex - 1).FileName & ")", "\Macro.txt")
|
||||
FileName = Me.Macro(Macroindex - 1).FileName
|
||||
End If
|
||||
|
||||
WLog2(Auto_Log, "Ini FileName = " & ini.FileName, "\Macro.txt")
|
||||
ini.Write("main", "desc", Macroname)
|
||||
WLog2(Auto_Log, "Write_Main_Desc", "\Macro.txt")
|
||||
|
||||
ini.Write("normal", "srcstartpos", Me.tb_srcstt.Text) '//시작
|
||||
WLog2(Auto_Log, "Write_srcstartpos", "\Macro.txt")
|
||||
WLog2(Auto_Log, "Ini FileName = " & ini.FileName, "\Macro.txt")
|
||||
|
||||
ini.Write("normal", "srcendpos", Me.tb_srcend.Text) '//종료
|
||||
WLog2(Auto_Log, "Write_srcendpos", "\Macro.txt")
|
||||
WLog2(Auto_Log, "Ini FileName = " & ini.FileName, "\Macro.txt")
|
||||
|
||||
ini.Write("normal", "srcfile", Me.Srcfile)
|
||||
WLog2(Auto_Log, "Write_Control_position", "\Macro.txt")
|
||||
WLog2(Auto_Log, "Ini FileName = " & ini.FileName, "\Macro.txt")
|
||||
|
||||
For Each A As MyControlOLEDBv2.ImpCtl In Me.TableLayoutPanel3.Controls '//각 텍스트박스
|
||||
ini.Write("CURSETNUMsrc", A.Name, A.열번호)
|
||||
ini.Write("CURSETSPLsrc", A.Name, A.문자열자르기)
|
||||
ini.Write("CURSETNULsrc", A.Name, A.빈값체크)
|
||||
Next
|
||||
|
||||
WLog2(Auto_Log, "Write_panel3_position", "\Macro.txt")
|
||||
|
||||
For Each A As MyControlOLEDBv2.ImpCtl In Me.TableLayoutPanel6.Controls '//각 텍스트박스
|
||||
ini.Write("CURSETNUMdes", A.Name, A.열번호)
|
||||
ini.Write("CURSETSPLdes", A.Name, A.문자열자르기)
|
||||
ini.Write("CURSETNULdes", A.Name, A.빈값체크)
|
||||
Next
|
||||
WLog2(Auto_Log, "Write_panel6_position", "\Macro.txt")
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub SetNewText(ByVal sender As MyControlOLEDBv2.ImpCtl, ByVal RowNum As Integer, ByVal Stext As String)
|
||||
'//만약 날짜포맷이면 FORMAT 을 지정해서 사용한다"
|
||||
Dim SUbidx As Integer
|
||||
Dim VALSTR As String
|
||||
|
||||
If sender.열번호 = "" Then '/./열이 지정되어잇지 않으므로 그냥빠져나간다.
|
||||
Return
|
||||
Else '//있다.
|
||||
SUbidx = sender.열번호
|
||||
If Stext = "" Then
|
||||
' MsgBox("값이없어서 바로보낸다")
|
||||
Return '//데이터없으면 리턴
|
||||
End If
|
||||
If sender.문자열자르기 = "" OrElse sender.문자열자르기 = "0,0" Then '//문자열자르기확인 없다 그대로 리턴
|
||||
Me.srcview.ActiveSheet.Cells(RowNum, CInt(SUbidx - 1)).Text = Stext
|
||||
Else '//문자열자르기가 있으면 잘라서 보내준다.
|
||||
Dim DIV() As String = sender.문자열자르기.Split(",")
|
||||
If DIV(1) = "0" Then '//시작부터 끝까지
|
||||
Try
|
||||
VALSTR = (Stext.Substring(DIV(0) - 1))
|
||||
Catch ex As Exception
|
||||
VALSTR = Stext
|
||||
End Try
|
||||
Me.srcview.ActiveSheet.Cells(RowNum, CInt(SUbidx - 1)).Text = VALSTR
|
||||
|
||||
Else '/지정범위
|
||||
Try
|
||||
VALSTR = Stext.Substring(DIV(0) - 1, DIV(1))
|
||||
Catch ex As Exception
|
||||
VALSTR = Stext
|
||||
End Try
|
||||
Me.srcview.ActiveSheet.Cells(RowNum, CInt(SUbidx - 1)).Text = VALSTR
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function GetFPData(ByVal sender As MyControlOLEDBv2.ImpCtl, ByVal Drow As FarPoint.Win.Spread.Row, ByVal CustFp1 As FarPoint.Win.Spread.FpSpread) As String
|
||||
'//만약 날짜포맷이면 FORMAT 을 지정해서 사용한다"
|
||||
|
||||
Dim SUbidx As Integer
|
||||
Dim VALSTR As String
|
||||
|
||||
If sender.열번호 = "" Then '//즉 없다는뜻이다.
|
||||
Return ""
|
||||
Else '//있다.
|
||||
SUbidx = sender.열번호
|
||||
If CustFp1.ActiveSheet.Cells(Drow.Index, CInt(SUbidx - 1)).Text = "" Then
|
||||
' MsgBox("값이없어서 바로보낸다")
|
||||
Return "" '//데이터없으면 리턴
|
||||
End If
|
||||
If sender.문자열자르기 = "" OrElse sender.문자열자르기 = "0,0" Then '//문자열자르기확인 없다 그대로 리턴
|
||||
VALSTR = CustFp1.ActiveSheet.Cells(Drow.Index, CInt(SUbidx - 1)).Text
|
||||
Return VALSTR
|
||||
|
||||
Else '//문자열자르기가 있으면 잘라서 보내준다.
|
||||
Dim DIV() As String = sender.문자열자르기.Split(",")
|
||||
If DIV(1) = "0" Then '//시작부터 끝까지
|
||||
Try
|
||||
VALSTR = (CustFp1.ActiveSheet.Cells(Drow.Index, CInt(SUbidx - 1)).Text.Substring(DIV(0) - 1))
|
||||
Catch ex As Exception
|
||||
VALSTR = CustFp1.ActiveSheet.Cells(Drow.Index, CInt(SUbidx - 1)).Text
|
||||
End Try
|
||||
Return VALSTR
|
||||
|
||||
Else '/지정범위
|
||||
Try
|
||||
VALSTR = CustFp1.ActiveSheet.Cells(Drow.Index, CInt(SUbidx - 1)).Text.Substring(DIV(0) - 1, DIV(1))
|
||||
Catch ex As Exception
|
||||
VALSTR = CustFp1.ActiveSheet.Cells(Drow.Index, CInt(SUbidx - 1)).Text
|
||||
End Try
|
||||
Return VALSTR
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End Function
|
||||
Private Function GetFPData(ByVal sender As MyControlOLEDBv2.ImpCtl, ByVal Drow As Integer, ByVal CustFp1 As FarPoint.Win.Spread.FpSpread) As String
|
||||
'//만약 날짜포맷이면 FORMAT 을 지정해서 사용한다"
|
||||
|
||||
Dim SUbidx As Integer
|
||||
Dim VALSTR As String
|
||||
|
||||
If sender.열번호 = "" Then '//즉 없다는뜻이다.
|
||||
Return ""
|
||||
Else '//있다.
|
||||
SUbidx = sender.열번호
|
||||
If CustFp1.ActiveSheet.Cells(Drow, CInt(SUbidx - 1)).Text = "" Then
|
||||
' MsgBox("값이없어서 바로보낸다")
|
||||
Return "" '//데이터없으면 리턴
|
||||
End If
|
||||
If sender.문자열자르기 = "" OrElse sender.문자열자르기 = "0,0" Then '//문자열자르기확인 없다 그대로 리턴
|
||||
VALSTR = CustFp1.ActiveSheet.Cells(Drow, CInt(SUbidx - 1)).Text
|
||||
Return VALSTR
|
||||
|
||||
Else '//문자열자르기가 있으면 잘라서 보내준다.
|
||||
Dim DIV() As String = sender.문자열자르기.Split(",")
|
||||
If DIV(1) = "0" Then '//시작부터 끝까지
|
||||
Try
|
||||
VALSTR = (CustFp1.ActiveSheet.Cells(Drow, CInt(SUbidx - 1)).Text.Substring(DIV(0) - 1))
|
||||
Catch ex As Exception
|
||||
VALSTR = CustFp1.ActiveSheet.Cells(Drow, CInt(SUbidx - 1)).Text
|
||||
End Try
|
||||
Return VALSTR
|
||||
|
||||
Else '/지정범위
|
||||
Try
|
||||
VALSTR = CustFp1.ActiveSheet.Cells(Drow, CInt(SUbidx - 1)).Text.Substring(DIV(0) - 1, DIV(1))
|
||||
Catch ex As Exception
|
||||
VALSTR = CustFp1.ActiveSheet.Cells(Drow, CInt(SUbidx - 1)).Text
|
||||
End Try
|
||||
Return VALSTR
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End Function
|
||||
Private Function NullCHeck() As Boolean
|
||||
For Each C As Control In Me.TableLayoutPanel3.Controls
|
||||
If C.GetType.Name.ToUpper = "IMPCTL" Then
|
||||
If CType(C, MyControlOLEDBv2.ImpCtl).열번호 <> "" AndAlso CType(C, MyControlOLEDBv2.ImpCtl).빈값체크 Then '//체크된게잇으면 리턴한다.
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function GetMaxCount1(ByVal sp As Integer) As Integer
|
||||
Dim Strbuff As System.Text.StringBuilder
|
||||
Dim NullCnt As Short = 0
|
||||
Dim I As Integer = 0
|
||||
For I = sp To Me.srcview.ActiveSheet.RowCount
|
||||
Strbuff = New System.Text.StringBuilder
|
||||
Strbuff.Append(Me.srcview.ActiveSheet.Cells(I, 0).Text) ' Me.view1.ActiveSheet.Cells(Me.tb_sttrange.Text, CT.열번호.Substring(1)).Text)
|
||||
Strbuff.Append(Me.srcview.ActiveSheet.Cells(I, 1).Text) ' Me.view1.ActiveSheet.Cells(Me.tb_sttrange.Text, CT.열번호.Substring(1)).Text)
|
||||
Strbuff.Append(Me.srcview.ActiveSheet.Cells(I, 2).Text) ' Me.view1.ActiveSheet.Cells(Me.tb_sttrange.Text, CT.열번호.Substring(1)).Text)
|
||||
If Strbuff.ToString.Trim <> "" Then
|
||||
NullCnt = 0
|
||||
Else
|
||||
NullCnt += 1
|
||||
If NullCnt = 5 Then '//빈줄이나올때 널카운트를 증가시키고 빈줄이 5번연속나올때는 빠져나온다.
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return I - 4
|
||||
End Function
|
||||
|
||||
Private Sub showcnt(ByVal cnt1 As Integer, ByVal cnt2 As Integer)
|
||||
Me.lb_cnt.Text = cnt1 & "/" & cnt2
|
||||
My.Application.DoEvents()
|
||||
End Sub
|
||||
|
||||
Private Sub RunSrc() '//적용루틴 끝에 추가를 해주는것뿐이다 (기타번호찰)
|
||||
|
||||
Dim 조합1 As String '//조합는 notnull 이다
|
||||
Dim 조합2 As String '//조합는 notnull 이다
|
||||
Dim H1 As String = ""
|
||||
Dim H2 As String = ""
|
||||
Dim H3 As String = ""
|
||||
|
||||
Dim 검색문자 As String
|
||||
|
||||
Dim NullChk As Boolean = Me.NullCHeck '//이건 원본의 널체크
|
||||
Dim NullVal As String = ""
|
||||
|
||||
Dim cnt As Integer = -1
|
||||
|
||||
Dim StartCnt As Integer = CInt(Me.tb_srcstt.Text)
|
||||
Dim EndCnt As Integer = IIf(CInt(Me.tb_srcend.Text) = 0, GetMaxCount1(StartCnt), CInt(Me.tb_srcend.Text))
|
||||
|
||||
Dim index As Integer = 0
|
||||
For Each Dr As FarPoint.Win.Spread.Row In Me.srcview.ActiveSheet.Rows '//모든로우에해당하는데 시작줄부터한다
|
||||
If Dr.Index + 1 >= StartCnt AndAlso Dr.Index + 1 <= EndCnt Then '//시작인덱스 이상일경우에만 한다.
|
||||
|
||||
index += 1
|
||||
showcnt(index, EndCnt)
|
||||
Me.srcview.ActiveSheet.Cells(Dr.Index, Me.ImpCtl4.열번호 - 1).Text = ""
|
||||
NullVal = False
|
||||
Try
|
||||
조합1 = Me.GetFPData(Me.srcctl1, Dr, Me.srcview).ToUpper
|
||||
조합2 = Me.GetFPData(Me.srcctl2, Dr, Me.srcview).ToUpper
|
||||
|
||||
If NullChk Then '//널값 체크시에 체크된것이 null이라면 nullval 을 true로 바꾼다.
|
||||
NullVal = ""
|
||||
If Me.srcctl1.빈값체크 Then NullVal &= IIf(조합1.Trim = "", "", "X")
|
||||
If Me.srcctl2.빈값체크 Then NullVal &= IIf(조합2.Trim = "", "", "X")
|
||||
Else
|
||||
NullVal = "X" '//기본false로 해줘야한다.
|
||||
End If
|
||||
|
||||
If NullVal.Trim <> "" Then 'false일때만 추가한다. true는 널값이잇으므로 넘어간다.
|
||||
'//이제 이부분에서 대상파일의 내용을 전부 루프로 돈다.
|
||||
검색문자 = CStr(조합1 & 조합2).Trim
|
||||
If 검색문자 = "" Then
|
||||
Me.srcview.ActiveSheet.Cells(Dr.Index, Me.ImpCtl4.열번호 - 1).Text &= "[X] 검색할 문자가 없음"
|
||||
Else
|
||||
Me.srcview.ActiveSheet.Cells(Dr.Index, Me.ImpCtl4.열번호 - 1).Text &= "[O]"
|
||||
'//검색대상 문자가 잇으므로 여기서 각종 조합을 통해서 신전주번호를 산출한다.
|
||||
'//대상은 뒷자리 3자를 토대로 앞의 알파벳을 구하고 다구한후 뒤에서 4번째자리를 통해서 A~Z 까지를 산출한다.
|
||||
If 검색문자.Length <> 8 Then Me.srcview.ActiveSheet.Cells(Dr.Index, Me.ImpCtl4.열번호 - 1).Text &= "[X] 예상길이 8이 되지 않습니다"
|
||||
Me.Parser(검색문자, H1, H2, H3)
|
||||
|
||||
|
||||
'//분류가 완료되었다 이제 지정된 열로 보여준다.
|
||||
Me.SetNewText(Me.ImpCtl1, Dr.Index, CStr(H1 & H2 & H3))
|
||||
Me.SetNewText(Me.ImpCtl2, Dr.Index, CStr(H1 & H2 & H3))
|
||||
Me.SetNewText(Me.ImpCtl3, Dr.Index, CStr(H1 & H2 & H3))
|
||||
End If '
|
||||
End If
|
||||
|
||||
Catch ex As ConstraintException '//중복
|
||||
' AddLog("번호중복", "중복된 번호:" & 번호)
|
||||
Catch ex As Exception
|
||||
' AddLog(ex.InnerException.ToString, ex.Message.ToString)
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
If findCnt = 0 Then
|
||||
'MsgBox("일치하는 줄이 없습니다" & vbCrLf & vbCrLf & "로그내역을 통해서 상세내역을 확인할 수 있습니다", MsgBoxStyle.Critical, "확인")
|
||||
Else
|
||||
'MsgBox(findCnt & "개의 줄이 일치합니다" & vbCrLf & vbCrLf & "로그내역을 통해서 상세내역을 확인할 수 있습니다", MsgBoxStyle.Information, "확인")
|
||||
End If
|
||||
|
||||
Me.ListOld.Sort() '//변경된 모든 내역을 가진다. 여기서 중복된건 피하고 우측의 viewnew 에 보여준다.
|
||||
For Each Idx As String In Me.ListOld
|
||||
fxList.Rows.Count += 1
|
||||
fxList.SetData(fxList.Rows.Count - 1, 0, Idx)
|
||||
|
||||
'Me.viewnew.ActiveSheet.RowCount += 1 '//줄 증가
|
||||
' Me.viewnew.ActiveSheet.Cells(Me.viewnew.ActiveSheet.RowCount - 1, 0).Text = Idx '//변경전 관리구 4자
|
||||
Next
|
||||
|
||||
Dim Rownum As Integer = 0
|
||||
Me.ListOld4.Sort() '//변경된 모든 내역을 가진다. 여기서 중복된건 피하고 우측의 viewnew 에 보여준다.
|
||||
For Each Idx As String In Me.ListOld4
|
||||
|
||||
If (Rownum + 1) > Me.fxList.Rows.Count - 1 Then fxList.Rows.Count += 1
|
||||
fxList.SetData(Rownum + 1, 1, Idx)
|
||||
|
||||
' If Rownum > Me.viewnew.ActiveSheet.RowCount - 1 Then Me.viewnew.ActiveSheet.RowCount += 1 '//줄 증가
|
||||
' Me.viewnew.ActiveSheet.Cells(Rownum, 1).Text = Idx '//변경전 관리구 4자
|
||||
Next
|
||||
|
||||
Rownum = 0
|
||||
Me.ListOK4.Sort() '//변경된 모든 내역을 가진다. 여기서 중복된건 피하고 우측의 viewnew 에 보여준다.
|
||||
For Each Idx As String In Me.ListOK4
|
||||
|
||||
If (Rownum + 1) > Me.fxList.Rows.Count - 1 Then fxList.Rows.Count += 1
|
||||
fxList.SetData((Rownum + 1), 2, Idx)
|
||||
|
||||
|
||||
'If Rownum > Me.viewnew.ActiveSheet.RowCount - 1 Then Me.viewnew.ActiveSheet.RowCount += 1 '//줄 증가
|
||||
' Me.viewnew.ActiveSheet.Cells(Rownum, 2).Text = Idx '//변경후 관리구 4자
|
||||
Rownum += 1
|
||||
Next
|
||||
|
||||
Rownum = 0
|
||||
Me.ListOk.Sort() '//변경된 모든 내역을 가진다. 여기서 중복된건 피하고 우측의 viewnew 에 보여준다.
|
||||
For Each Idx As String In Me.ListOk
|
||||
|
||||
If (Rownum + 1) > Me.fxList.Rows.Count - 1 Then fxList.Rows.Count += 1
|
||||
fxList.SetData((Rownum + 1), 3, Idx)
|
||||
|
||||
|
||||
'If Rownum > Me.viewnew.ActiveSheet.RowCount - 1 Then Me.viewnew.ActiveSheet.RowCount += 1 '//줄 증가
|
||||
' Me.viewnew.ActiveSheet.Cells(Rownum, 3).Text = Idx '//변경후 관리구 5자
|
||||
Rownum += 1
|
||||
Next
|
||||
|
||||
fxList.AutoSizeCols()
|
||||
MsgBox("완료되었습니다", MsgBoxStyle.Information, "확인")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Parser(ByVal SearchText As String, ByRef h1 As String, ByRef h2 As String, ByRef h3 As String) '//대상파일
|
||||
'//검색문자로 들어온데이터를 가지고 판단한다.
|
||||
'//젤뒤에 3자리로 좌표를 게산하고 그 앞에 1자리를 통해서 알파벳을 결정한다.
|
||||
Dim First() As String = {"A", "B", "C", "D"}
|
||||
Dim Second() As String = {"E", "F", "G", "H"}
|
||||
Dim Third() As String = {"P", "Q", "R", "S"}
|
||||
Dim Forth() As String = {"W", "X", "Y", "Z"}
|
||||
Dim Offset As Integer = -1
|
||||
|
||||
' If SearchText.Length <> 8 Then Return
|
||||
|
||||
h3 = Microsoft.VisualBasic.Right(SearchText, 3)
|
||||
h1 = Microsoft.VisualBasic.Left(SearchText, 4)
|
||||
|
||||
Dim M0, M1, M2, M3 As String '//각각 4개의 문자를 잘라온다. 앞의 0번과 그 다음(엑스) 다음(와이)
|
||||
M0 = Microsoft.VisualBasic.Left(Microsoft.VisualBasic.Right(SearchText, 4), 1)
|
||||
M1 = Microsoft.VisualBasic.Left(Microsoft.VisualBasic.Right(SearchText, 3), 1)
|
||||
M2 = Microsoft.VisualBasic.Left(Microsoft.VisualBasic.Right(SearchText, 2), 1)
|
||||
M3 = Microsoft.VisualBasic.Left(Microsoft.VisualBasic.Right(SearchText, 1), 1)
|
||||
'//이제 오프셋만 구하면된다.offset=
|
||||
AddoldList(CStr(h1 & M0)) '//구목록에 집어넣는다.
|
||||
AddoldList4(CStr(h1 & M0)) '//구목록에 집어넣는다.
|
||||
|
||||
If IsNumeric(M0) = False Then '//이미신전산화일경우 그냥 빠져나간다.
|
||||
h2 = M0
|
||||
AddNewList(CStr(h1 & h2)) '//완료목록에 집어넣는다.
|
||||
AddNewList4(CStr(h1 & h2)) '//완료목록에 집어넣는다.
|
||||
Return
|
||||
End If
|
||||
|
||||
If (M1 >= 0 AndAlso M1 <= 4) AndAlso (M2 >= 5 AndAlso M2 <= 9) Then Offset = 1 '이건 오프셋1번이다
|
||||
If (M1 >= 0 AndAlso M1 <= 4) AndAlso (M2 >= 0 AndAlso M2 <= 4) Then Offset = 3 '이건 오프셋1번이다
|
||||
If (M1 >= 5 AndAlso M1 <= 9) AndAlso (M2 >= 5 AndAlso M2 <= 9) Then Offset = 2 '이건 오프셋1번이다
|
||||
If (M1 >= 5 AndAlso M1 <= 9) AndAlso (M2 >= 0 AndAlso M2 <= 4) Then Offset = 4 '이건 오프셋1번이다
|
||||
|
||||
If Offset = -1 Then
|
||||
MsgBox("해당 값의 오프셋을 찾을수없습니다", MsgBoxStyle.Critical, "확인")
|
||||
Return
|
||||
End If
|
||||
|
||||
Select Case M0
|
||||
Case 1
|
||||
h2 = First(Offset - 1)
|
||||
Case 2
|
||||
h2 = Second(Offset - 1)
|
||||
Case 3
|
||||
h2 = Third(Offset - 1)
|
||||
Case 4
|
||||
h2 = Forth(Offset - 1)
|
||||
Case Else
|
||||
MsgBox("4번째 문자는 1~4의 값이어야 합니다(" & M0 & ")", MsgBoxStyle.Critical, "확인")
|
||||
End Select
|
||||
|
||||
AddNewList(CStr(h1 & h2)) '//완료목록에 집어넣는다.
|
||||
AddNewList4(CStr(h1 & h2)) '//완료목록에 집어넣는다.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub srcview_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles srcview.DragEnter
|
||||
If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
|
||||
e.Effect = DragDropEffects.Copy
|
||||
ElseIf (e.Data.GetDataPresent(DataFormats.StringFormat)) Then
|
||||
' MsgBox("string")
|
||||
e.Effect = DragDropEffects.Copy
|
||||
ElseIf (e.Data.GetDataPresent(DataFormats.Text)) Then
|
||||
' MsgBox("text")
|
||||
e.Effect = DragDropEffects.Copy
|
||||
Else
|
||||
e.Effect = DragDropEffects.None
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RenameColumnname1()
|
||||
For i As Integer = 0 To Me.srcview.Sheets.Count - 1
|
||||
For Each CL As FarPoint.Win.Spread.Column In Me.srcview.Sheets(i).Columns
|
||||
Me.srcview.Sheets(i).Columns(CL.Index).Label = CL.Index + 1
|
||||
Next
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub srcview_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles srcview.DragDrop
|
||||
If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
|
||||
Dim STR() As String = CType(e.Data.GetData(DataFormats.FileDrop), String())
|
||||
If Me.srcview.IsExcelFile(STR(0)) = False Then
|
||||
MsgBox(STR(0) & vbCrLf & "엑셀파일이 아닙니다")
|
||||
Else
|
||||
If Me.srcview.OpenExcel(STR(0), FarPoint.Excel.ExcelOpenFlags.RowAndColumnHeaders) = False Then
|
||||
MsgBox(STR(0) & vbCrLf & "파일을 불러올수 없습니다")
|
||||
Else '//불러왓으니 열제목을 재설정한다.
|
||||
RenameColumnname1()
|
||||
End If
|
||||
End If
|
||||
ElseIf (e.Data.GetDataPresent(DataFormats.StringFormat)) Then
|
||||
Dim Fi As New System.IO.FileInfo(e.Data.GetData(DataFormats.StringFormat))
|
||||
If Me.srcview.IsExcelFile(Fi.FullName) = False Then
|
||||
MsgBox(Fi.FullName & vbCrLf & "엑셀파일이 아닙니다")
|
||||
Else
|
||||
If Me.srcview.OpenExcel(Fi.FullName, FarPoint.Excel.ExcelOpenFlags.RowAndColumnHeaders) = False Then
|
||||
MsgBox(Fi.FullName & vbCrLf & "파일을 불러올수 없습니다")
|
||||
End If
|
||||
End If
|
||||
ElseIf (e.Data.GetDataPresent(DataFormats.Text)) Then
|
||||
Dim STR() As String = CType(e.Data.GetData(DataFormats.Text), String())
|
||||
If Me.srcview.IsExcelFile(STR(0)) = False Then
|
||||
MsgBox(STR(0) & vbCrLf & "엑셀파일이 아닙니다")
|
||||
Else
|
||||
If Me.srcview.OpenExcel(STR(0), FarPoint.Excel.ExcelOpenFlags.RowAndColumnHeaders) = False Then
|
||||
MsgBox(STR(0) & vbCrLf & "파일을 불러올수 없습니다")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub bt_srcfile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_srcfile.Click
|
||||
Dim OD As New OpenFileDialog
|
||||
OD.FileName = Me.Srcfile
|
||||
OD.Filter = "MS Office Excel WorkSheet(*.xls)|*.xls"
|
||||
OD.FilterIndex = 1
|
||||
' OD.RestoreDirectory = True
|
||||
If OD.ShowDialog() = DialogResult.Cancel Then
|
||||
MsgBox("불러오기가 취소되었습니다", MsgBoxStyle.Critical, "확인")
|
||||
Else
|
||||
If Me.srcview.OpenExcel(OD.FileName, FarPoint.Excel.ExcelOpenFlags.RowAndColumnHeaders) = False Then
|
||||
MsgBox(OD.FileName & vbCrLf & "파일을 불러올수 없습니다", MsgBoxStyle.Critical, "원본파일 불러오기 오류")
|
||||
Else '//불러왓으니 열제목을 재설정한다.
|
||||
Me.Srcfile = OD.FileName
|
||||
RenameColumnname1()
|
||||
End If
|
||||
|
||||
'synclog.view1.OpenExcel(OD.FileName, FarPoint.Excel.ExcelOpenFlags.RowAndColumnHeaders) '//비포함목록을 저장
|
||||
'synclog.view2.OpenExcel(OD.FileName, FarPoint.Excel.ExcelOpenFlags.RowAndColumnHeaders) '//포함목록을 저장
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click
|
||||
If MsgBox("실행하시겠습니까?" & vbCrLf & vbCrLf & "완료될떄까지 취소할 수 없습니다", MsgBoxStyle.Information + MsgBoxStyle.OkCancel, "확인") <> MsgBoxResult.Ok Then
|
||||
MsgBox("실행이 취소되었습니다", MsgBoxStyle.Critical, "확인")
|
||||
Return
|
||||
End If
|
||||
|
||||
'//지정된 열의형식을 문자로 변경한다.
|
||||
Dim text_CellType As New FarPoint.Win.Spread.CellType.TextCellType
|
||||
|
||||
If ImpCtl1.열번호 <> "" Then srcview.ActiveSheet.Columns(CInt(ImpCtl1.열번호)).CellType = text_CellType
|
||||
If ImpCtl2.열번호 <> "" Then srcview.ActiveSheet.Columns(CInt(ImpCtl2.열번호)).CellType = text_CellType
|
||||
If ImpCtl3.열번호 <> "" Then srcview.ActiveSheet.Columns(CInt(ImpCtl3.열번호)).CellType = text_CellType
|
||||
If ImpCtl4.열번호 <> "" Then srcview.ActiveSheet.Columns(CInt(ImpCtl4.열번호)).CellType = text_CellType
|
||||
|
||||
|
||||
'If IsNumeric(ImpCtl1.열번호) Then srcview.ActiveSheet.Columns(ImpCtl1.열번호).CellType = text_CellType
|
||||
'If IsNumeric(ImpCtl2.열번호) Then srcview.ActiveSheet.Columns(ImpCtl2.열번호).CellType = text_CellType
|
||||
'If IsNumeric(ImpCtl3.열번호) Then srcview.ActiveSheet.Columns(ImpCtl3.열번호).CellType = text_CellType
|
||||
'If IsNumeric(ImpCtl4.열번호) Then srcview.ActiveSheet.Columns(ImpCtl4.열번호).CellType = text_CellType
|
||||
|
||||
|
||||
|
||||
findCnt = 0
|
||||
Me.ListOk = New ArrayList
|
||||
Me.ListOld = New ArrayList
|
||||
Me.ListOK4 = New ArrayList
|
||||
Me.ListOld4 = New ArrayList
|
||||
' Me.viewnew.ActiveSheet.RowCount = 0
|
||||
|
||||
Me.fxList.Rows.Count = 1
|
||||
|
||||
Me.RunSrc()
|
||||
End Sub
|
||||
|
||||
Private Sub bt_srcsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_srcsave.Click
|
||||
Dim a As New SaveFileDialog
|
||||
a.Filter = "엑셀 워크시트파일(*.XLS)|*.XLS"
|
||||
a.FilterIndex = 0
|
||||
a.Title = "[모든데이터내보내기] 저장할 엑셀 파일을 지정하세요"
|
||||
a.FileName = "바뀐파일.xls"
|
||||
If a.ShowDialog() <> DialogResult.Cancel Then
|
||||
Dim msg As New System.Text.StringBuilder
|
||||
Me.srcview.SaveExcel(a.FileName, FarPoint.Excel.ExcelSaveFlags.SaveAsViewed)
|
||||
msg.AppendLine("[시트보호]가 된파일은 열너비가 조정되지않습니다.")
|
||||
msg.AppendLine()
|
||||
msg.AppendLine()
|
||||
msg.AppendLine("[시트보호] 상태에서는 시트를 편집할 수 없습니다")
|
||||
msg.AppendLine()
|
||||
msg.AppendLine("[시트보호]를 해제하려면 해당파일을 엑셀에서 불러온후")
|
||||
msg.AppendLine("[도구]-[보호]-[시트보호해제]를 클릭하세요")
|
||||
MsgBox(msg.ToString, MsgBoxStyle.Information, "시트보호")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
|
||||
Dim a As New SaveFileDialog
|
||||
a.Filter = "엑셀 워크시트파일(*.XLS)|*.XLS"
|
||||
a.FilterIndex = 0
|
||||
a.Title = "[모든데이터내보내기] 저장할 엑셀 파일을 지정하세요"
|
||||
a.FileName = "생성된전산화번호.xls"
|
||||
If a.ShowDialog() <> DialogResult.Cancel Then
|
||||
Dim msg As New System.Text.StringBuilder
|
||||
fxList.SaveExcel(a.FileName, C1.Win.C1FlexGrid.FileFlags.IncludeFixedCells)
|
||||
MsgBox("파일이 저장되었습니다", MsgBoxStyle.Information, "확인")
|
||||
'Me.viewnew.SaveExcel(a.FileName, FarPoint.Excel.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders)
|
||||
'msg.AppendLine("[시트보호]가 된파일은 열너비가 조정되지않습니다.")
|
||||
'msg.AppendLine()
|
||||
'msg.AppendLine()
|
||||
'msg.AppendLine("[시트보호] 상태에서는 시트를 편집할 수 없습니다")
|
||||
'msg.AppendLine()
|
||||
'msg.AppendLine("[시트보호]를 해제하려면 해당파일을 엑셀에서 불러온후")
|
||||
'msg.AppendLine("[도구]-[보호]-[시트보호해제]를 클릭하세요")
|
||||
'MsgBox(msg.ToString, MsgBoxStyle.Information, "시트보호")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bt_macrosave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_macrosave.Click
|
||||
If Me.cmb_macro.SelectedIndex <= 0 Then
|
||||
MsgBox("저장될 매크로가 선택되지않았습니다", MsgBoxStyle.Information, "확인")
|
||||
Return
|
||||
End If
|
||||
Me.Save_Setting(Me.cmb_macro.SelectedIndex)
|
||||
MsgBox("매크로가 저장되었습니다", MsgBoxStyle.Information, "확인")
|
||||
Me.Load_Macro()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub bt_macrosavenew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_macrosavenew.Click
|
||||
Me.Save_Setting(-999)
|
||||
MsgBox("매크로가 저장되었습니다", MsgBoxStyle.Information, "확인")
|
||||
Me.Load_Macro()
|
||||
End Sub
|
||||
|
||||
Private Sub cmb_macro_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmb_macro.SelectedIndexChanged
|
||||
Load_Setting(Me.cmb_macro.SelectedIndex)
|
||||
End Sub
|
||||
|
||||
Private Sub bt_macrodel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_macrodel.Click
|
||||
If Me.cmb_macro.SelectedIndex <= 0 Then
|
||||
MsgBox("삭제될 매크로가 선택되지않았습니다", MsgBoxStyle.Information, "확인")
|
||||
Return
|
||||
End If
|
||||
File.Delete(Me.Macro(Me.cmb_macro.SelectedIndex - 1).FileName)
|
||||
MsgBox("매크로가 삭제되었습니다", MsgBoxStyle.Information, "확인")
|
||||
Me.Load_Macro()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user