솔루션에 fp5,fp13 포함
This commit is contained in:
1732
Epole.fp5/업로드폼/XLSImport.Designer.vb
generated
Normal file
1732
Epole.fp5/업로드폼/XLSImport.Designer.vb
generated
Normal file
File diff suppressed because it is too large
Load Diff
1598
Epole.fp5/업로드폼/XLSImport.resx
Normal file
1598
Epole.fp5/업로드폼/XLSImport.resx
Normal file
File diff suppressed because it is too large
Load Diff
2545
Epole.fp5/업로드폼/XLSImport.vb
Normal file
2545
Epole.fp5/업로드폼/XLSImport.vb
Normal file
File diff suppressed because it is too large
Load Diff
1355
Epole.fp5/업로드폼/XLSsync.Designer.vb
generated
Normal file
1355
Epole.fp5/업로드폼/XLSsync.Designer.vb
generated
Normal file
File diff suppressed because it is too large
Load Diff
1598
Epole.fp5/업로드폼/XLSsync.resx
Normal file
1598
Epole.fp5/업로드폼/XLSsync.resx
Normal file
File diff suppressed because it is too large
Load Diff
786
Epole.fp5/업로드폼/XLSsync.vb
Normal file
786
Epole.fp5/업로드폼/XLSsync.vb
Normal file
@@ -0,0 +1,786 @@
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
|
||||
Public Class XLSSync
|
||||
' Dim FN As String = vbNullString
|
||||
|
||||
Structure Str_Macro
|
||||
Dim FileName As String
|
||||
Dim Desc As String
|
||||
End Structure
|
||||
|
||||
Dim Srcfile As String = "" '//원본파일 현재 불러온 이거나 이전에 불러왓던
|
||||
Dim DesFile As String = ""
|
||||
Dim findCnt As Integer = 0
|
||||
Dim ListOk As ArrayList
|
||||
Dim ListDel As ArrayList
|
||||
|
||||
Dim MacroPattern As String = "xlssync"
|
||||
Dim IniFile As String = My.Application.Info.DirectoryPath & "\macro\" & MacroPattern & "\default.ini"
|
||||
Dim MacroPath As String = My.Application.Info.DirectoryPath & "\macro\" & MacroPattern
|
||||
|
||||
Dim Log1, log2 As ArrayList
|
||||
|
||||
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 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_Macro()
|
||||
Me.cmb_macro.SelectedIndex = 0
|
||||
Try
|
||||
Me.srcview.Font = New Font(ViewFont.FontName, ViewFont.FontSize, Me.Font.Style)
|
||||
Me.desview.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.ToolStrip4.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.tb_desstt.Text = ini.Read("normal", "destartpos", "1") '//시작
|
||||
Me.tb_desend.Text = ini.Read("normal", "desendpos", "0") '//종료
|
||||
|
||||
Me.Srcfile = ini.Read("normal", "srcfile", "")
|
||||
Me.DesFile = ini.Read("normal", "desfile", "")
|
||||
|
||||
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
|
||||
|
||||
For Each A As Control In Me.TableLayoutPanel7.Controls
|
||||
If A.GetType.Name.ToUpper = "IMPCTL" Then
|
||||
CType(A, MyControlOLEDBv2.ImpCtl).열번호 = ini.Read("CURSETNUMin", A.Name)
|
||||
CType(A, MyControlOLEDBv2.ImpCtl).문자열자르기 = ini.Read("CURSETSPLin", A.Name)
|
||||
CType(A, MyControlOLEDBv2.ImpCtl).빈값체크 = ini.Read("CURSETNULin", A.Name, False)
|
||||
ElseIf A.GetType.Name.ToUpper = "TEXTBOX" Then
|
||||
A.Text = ini.Read("CURSETNUMout", A.Name)
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Save_Setting(Optional ByVal Macroindex As Integer = 0) '//현재 셋팅을 저장합니다.
|
||||
'//저장목록은 시작/종료 열번호 아이템의 텍스트이다.
|
||||
Dim Macroname As String
|
||||
Dim ini As MyINI2
|
||||
If Macroindex = 0 Then
|
||||
ini = New MyINI2(IniFile)
|
||||
Macroname = "기본설정"
|
||||
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"
|
||||
If New FileInfo(NewName).Exists Then GoTo NewName
|
||||
ini = New MyINI2(NewName)
|
||||
Else
|
||||
ini = New MyINI2(Me.Macro(Macroindex - 1).FileName)
|
||||
Macroname = Me.Macro(Macroindex - 1).Desc
|
||||
End If
|
||||
ini.Write("main", "desc", Macroname)
|
||||
|
||||
ini.Write("normal", "srcstartpos", Me.tb_srcstt.Text) '//시작
|
||||
ini.Write("normal", "srcendpos", Me.tb_srcend.Text) '//종료
|
||||
ini.Write("normal", "destartpos", Me.tb_desstt.Text) '//시작
|
||||
ini.Write("normal", "desendpos", Me.tb_desend.Text) '//종료
|
||||
|
||||
ini.Write("normal", "srcfile", Me.Srcfile)
|
||||
ini.Write("normal", "desfile", Me.DesFile)
|
||||
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
|
||||
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
|
||||
|
||||
For Each A As Control In Me.TableLayoutPanel7.Controls
|
||||
If A.GetType.Name.ToUpper = "IMPCTL" Then
|
||||
ini.Write("CURSETNUMin", CType(A, MyControlOLEDBv2.ImpCtl).Name, CType(A, MyControlOLEDBv2.ImpCtl).열번호)
|
||||
ini.Write("CURSETSPLin", CType(A, MyControlOLEDBv2.ImpCtl).Name, CType(A, MyControlOLEDBv2.ImpCtl).문자열자르기)
|
||||
ini.Write("CURSETNULin", CType(A, MyControlOLEDBv2.ImpCtl).Name, CType(A, MyControlOLEDBv2.ImpCtl).빈값체크)
|
||||
ElseIf A.GetType.Name.ToUpper = "TEXTBOX" Then
|
||||
ini.Write("CURSETNUMout", A.Name, A.Text)
|
||||
End If
|
||||
Next
|
||||
|
||||
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 NullCHeck1() 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 NullCHeck2() As Boolean
|
||||
For Each C As Control In Me.TableLayoutPanel6.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 Sub vcount(ByVal number As String, ByVal lastnum As String)
|
||||
Me.lb_cnt.Text = number & "/" & lastnum
|
||||
My.Application.DoEvents()
|
||||
End Sub
|
||||
Private Sub RunSrc() '//적용루틴 끝에 추가를 해주는것뿐이다 (기타번호찰)
|
||||
|
||||
Dim 조합1 As String '//조합는 notnull 이다
|
||||
Dim 조합2 As String '//조합는 notnull 이다
|
||||
Dim 조합3 As String '//조합는 notnull 이다
|
||||
Dim 조합4 As String '//조합는 notnull 이다
|
||||
Dim 조합5 As String '//조합는 notnull 이다
|
||||
Dim 조합6 As String '//조합는 notnull 이다
|
||||
Dim 조합7 As String '//조합는 notnull 이다
|
||||
|
||||
Dim 검색문자 As String
|
||||
|
||||
Dim NullChk As Boolean = Me.NullCHeck1 '//이건 원본의 널체크
|
||||
Dim NullVal As String = ""
|
||||
|
||||
Dim cnt As Integer = -1
|
||||
|
||||
Addlog("=====불일치목록=====", True)
|
||||
Addlog2("=====일치목록=====", True)
|
||||
|
||||
Dim StartCnt As Integer = CInt(Me.tb_srcstt.Text)
|
||||
Dim EndCnt As Integer = IIf(CInt(Me.tb_srcend.Text) = 0, Me.srcview.ActiveSheet.RowCount - 1, CInt(Me.tb_srcend.Text))
|
||||
|
||||
For Each Dr As FarPoint.Win.Spread.Row In Me.srcview.ActiveSheet.Rows '//모든로우에해당하는데 시작줄부터한다
|
||||
If Dr.Index + 1 >= StartCnt AndAlso Dr.Index + 1 <= EndCnt Then '//시작인덱스 이상일경우에만 한다.
|
||||
vcount(Dr.Index + 1, EndCnt)
|
||||
NullVal = False
|
||||
Try
|
||||
조합1 = Me.GetFPData(Me.srcctl1, Dr, Me.srcview).ToUpper
|
||||
조합2 = Me.GetFPData(Me.srcctl2, Dr, Me.srcview).ToUpper
|
||||
조합3 = Me.GetFPData(Me.srcctl3, Dr, Me.srcview).ToUpper
|
||||
조합4 = Me.GetFPData(Me.srcctl4, Dr, Me.srcview).ToUpper
|
||||
조합5 = Me.GetFPData(Me.srcctl5, Dr, Me.srcview).ToUpper
|
||||
조합6 = Me.GetFPData(Me.srcctl6, Dr, Me.srcview).ToUpper
|
||||
조합7 = Me.GetFPData(Me.srcctl7, 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")
|
||||
If Me.srcctl3.빈값체크 Then NullVal &= IIf(조합3.Trim = "", "", "X")
|
||||
If Me.srcctl4.빈값체크 Then NullVal &= IIf(조합4.Trim = "", "", "X")
|
||||
If Me.srcctl5.빈값체크 Then NullVal &= IIf(조합5.Trim = "", "", "X")
|
||||
If Me.srcctl6.빈값체크 Then NullVal &= IIf(조합6.Trim = "", "", "X")
|
||||
If Me.srcctl7.빈값체크 Then NullVal &= IIf(조합7.Trim = "", "", "X")
|
||||
Else
|
||||
NullVal = "X" '//기본false로 해줘야한다.
|
||||
End If
|
||||
|
||||
If NullVal.Trim <> "" Then 'false일때만 추가한다. true는 널값이잇으므로 넘어간다.
|
||||
'//이제 이부분에서 대상파일의 내용을 전부 루프로 돈다.
|
||||
검색문자 = CStr(조합1 & 조합2 & 조합3 & 조합4 & 조합5 & 조합6 & 조합7).Trim
|
||||
If 검색문자 = "" Then
|
||||
Addlog("[X] 검색할 문자가 없습니다 줄번호=" & Dr.Index + 1)
|
||||
Else
|
||||
Me.RunDesc(검색문자, Dr.Index)
|
||||
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
|
||||
Addlog("[완료] " & Me.ListDel.Count & "개의 줄이 일치하지 않았습니다")
|
||||
Addlog2("[완료] " & Me.ListOk.Count & "개의 줄이 일치합니다")
|
||||
If findCnt = 0 Then
|
||||
MsgBox("일치하는 줄이 없습니다" & vbCrLf & vbCrLf & "로그내역을 통해서 상세내역을 확인할 수 있습니다", MsgBoxStyle.Critical, "확인")
|
||||
Else
|
||||
MsgBox(findCnt & "개의 줄이 일치합니다" & vbCrLf & vbCrLf & "로그내역을 통해서 상세내역을 확인할 수 있습니다", MsgBoxStyle.Information, "확인")
|
||||
End If
|
||||
|
||||
synclog.Show()
|
||||
'//arrylist 의 목록으 가지고 뒤에서 부터 지운다.
|
||||
Me.ListDel.Sort()
|
||||
'Me.ListDel.Reverse()
|
||||
For Each Idx As Integer In Me.ListDel
|
||||
synclog.view1.ActiveSheet.RowCount += 1 '//줄 증가
|
||||
For ci As Integer = 0 To Me.srcview.ActiveSheet.ColumnCount - 1
|
||||
synclog.view1.ActiveSheet.Cells(synclog.view1.ActiveSheet.RowCount - 1, ci).Text = Me.srcview.ActiveSheet.Cells(Idx, ci).Text
|
||||
Next
|
||||
Next
|
||||
|
||||
Me.ListOk.Sort()
|
||||
'Me.ListOk.Reverse()
|
||||
For Each Idx As Integer In Me.ListOk
|
||||
synclog.view2.ActiveSheet.RowCount += 1 '//줄 증가
|
||||
For ci As Integer = 0 To Me.srcview.ActiveSheet.ColumnCount - 1
|
||||
synclog.view2.ActiveSheet.Cells(synclog.view2.ActiveSheet.RowCount - 1, ci).Text = Me.srcview.ActiveSheet.Cells(Idx, ci).Text
|
||||
Next
|
||||
Next
|
||||
|
||||
'synclog.view1.SaveExcel("c:\비포함목록.xls", FarPoint.Excel.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders)
|
||||
'synclog.view2.SaveExcel("c:\포함목록.xls", FarPoint.Excel.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders)
|
||||
End Sub
|
||||
|
||||
Private Sub RunDesc(ByVal SearchText As String, ByVal Srcrownum As Integer) '//대상파일
|
||||
'//매개변수로 검색해야할 텍스트를 가진다.
|
||||
'//일치하는 항목을 찾앗을경우에 지정된 열에 데이터를 복사한다.
|
||||
'//찾은후다음줄 참조의 의미는 chk_allcheck 버튼의 체크상태에따른다. 이 셋팅이 설정되어잇으면 검색은 엄청느려질 것이다.
|
||||
|
||||
Dim 조합1 As String '//조합는 notnull 이다
|
||||
Dim 조합2 As String '//조합는 notnull 이다
|
||||
Dim 조합3 As String '//조합는 notnull 이다
|
||||
Dim 조합4 As String '//조합는 notnull 이다
|
||||
Dim 조합5 As String '//조합는 notnull 이다
|
||||
Dim 조합6 As String '//조합는 notnull 이다
|
||||
Dim 조합7 As String '//조합는 notnull 이다
|
||||
|
||||
Dim NullChk As Boolean = Me.NullCHeck2 '//이건 대상의 널체크
|
||||
Dim NullVal As String = ""
|
||||
|
||||
Dim cnt As Integer = -1
|
||||
Dim Find As Boolean = False
|
||||
|
||||
' Addlog("대상목록 확인")
|
||||
Dim StartCnt As Integer = CInt(Me.tb_desstt.Text)
|
||||
Dim EndCnt As Integer = IIf(CInt(Me.tb_desend.Text) = 0, Me.desview.ActiveSheet.RowCount - 1, CInt(Me.tb_desend.Text))
|
||||
|
||||
For Each Dr As FarPoint.Win.Spread.Row In Me.desview.ActiveSheet.Rows '//모든로우에해당하는데 시작줄부터한다
|
||||
If Dr.Index + 1 >= StartCnt AndAlso Dr.Index + 1 <= EndCnt Then '//시작인덱스 이상일경우에만 한다.
|
||||
NullVal = False
|
||||
Try
|
||||
조합1 = Me.GetFPData(Me.desctl1, Dr, Me.desview).ToUpper
|
||||
조합2 = Me.GetFPData(Me.desctl2, Dr, Me.desview).ToUpper
|
||||
조합3 = Me.GetFPData(Me.desctl3, Dr, Me.desview).ToUpper
|
||||
조합4 = Me.GetFPData(Me.desctl4, Dr, Me.desview).ToUpper
|
||||
조합5 = Me.GetFPData(Me.desctl5, Dr, Me.desview).ToUpper
|
||||
조합6 = Me.GetFPData(Me.desctl6, Dr, Me.desview).ToUpper
|
||||
조합7 = Me.GetFPData(Me.desctl7, Dr, Me.desview).ToUpper
|
||||
|
||||
If NullChk Then '//널값 체크시에 체크된것이 null이라면 nullval 을 true로 바꾼다.
|
||||
NullVal = ""
|
||||
If Me.desctl1.빈값체크 Then NullVal &= IIf(조합1.Trim = "", "", "X")
|
||||
If Me.desctl2.빈값체크 Then NullVal &= IIf(조합2.Trim = "", "", "X")
|
||||
If Me.desctl3.빈값체크 Then NullVal &= IIf(조합3.Trim = "", "", "X")
|
||||
If Me.desctl4.빈값체크 Then NullVal &= IIf(조합4.Trim = "", "", "X")
|
||||
If Me.desctl5.빈값체크 Then NullVal &= IIf(조합5.Trim = "", "", "X")
|
||||
If Me.desctl6.빈값체크 Then NullVal &= IIf(조합6.Trim = "", "", "X")
|
||||
If Me.desctl7.빈값체크 Then NullVal &= IIf(조합7.Trim = "", "", "X")
|
||||
Else
|
||||
NullVal = "X" '//기본false로 해줘야한다.
|
||||
End If
|
||||
|
||||
If NullVal.Trim <> "" AndAlso SearchText.Trim.ToUpper = CStr(조합1 & 조합2 & 조합3 & 조합4 & 조합5 & 조합6 & 조합7).ToUpper Then 'false일때만 추가한다. true는 널값이잇으므로 넘어간다.
|
||||
'//대상파일에서 같은 줄을 찾았다. 그러면 이제 열값 복사해오는 부분을 참조해서 해당 원본열에 복사를 해준다.
|
||||
'//알아야할것은 현재 원본의 줄 번호 대상의 줄번호
|
||||
'//원본줄번호는 srcrownum 에 있으며 이것은 srcview 의 줄번호이다.
|
||||
'//대상줄번호는 현재 dr.index 의 내용을 참조하면된다.
|
||||
findCnt += 1 '//성공횟수를 저장한다.
|
||||
Find = True
|
||||
If Me.chk_test.Checked Then
|
||||
Addlog2("*모의실행 [O] " & SearchText & " 원본줄번호:" & Srcrownum + 1 & " 대상줄번호:" & Dr.Index + 1)
|
||||
Else
|
||||
Addlog2("[O] " & SearchText & " 원본줄번호:" & Srcrownum + 1 & " 대상줄번호:" & Dr.Index + 1)
|
||||
Apply_Column(Srcrownum, Dr.Index)
|
||||
End If
|
||||
If Not Me.chk_allcheck.Checked Then Exit For '//다음줄은 확인안한다.
|
||||
End If
|
||||
Catch ex As ConstraintException '//중복
|
||||
' AddLog("번호중복", "중복된 번호:" & 번호)
|
||||
Catch ex As Exception
|
||||
' AddLog(ex.InnerException.ToString, ex.Message.ToString)
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
|
||||
'//완료되었을때 찾았다면 addlog2 에하고 그렇지않으면 addlog 에 한다.
|
||||
If Find = False Then '//못찾앗으므로 포함목록은 지우고 비포함목록은 둔다
|
||||
Addlog("[X] " & SearchText & " 원본줄번호:" & Srcrownum + 1)
|
||||
'synclog.view2.ActiveSheet.Rows(Srcrownum).Remove()
|
||||
Me.ListDel.Add(Srcrownum)
|
||||
Else '//그 반대다
|
||||
Me.ListOk.Add(Srcrownum)
|
||||
'synclog.view1.ActiveSheet.Rows(Srcrownum).Remove()
|
||||
End If
|
||||
'Addlog("대상목록 확인완료")
|
||||
End Sub
|
||||
|
||||
Private Sub Apply_Column(ByVal srcnum As Integer, ByVal desnum As Integer)
|
||||
'//실제 데이터를 적용한다. 원본과 대상의 줄번호는 가지고있다.
|
||||
'//매칭시키는 열은 8개가 있으며 각각 in1~8 또는 out1~8 이다. in에는 자르기등의 옵션이 가능하다.
|
||||
'//각 8개의 열은 서로 대치됩니다.
|
||||
Dim 시공년월 As String '//조합는 notnull 이다
|
||||
Dim 조합2 As String '//조합는 notnull 이다
|
||||
Dim 조합3 As String '//조합는 notnull 이다
|
||||
Dim 조합4 As String '//조합는 notnull 이다
|
||||
Dim 조합5 As String '//조합는 notnull 이다
|
||||
Dim 조합6 As String '//조합는 notnull 이다
|
||||
Dim 조합7 As String '//조합는 notnull 이다
|
||||
Dim 조합8 As String
|
||||
|
||||
시공년월 = Me.GetFPData(Me.in1, desnum, Me.desview).ToUpper
|
||||
조합2 = Me.GetFPData(Me.in2, desnum, Me.desview).ToUpper
|
||||
조합3 = Me.GetFPData(Me.in3, desnum, Me.desview).ToUpper
|
||||
조합4 = Me.GetFPData(Me.in4, desnum, Me.desview).ToUpper
|
||||
조합5 = Me.GetFPData(Me.in5, desnum, Me.desview).ToUpper
|
||||
조합6 = Me.GetFPData(Me.in6, desnum, Me.desview).ToUpper
|
||||
조합7 = Me.GetFPData(Me.in7, desnum, Me.desview).ToUpper
|
||||
조합8 = Me.GetFPData(Me.in8, desnum, Me.desview).ToUpper
|
||||
|
||||
If 시공년월.Length = 3 Then 시공년월 = "0" & 시공년월
|
||||
|
||||
SetFpData(srcnum, out1.Text, 시공년월)
|
||||
SetFpData(srcnum, out2.Text, 조합2)
|
||||
SetFpData(srcnum, out3.Text, 조합3)
|
||||
|
||||
SetFpData(srcnum, out4.Text, 조합4)
|
||||
SetFpData(srcnum, out5.Text, 조합5)
|
||||
SetFpData(srcnum, out6.Text, 조합6)
|
||||
SetFpData(srcnum, out7.Text, 조합7)
|
||||
SetFpData(srcnum, out8.Text, 조합8)
|
||||
'//각데이터를 가져왔다.
|
||||
'//가져왓으므로 이제 out1~8에 지정된 열에 해당 데이터를 기록만 해주면된다.
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub SetFpData(ByVal srcnum As Integer, ByVal colnum As String, ByVal SeTvalue As String, Optional ByVal formatmask As String = "")
|
||||
'//원본 뷰 srcview 의 줄,열에 데이터를 기록한다. column 이 0이거나 빈값이면 하지않는다.
|
||||
If colnum = "0" OrElse colnum = "" Then Return
|
||||
If IsNumeric(colnum) = False Then Return '//숫자가 아니면 사용하지 않는다.
|
||||
|
||||
If SeTvalue = "" Then '//값이없으면
|
||||
Addlog("[X] 대상파일로부터 가져올 값이 없습니다. 열번호:" & colnum + 1)
|
||||
Return
|
||||
End If
|
||||
|
||||
'//여기서 부터는 0이상의 값이다. 먼저 해당 열이 존재하는지 확인한다.
|
||||
Try
|
||||
Me.srcview.ActiveSheet.Cells(srcnum, colnum - 1).Text = SeTvalue
|
||||
Catch ex As Exception
|
||||
Addlog("열번호:" & colnum + 1 & "이 존재하지 않거나 기타 오류입니다")
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Addlog(ByVal Msg As String, Optional ByVal reset As Boolean = False)
|
||||
If reset Then synclog.RichTextBox1.Clear()
|
||||
synclog.RichTextBox1.AppendText(Msg & vbCrLf)
|
||||
End Sub
|
||||
Private Sub Addlog2(ByVal Msg As String, Optional ByVal reset As Boolean = False)
|
||||
If reset Then synclog.RichTextBox2.Clear()
|
||||
synclog.RichTextBox2.AppendText(Msg & vbCrLf)
|
||||
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 RenameColumnname2()
|
||||
For i As Integer = 0 To Me.desview.Sheets.Count - 1
|
||||
For Each CL As FarPoint.Win.Spread.Column In Me.desview.Sheets(i).Columns
|
||||
Me.desview.Sheets(i).Columns(CL.Index).Label = CL.Index + 1
|
||||
Next
|
||||
Next
|
||||
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 desview_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles desview.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 desview_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles desview.DragDrop
|
||||
If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
|
||||
Dim STR() As String = CType(e.Data.GetData(DataFormats.FileDrop), String())
|
||||
If Me.desview.IsExcelFile(STR(0)) = False Then
|
||||
MsgBox(STR(0) & vbCrLf & "엑셀파일이 아닙니다")
|
||||
Else
|
||||
If Me.desview.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.desview.IsExcelFile(Fi.FullName) = False Then
|
||||
MsgBox(Fi.FullName & vbCrLf & "엑셀파일이 아닙니다")
|
||||
Else
|
||||
If Me.desview.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.desview.IsExcelFile(STR(0)) = False Then
|
||||
MsgBox(STR(0) & vbCrLf & "엑셀파일이 아닙니다")
|
||||
Else
|
||||
If Me.desview.OpenExcel(STR(0), FarPoint.Excel.ExcelOpenFlags.RowAndColumnHeaders) = False Then
|
||||
MsgBox(STR(0) & vbCrLf & "파일을 불러올수 없습니다")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
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 desview_CellClick(ByVal sender As System.Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs)
|
||||
|
||||
End Sub
|
||||
Private Sub srcview_CellClick(ByVal sender As System.Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs)
|
||||
|
||||
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() = Windows.Forms.DialogResult.Cancel Then
|
||||
MsgBox("불러오기가 취소되었습니다", MsgBoxStyle.Critical, "확인")
|
||||
Else
|
||||
ReadXls(OD.FileName, Me.srcview)
|
||||
Me.Srcfile = OD.FileName
|
||||
RenameColumnname1()
|
||||
'synclog.view1.OpenExcel(OD.FileName, FarPoint.Excel.ExcelOpenFlags.RowAndColumnHeaders) '//비포함목록을 저장
|
||||
'synclog.view2.OpenExcel(OD.FileName, FarPoint.Excel.ExcelOpenFlags.RowAndColumnHeaders) '//포함목록을 저장
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ReadXls(ByVal Filename As String, ByRef custfp1 As FarPoint.Win.Spread.FpSpread) '//Read xls File
|
||||
|
||||
custfp1.OpenExcel(Filename)
|
||||
For index As Integer = 0 To custfp1.Sheets.Count - 1
|
||||
For Each Cl As FarPoint.Win.Spread.Column In custfp1.Sheets(index).Columns '//Set columns label
|
||||
Cl.Label = Cl.Index + 1
|
||||
Next
|
||||
Next
|
||||
''//연속 5개의 공백이 보이면 카운트를 종료한다.
|
||||
Dim 공백 As Int16 = 0
|
||||
For Each Row As FarPoint.Win.Spread.Row In custfp1.ActiveSheet.Rows
|
||||
If custfp1.ActiveSheet.Cells(Row.Index, 0).Text = "" AndAlso custfp1.ActiveSheet.Cells(Row.Index, 1).Text = "" AndAlso custfp1.ActiveSheet.Cells(Row.Index, 2).Text = "" Then
|
||||
' MsgBox(Row.Index)
|
||||
공백 += 1
|
||||
Else
|
||||
공백 = 0
|
||||
End If
|
||||
If 공백 >= 10 Then
|
||||
' MsgBox("종료시점검색완료" & Row.Index)
|
||||
custfp1.ActiveSheet.RowCount = Row.Index + 1 - 10
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub tb_desfile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_desfile.Click
|
||||
Dim OD As New OpenFileDialog
|
||||
OD.FileName = Me.DesFile
|
||||
OD.Filter = "MS Office Excel WorkSheet(*.xls)|*.xls"
|
||||
OD.FilterIndex = 1
|
||||
' OD.RestoreDirectory = True
|
||||
If OD.ShowDialog() = Windows.Forms.DialogResult.Cancel Then
|
||||
MsgBox("불러오기가 취소되었습니다", MsgBoxStyle.Critical, "확인")
|
||||
Else
|
||||
ReadXls(OD.FileName, Me.desview)
|
||||
Me.DesFile = OD.FileName
|
||||
RenameColumnname2()
|
||||
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
|
||||
findCnt = 0
|
||||
Me.ListOk = New ArrayList
|
||||
Me.ListDel = New ArrayList
|
||||
Me.Log1 = New ArrayList
|
||||
Me.log2 = New ArrayList
|
||||
|
||||
|
||||
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() <> Windows.Forms.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 bt_dessave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_dessave.Click
|
||||
Dim a As New SaveFileDialog
|
||||
a.Filter = "엑셀 워크시트파일(*.XLS)|*.XLS"
|
||||
a.FilterIndex = 0
|
||||
a.Title = "[모든데이터내보내기] 저장할 엑셀 파일을 지정하세요"
|
||||
a.FileName = "대상파일.xls"
|
||||
If a.ShowDialog() <> Windows.Forms.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 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
|
||||
|
||||
Private Sub chk_test_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chk_test.Click
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
4281
Epole.fp5/업로드폼/syncLOg.Designer.vb
generated
Normal file
4281
Epole.fp5/업로드폼/syncLOg.Designer.vb
generated
Normal file
File diff suppressed because it is too large
Load Diff
138
Epole.fp5/업로드폼/syncLOg.resx
Normal file
138
Epole.fp5/업로드폼/syncLOg.resx
Normal file
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ContextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="ContextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>177, 17</value>
|
||||
</metadata>
|
||||
<metadata name="save1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>619, 17</value>
|
||||
</metadata>
|
||||
<metadata name="view1_Sheet1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>337, 17</value>
|
||||
</metadata>
|
||||
<metadata name="view2_Sheet1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>492, 17</value>
|
||||
</metadata>
|
||||
<metadata name="save2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>702, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
54
Epole.fp5/업로드폼/syncLOg.vb
Normal file
54
Epole.fp5/업로드폼/syncLOg.vb
Normal file
@@ -0,0 +1,54 @@
|
||||
Public Class synclog
|
||||
|
||||
Private Sub bt_clearStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_clear.Click
|
||||
Me.RichTextBox1.Clear()
|
||||
End Sub
|
||||
|
||||
Private Sub bt_savelist_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_savelist.Click
|
||||
Dim SD As New SaveFileDialog
|
||||
SD.FileName = "불일치목록log" & Format(Now, "yyyyMMdd") & ".txt"
|
||||
If SD.ShowDialog() <> Windows.Forms.DialogResult.OK Then
|
||||
MsgBox("취소되었습니다", MsgBoxStyle.Critical, "사용자취소")
|
||||
Else
|
||||
Me.RichTextBox1.SaveFile(SD.FileName, RichTextBoxStreamType.PlainText)
|
||||
MsgBox("저장완료", MsgBoxStyle.Information, "확인")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem2.Click
|
||||
Me.RichTextBox2.Clear()
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem3.Click
|
||||
Dim SD As New SaveFileDialog
|
||||
SD.FileName = "일치목록log" & Format(Now, "yyyyMMdd") & ".txt"
|
||||
If SD.ShowDialog() <> Windows.Forms.DialogResult.OK Then
|
||||
MsgBox("취소되었습니다", MsgBoxStyle.Critical, "사용자취소")
|
||||
Else
|
||||
Me.RichTextBox2.SaveFile(SD.FileName, RichTextBoxStreamType.PlainText)
|
||||
MsgBox("저장완료", MsgBoxStyle.Information, "확인")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub bt_out1ripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_out1.Click
|
||||
Dim a As New SaveFileDialog
|
||||
a.Filter = "엑셀 워크시트파일(*.XLS)|*.XLS"
|
||||
a.FilterIndex = 0
|
||||
a.Title = "[모든데이터내보내기] 저장할 엑셀 파일을 지정하세요"
|
||||
a.FileName = "비포함목록.xls"
|
||||
If a.ShowDialog() <> Windows.Forms.DialogResult.Cancel Then
|
||||
Dim msg As New System.Text.StringBuilder
|
||||
Me.view1.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
|
||||
End Class
|
||||
Reference in New Issue
Block a user