..
This commit is contained in:
@@ -74,12 +74,23 @@
|
||||
AddHandler DSET1.weather_supdo.TableNewRow, AddressOf AddNewDataRow_Weathersupdo
|
||||
AddHandler DSET1.weather_cha.TableNewRow, AddressOf AddNewDataRow_WeatherCha
|
||||
|
||||
AddHandler DSET1.weather_group.TableNewRow, AddressOf AddNewDataRow_WeatherGrp
|
||||
|
||||
AddHandler dvArea1.CellContentClick, AddressOf dv_cellcontclick
|
||||
AddHandler dvArea2.CellContentClick, AddressOf dv_cellcontclick
|
||||
AddHandler dvArea3.CellContentClick, AddressOf dv_cellcontclick
|
||||
|
||||
|
||||
Me.bs.DataSource = DSET1
|
||||
Me.bsw_ilsa.DataSource = DSET1
|
||||
Me.bsw_supdo.DataSource = DSET1
|
||||
Me.bsw_temp.DataSource = DSET1
|
||||
Me.bsw_cha.DataSource = DSET1
|
||||
|
||||
Me.bsWGDep1.DataSource = DSET1
|
||||
Me.bsWGDep2.DataSource = DSET1
|
||||
Me.bsWGDep3.DataSource = DSET1
|
||||
|
||||
'//콤보컨트롤 바인딩
|
||||
Me.bn_all.BindingSource = Me.bs
|
||||
Me.bs = Me.bs
|
||||
@@ -92,7 +103,21 @@
|
||||
AddDebug("▲ Form Load")
|
||||
End Sub
|
||||
|
||||
Sub dv_cellcontclick(sender As Object, e As DataGridViewCellEventArgs)
|
||||
Dim grid As DataGridView = sender
|
||||
If grid.Columns(e.ColumnIndex).DataPropertyName <> "area" Then Return
|
||||
|
||||
Dim f As New fSelectArea()
|
||||
If f.ShowDialog <> DialogResult.OK Then Return
|
||||
|
||||
grid.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = f.ComboBox1.Text.ToString()
|
||||
End Sub
|
||||
|
||||
#Region "Weather 관련"
|
||||
Private Sub AddNewDataRow_WeatherGrp(ByVal sender As Object, ByVal e As System.Data.DataTableNewRowEventArgs)
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub AddNewDataRow_Weather(ByVal sender As Object, ByVal e As System.Data.DataTableNewRowEventArgs)
|
||||
e.Row.Item("code") = GetMaxCode(DSET1.tbl_weather)
|
||||
End Sub
|
||||
@@ -146,11 +171,11 @@
|
||||
If Not EndEdit(Me.bsw_ilsa) Then Return
|
||||
If Not EndEdit(Me.bsw_temp) Then Return
|
||||
If Not EndEdit(Me.bsw_cha) Then Return
|
||||
Check_Modify(Me.DS.tbl_weather)
|
||||
Check_Modify(Me.DS.weather_ilsa, False)
|
||||
Check_Modify(Me.DS.weather_supdo, False)
|
||||
Check_Modify(Me.DS.weather_temp, False)
|
||||
Check_Modify(Me.DS.weather_cha, False)
|
||||
Check_Modify(Me.DS1.tbl_weather)
|
||||
Check_Modify(Me.DS1.weather_ilsa, False)
|
||||
Check_Modify(Me.DS1.weather_supdo, False)
|
||||
Check_Modify(Me.DS1.weather_temp, False)
|
||||
Check_Modify(Me.DS1.weather_cha, False)
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -185,8 +210,8 @@
|
||||
Else
|
||||
'MsgBox(Me.bsw_supdo.Count)
|
||||
End If
|
||||
Me.DS.weather_temp.AcceptChanges()
|
||||
Me.DS.weather_supdo.AcceptChanges()
|
||||
Me.DS1.weather_temp.AcceptChanges()
|
||||
Me.DS1.weather_supdo.AcceptChanges()
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -689,7 +714,7 @@
|
||||
'For j As Integer = 1 To DSET1.weather_cha.Select(Me.bsw_cha.Filter).Length
|
||||
' DSET1.weather_cha.Select(Me.bsw_cha.Filter)(j - 1)("code") = Format(j, "0000")
|
||||
'Next
|
||||
DS.weather_cha.AcceptChanges() '//이건 변경내역을 반영하게삳는겁니다.
|
||||
DS1.weather_cha.AcceptChanges() '//이건 변경내역을 반영하게삳는겁니다.
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
|
||||
@@ -985,4 +1010,211 @@
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
|
||||
'//delete 1dep
|
||||
'//하위모든데이터를 삭제해야한다.
|
||||
Dim drv As DataRowView = Me.bsWGDep1.Current
|
||||
If drv Is Nothing OrElse drv("code").ToString().Length < 6 Then Return
|
||||
Dim codeHeader As String = drv("code").ToString().Substring(0, 2)
|
||||
Dim drows() As DataRow = DSET1.weather_group.Select(String.Format("code like '{0}%'", codeHeader))
|
||||
For i As Integer = drows.Length To 1 Step -1
|
||||
DSET1.weather_group.Rows.Remove(drows(i - 1))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
|
||||
'//add 2
|
||||
'//1번이 선택되지 않앗다면 넘어간다.
|
||||
Dim drv1 As DataRowView = Me.bsWGDep1.Current
|
||||
If drv1 Is Nothing OrElse drv1("code").ToString().Length < 6 Then Return
|
||||
|
||||
Dim codeHeader As String = drv1("code").ToString().Substring(0, 2)
|
||||
Dim newcode As String = String.Empty
|
||||
For i As Integer = 1 To 99
|
||||
Dim ccode As String = codeHeader + i.ToString("00") + "00"
|
||||
'//이 코드가 현재 없다면 적용한다.
|
||||
If DSET1.weather_group.Select("code='" + ccode + "'").Length < 1 Then
|
||||
newcode = ccode
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If String.IsNullOrEmpty(newcode) Then
|
||||
MsgBox("신규번호를 할당 하지 못했습니다", MsgBoxStyle.Critical, "확인")
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim newdr As DS.weather_groupRow = DSET1.weather_group.Newweather_groupRow
|
||||
newdr.code = newcode
|
||||
newdr.name = "<지역명>"
|
||||
DSET1.weather_group.Addweather_groupRow(newdr)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
||||
'//delete 2dep
|
||||
'//하위모든데이터를 삭제해야한다.
|
||||
Dim drv As DataRowView = Me.bsWGDep2.Current
|
||||
If drv Is Nothing OrElse drv("code").ToString().Length < 6 Then Return
|
||||
Dim codeHeader As String = drv("code").ToString().Substring(0, 4)
|
||||
Dim drows() As DataRow = DSET1.weather_group.Select(String.Format("code like '{0}%'", codeHeader))
|
||||
For i As Integer = drows.Length To 1 Step -1
|
||||
DSET1.weather_group.Rows.Remove(drows(i - 1))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
|
||||
'/add 3
|
||||
'//2번이 선택되지 않앗다면 넘어간다.
|
||||
Dim drv1 As DataRowView = Me.bsWGDep2.Current
|
||||
If drv1 Is Nothing OrElse drv1("code").ToString().Length < 6 Then Return
|
||||
|
||||
Dim codeHeader As String = drv1("code").ToString().Substring(0, 4)
|
||||
Dim newcode As String = String.Empty
|
||||
For i As Integer = 1 To 99
|
||||
Dim ccode As String = codeHeader + i.ToString("00")
|
||||
'//이 코드가 현재 없다면 적용한다.
|
||||
If DSET1.weather_group.Select("code='" + ccode + "'").Length < 1 Then
|
||||
newcode = ccode
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If String.IsNullOrEmpty(newcode) Then
|
||||
MsgBox("신규번호를 할당 하지 못했습니다", MsgBoxStyle.Critical, "확인")
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim newdr As DS.weather_groupRow = DSET1.weather_group.Newweather_groupRow
|
||||
newdr.code = newcode
|
||||
newdr.name = "<지역명>"
|
||||
DSET1.weather_group.Addweather_groupRow(newdr)
|
||||
End Sub
|
||||
|
||||
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
||||
'//delete 3dep
|
||||
Dim drv As DataRowView = Me.bsWGDep3.Current
|
||||
If drv Is Nothing OrElse drv("code").ToString().Length < 6 Then Return
|
||||
Dim codeHeader As String = drv("code").ToString().Substring(0, 6)
|
||||
Dim drows() As DataRow = DSET1.weather_group.Select(String.Format("code like '{0}%'", codeHeader))
|
||||
For i As Integer = drows.Length To 1 Step -1
|
||||
DSET1.weather_group.Rows.Remove(drows(i - 1))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub dvArea1_DataError(sender As System.Object, e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles dvArea1.DataError
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub dvArea2_DataError(sender As System.Object, e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles dvArea2.DataError
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub dvArea3_DataError(sender As System.Object, e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles dvArea3.DataError
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button10_Click(sender As Object, e As EventArgs)
|
||||
Dim sd As New SaveFileDialog()
|
||||
If sd.ShowDialog() = DialogResult.OK Then
|
||||
DSET1.weather_group.WriteXml(sd.FileName)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button9_Click(sender As Object, e As EventArgs)
|
||||
Dim sd As New OpenFileDialog()
|
||||
If sd.ShowDialog() = DialogResult.OK Then
|
||||
DSET1.weather_group.Clear()
|
||||
DSET1.weather_group.ReadXml(sd.FileName)
|
||||
DSET1.weather_group.AcceptChanges()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bsWGDep1_CurrentChanged(sender As Object, e As EventArgs) Handles bsWGDep1.CurrentChanged
|
||||
'//select 1 depth
|
||||
Dim drv As DataRowView = Me.bsWGDep1.Current
|
||||
If drv Is Nothing OrElse drv("code").ToString().Length < 6 Then
|
||||
bsWGDep2.Filter = "code='test'"
|
||||
Else
|
||||
Dim codeHeader As String = drv("code").ToString().Substring(0, 2)
|
||||
bsWGDep2.Filter = String.Format("code like '{0}%' and code not like '%0000' and code like '%00'", codeHeader)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bsWGDep2_CurrentChanged(sender As Object, e As EventArgs) Handles bsWGDep2.CurrentChanged
|
||||
'//select 2 depth
|
||||
Dim drv As DataRowView = Me.bsWGDep2.Current
|
||||
If drv Is Nothing OrElse drv("code").ToString().Length < 6 Then
|
||||
bsWGDep3.Filter = "code='test'"
|
||||
Else
|
||||
Dim codeHeader As String = drv("code").ToString().Substring(0, 4)
|
||||
bsWGDep3.Filter = String.Format("code like '{0}%' and code not like '%00'", codeHeader)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bsWGDep3_CurrentChanged(sender As Object, e As EventArgs) Handles bsWGDep3.CurrentChanged
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub ToolStripButton8_Click(sender As Object, e As EventArgs) Handles ToolStripButton8.Click
|
||||
Dim sd As New FolderBrowserDialog()
|
||||
If sd.ShowDialog() = DialogResult.OK Then
|
||||
'Eco2는 바로 내보내기하면 된다
|
||||
'DSET1.weather_cha.Clear()
|
||||
'DSET1.weather_ilsa.Clear()
|
||||
'DSET1.weather_supdo.Clear()
|
||||
'DSET1.weather_temp.Clear()
|
||||
|
||||
'DSET1.weather_cha.Merge(DSET1.weather_cha_od)
|
||||
'DSET1.weather_ilsa.Merge(DSET1.weather_ilsa)
|
||||
'DSET1.weather_supdo.Merge(DSET1.weather_supdo)
|
||||
'DSET1.weather_temp.Merge(DSET1.weather_temp)
|
||||
|
||||
'모든파일을 저장한다.
|
||||
DSET1.weather_cha.WriteXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.weather_cha.TableName + ".xml"))
|
||||
DSET1.weather_ilsa.WriteXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.weather_ilsa.TableName + ".xml"))
|
||||
DSET1.weather_supdo.WriteXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.weather_supdo.TableName + ".xml"))
|
||||
DSET1.weather_temp.WriteXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.weather_temp.TableName + ".xml"))
|
||||
DSET1.tbl_weather.WriteXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.tbl_weather.TableName + ".xml"))
|
||||
|
||||
DSET1.weather_group.WriteXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.weather_cha.TableName + ".xml"))
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton13_Click(sender As Object, e As EventArgs) Handles ToolStripButton13.Click
|
||||
Dim sd As New FolderBrowserDialog()
|
||||
If sd.ShowDialog() = DialogResult.OK Then
|
||||
|
||||
DSET1.weather_cha.Clear()
|
||||
DSET1.weather_ilsa.Clear()
|
||||
DSET1.weather_supdo.Clear()
|
||||
DSET1.weather_temp.Clear()
|
||||
DSET1.weather_group.Clear()
|
||||
DSET1.tbl_weather.Clear()
|
||||
|
||||
DSET1.weather_cha.ReadXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.weather_cha.TableName + ".xml"))
|
||||
DSET1.weather_ilsa.ReadXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.weather_ilsa.TableName + ".xml"))
|
||||
DSET1.weather_supdo.ReadXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.weather_supdo.TableName + ".xml"))
|
||||
DSET1.weather_temp.ReadXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.weather_temp.TableName + ".xml"))
|
||||
DSET1.tbl_weather.ReadXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.tbl_weather.TableName + ".xml"))
|
||||
|
||||
DSET1.weather_group.ReadXml(System.IO.Path.Combine(sd.SelectedPath, DSET1.weather_group.TableName + ".xml"))
|
||||
|
||||
|
||||
'//od는 od 데이터에 다시 옴겨야한다
|
||||
DSET1.weather_cha.AcceptChanges()
|
||||
DSET1.weather_ilsa.AcceptChanges()
|
||||
DSET1.weather_supdo.AcceptChanges()
|
||||
DSET1.weather_temp.AcceptChanges()
|
||||
DSET1.tbl_weather.AcceptChanges()
|
||||
|
||||
DSET1.weather_group.AcceptChanges()
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user