2024y .
This commit is contained in:
38
ArinWarev1/Forms_Basic/Frm_Calc.Designer.vb
generated
38
ArinWarev1/Forms_Basic/Frm_Calc.Designer.vb
generated
@@ -26,8 +26,9 @@ Partial Class Frm_Calc
|
||||
Me.Button2 = New System.Windows.Forms.Button()
|
||||
Me.Button3 = New System.Windows.Forms.Button()
|
||||
Me.Panel1 = New System.Windows.Forms.Panel()
|
||||
Me.bt_설계개선안 = New System.Windows.Forms.Button()
|
||||
Me.btImport = New System.Windows.Forms.Button()
|
||||
Me.bt_cancel = New System.Windows.Forms.Button()
|
||||
Me.bt_설계개선안 = New System.Windows.Forms.Button()
|
||||
Me.Panel1.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
@@ -44,7 +45,7 @@ Partial Class Frm_Calc
|
||||
'Button2
|
||||
'
|
||||
Me.Button2.ForeColor = System.Drawing.Color.Silver
|
||||
Me.Button2.Location = New System.Drawing.Point(40, 174)
|
||||
Me.Button2.Location = New System.Drawing.Point(85, 335)
|
||||
Me.Button2.Name = "Button2"
|
||||
Me.Button2.Size = New System.Drawing.Size(137, 31)
|
||||
Me.Button2.TabIndex = 4
|
||||
@@ -66,6 +67,7 @@ Partial Class Frm_Calc
|
||||
'
|
||||
Me.Panel1.BackColor = System.Drawing.Color.White
|
||||
Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
||||
Me.Panel1.Controls.Add(Me.btImport)
|
||||
Me.Panel1.Controls.Add(Me.bt_cancel)
|
||||
Me.Panel1.Controls.Add(Me.bt_설계개선안)
|
||||
Me.Panel1.Controls.Add(Me.Button1)
|
||||
@@ -74,18 +76,19 @@ Partial Class Frm_Calc
|
||||
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.Panel1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.Panel1.Name = "Panel1"
|
||||
Me.Panel1.Size = New System.Drawing.Size(160, 164)
|
||||
Me.Panel1.Size = New System.Drawing.Size(160, 200)
|
||||
Me.Panel1.TabIndex = 7
|
||||
'
|
||||
'bt_설계개선안
|
||||
'btImport
|
||||
'
|
||||
Me.bt_설계개선안.BackColor = System.Drawing.SystemColors.Control
|
||||
Me.bt_설계개선안.Location = New System.Drawing.Point(11, 85)
|
||||
Me.bt_설계개선안.Name = "bt_설계개선안"
|
||||
Me.bt_설계개선안.Size = New System.Drawing.Size(137, 31)
|
||||
Me.bt_설계개선안.TabIndex = 8
|
||||
Me.bt_설계개선안.Text = "설계개선안"
|
||||
Me.bt_설계개선안.UseVisualStyleBackColor = False
|
||||
Me.btImport.BackColor = System.Drawing.SystemColors.Control
|
||||
Me.btImport.Enabled = False
|
||||
Me.btImport.Location = New System.Drawing.Point(11, 85)
|
||||
Me.btImport.Name = "btImport"
|
||||
Me.btImport.Size = New System.Drawing.Size(137, 31)
|
||||
Me.btImport.TabIndex = 10
|
||||
Me.btImport.Text = "신재생가져오기"
|
||||
Me.btImport.UseVisualStyleBackColor = False
|
||||
'
|
||||
'bt_cancel
|
||||
'
|
||||
@@ -98,12 +101,22 @@ Partial Class Frm_Calc
|
||||
Me.bt_cancel.Text = "취 소"
|
||||
Me.bt_cancel.UseVisualStyleBackColor = False
|
||||
'
|
||||
'bt_설계개선안
|
||||
'
|
||||
Me.bt_설계개선안.BackColor = System.Drawing.SystemColors.Control
|
||||
Me.bt_설계개선안.Location = New System.Drawing.Point(11, 159)
|
||||
Me.bt_설계개선안.Name = "bt_설계개선안"
|
||||
Me.bt_설계개선안.Size = New System.Drawing.Size(137, 31)
|
||||
Me.bt_설계개선안.TabIndex = 8
|
||||
Me.bt_설계개선안.Text = "설계개선안"
|
||||
Me.bt_설계개선안.UseVisualStyleBackColor = False
|
||||
'
|
||||
'Frm_Calc
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 15.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.SystemColors.AppWorkspace
|
||||
Me.ClientSize = New System.Drawing.Size(160, 164)
|
||||
Me.ClientSize = New System.Drawing.Size(160, 200)
|
||||
Me.Controls.Add(Me.Panel1)
|
||||
Me.Font = New System.Drawing.Font("돋움", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(129, Byte))
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
|
||||
@@ -125,4 +138,5 @@ Partial Class Frm_Calc
|
||||
Friend WithEvents Panel1 As System.Windows.Forms.Panel
|
||||
Friend WithEvents bt_설계개선안 As System.Windows.Forms.Button
|
||||
Friend WithEvents bt_cancel As System.Windows.Forms.Button
|
||||
Friend WithEvents btImport As System.Windows.Forms.Button
|
||||
End Class
|
||||
|
||||
@@ -112,9 +112,9 @@
|
||||
<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>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.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>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,4 +1,7 @@
|
||||
Public Class Frm_Calc
|
||||
|
||||
Dim importok As Boolean = False
|
||||
|
||||
Public Type As Calculator.ECalc
|
||||
Public Overrides Function AcceptChanged() As Boolean
|
||||
|
||||
@@ -16,6 +19,7 @@
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
|
||||
Pub.Importsameaddress = False
|
||||
Type = Calculator.ECalc.REq
|
||||
Me.DialogResult = Windows.Forms.DialogResult.OK
|
||||
End Sub
|
||||
@@ -26,6 +30,10 @@
|
||||
End Sub
|
||||
|
||||
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
|
||||
If importok = False AndAlso btImport.Enabled = True Then
|
||||
MsgboxE("외부 신재생 생산량을 지정해주세요.")
|
||||
Return
|
||||
End If
|
||||
Type = Calculator.ECalc.All
|
||||
Me.DialogResult = Windows.Forms.DialogResult.OK
|
||||
End Sub
|
||||
@@ -46,15 +54,324 @@
|
||||
End Sub
|
||||
|
||||
Private Sub Frm_Calc_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
Pub.Importsameaddress = False
|
||||
Select Case Prj.UserAuthType
|
||||
Case "ADMIN", "BOTH1" '//제한된 사용자만 가능
|
||||
bt_설계개선안.Visible = True
|
||||
Case Else
|
||||
bt_설계개선안.Visible = False
|
||||
End Select
|
||||
|
||||
'//import check
|
||||
Dim bfind As Boolean = DSET1.tbl_new.Select("기기종류='외부신재생'").Length > 0
|
||||
btImport.Enabled = bfind
|
||||
importok = False
|
||||
End Sub
|
||||
|
||||
Private Sub bt_cancel_Click(sender As System.Object, e As System.EventArgs) Handles bt_cancel.Click
|
||||
Me.DialogResult = Windows.Forms.DialogResult.Cancel
|
||||
End Sub
|
||||
|
||||
Private Sub btImport_Click(sender As System.Object, e As System.EventArgs) Handles btImport.Click
|
||||
'//import data
|
||||
Dim Od As New OpenFileDialog
|
||||
'Od.InitialDirectory = TemplateDir.FullName
|
||||
Od.FileName = Prj.FileName
|
||||
If Prj.UserAuthType = "ADMIN" OrElse Prj.UserAuthType = "BOTH" OrElse Prj.UserAuthType = "BOTH2" OrElse Prj.UserAuthType = "BOTH1" Then '//2011.03.09 추가
|
||||
Od.Filter = "템플릿파일(*.TPL,*.TPLX)|*.tpl;*.tplx|모든파일(*.*)|*.*"
|
||||
Else
|
||||
Od.Filter = "데이터파일(*.ECO,*.ECOX)|*.eco;*.ecox|모든파일(*.*)|*.*"
|
||||
End If
|
||||
Od.FilterIndex = 0
|
||||
If Od.ShowDialog <> Windows.Forms.DialogResult.OK Then Return
|
||||
Open_File(Od.FileName)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Function Open_File(ByVal FileName As String, Optional ByVal SyncServer As Boolean = False, Optional checkVersion As Boolean = True, Optional silent As Boolean = False, Optional isNew As Boolean = False) As Boolean
|
||||
|
||||
If SyncServer Then
|
||||
If Prj.UserId.ToLower().StartsWith("user") Then
|
||||
SyncServer = False
|
||||
End If
|
||||
End If
|
||||
|
||||
pLog.Add("=======================================")
|
||||
pLog.Add(String.Format("Open File = {0}", FileName))
|
||||
pLog.Add("=======================================", True)
|
||||
|
||||
Dim PrjIsError As Boolean = False '//160509
|
||||
|
||||
'//파일을 열어서 템플릿이름을 가져온다
|
||||
Dim FI As New System.IO.FileInfo(FileName)
|
||||
Dim Desbuf() As Byte = {}
|
||||
Dim FS As System.IO.Stream
|
||||
'///////////////////////////////////////////////////////////////////////////////////////////////////2011.03.16 입력파일 변조
|
||||
If Not (Prj.UserAuthType = "ADMIN" OrElse Prj.UserAuthType = "BOTH" OrElse Prj.UserAuthType = "BOTH2" OrElse Prj.UserAuthType = "BOTH1") Then '//2011.03.16 추가 //eco 파일 불러올때 ADMIN 제거 'Prj.UserAuthType = "ADMIN" OrElse
|
||||
Dim Source() As Byte = My.Computer.FileSystem.ReadAllBytes(FI.FullName)
|
||||
|
||||
If Source.Length < 4 Then
|
||||
Prj.IsError = True
|
||||
MsgboxE("알수없거나 손상된 파일입니다" + vbCrLf + FI.FullName, True)
|
||||
Return False
|
||||
End If
|
||||
pLog.Add("암호화 해제")
|
||||
Desbuf = DeCryptArea(Source, New Byte() {&HAC, &H29, &H55, &H42})
|
||||
|
||||
Else
|
||||
'tpl file
|
||||
Desbuf = System.IO.File.ReadAllBytes(FileName)
|
||||
' FS = New IO.FileStream(FileName, IO.FileMode.Open)
|
||||
End If
|
||||
|
||||
If FI.Extension.ToLower().EndsWith("x") Then '//확장자가 x로끝나면 압축된 포맷
|
||||
Dim datalen As Integer = BitConverter.ToInt32(Desbuf, 0)
|
||||
Dim RealData(Desbuf.Length - 4 - 1) As Byte
|
||||
Array.Copy(Desbuf, 4, RealData, 0, RealData.Length)
|
||||
Dim DeCompress(datalen - 1) As Byte
|
||||
Array.Clear(DeCompress, 0, DeCompress.Length)
|
||||
Utility.MiniLZO.Decompress(RealData, DeCompress)
|
||||
Array.Resize(Desbuf, DeCompress.Length)
|
||||
Array.Clear(Desbuf, 0, Desbuf.Length)
|
||||
Array.Copy(DeCompress, Desbuf, Desbuf.Length)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
FS = New IO.MemoryStream(Desbuf, True)
|
||||
|
||||
'///////////////////////////////////////////////////////////////////////////////////////////////////2011.03.16 입력파일 변조
|
||||
|
||||
|
||||
|
||||
Dim Br As New IO.BinaryReader(FS, System.Text.Encoding.Default)
|
||||
Dim PrjFileName As String = FileName : Myini.Write("presetting", "filename", Prj.FileName)
|
||||
Dim PrjOpened As Boolean = False
|
||||
|
||||
|
||||
'//세이브파일구조(2)
|
||||
Dim PrjSFType As String = STB(Br.ReadBytes(2))
|
||||
pLog.Add("File Type = " + Prj.SFType)
|
||||
|
||||
Dim DSImport As New DS()
|
||||
|
||||
Dim PrjUIVersion As String
|
||||
Dim PrjLGVersino As String
|
||||
Dim Prjname As String
|
||||
Dim prjdesc As String
|
||||
Dim prjmaketime As String
|
||||
Dim prjedittime As String
|
||||
Dim PrjPassword As String
|
||||
|
||||
If Prj.UserAuthType = "ADMIN" OrElse Prj.UserAuthType = "BOTH" OrElse Prj.UserAuthType = "BOTH2" OrElse Prj.UserAuthType = "BOTH1" Then '//2011.03.09 추가 //eco 파일 불러올때 ADMIN 제거 'Prj.UserAuthType = "ADMIN" OrElse
|
||||
|
||||
Select Case Prj.SFType
|
||||
Case "00" '//기본버젼
|
||||
PrjUIVersion = STB(Br.ReadBytes(10))
|
||||
PrjLGVersino = STB(Br.ReadBytes(10))
|
||||
Select Case PrjLGVersino
|
||||
Case "2009123100", "2010030700", "2010031400"
|
||||
PrjLGVersino = StartVersion
|
||||
End Select
|
||||
Select Case PrjUIVersion
|
||||
Case "2009123100", "2010030700", "2010031400"
|
||||
PrjUIVersion = StartVersion
|
||||
PrjUIVersion = StartVersion
|
||||
End Select
|
||||
|
||||
Prjname = STB(Br.ReadBytes(100))
|
||||
prjdesc = STB(Br.ReadBytes(256))
|
||||
prjmaketime = STB(Br.ReadBytes(19))
|
||||
prjedittime = STB(Br.ReadBytes(19))
|
||||
' MsgBox(Br.BaseStream.Position)
|
||||
|
||||
|
||||
Dim DS1Len As Int64 = Br.ReadInt64
|
||||
If DS1Len = 0 Then
|
||||
DS1Len = FS.Length - Br.BaseStream.Position - 2
|
||||
End If
|
||||
'MsgBox("pos=" & Br.BaseStream.Position & vbCrLf & DS1Len, MsgBoxStyle.Information, Hex(DS1Len))
|
||||
Dim DS1() As Byte = Nothing
|
||||
Try
|
||||
DS1 = Br.ReadBytes(CInt(DS1Len))
|
||||
Catch ex As Exception
|
||||
Prj.IsError = True
|
||||
MsgBox("파일이 손상되었습니다(Read Data Array)." & vbCrLf & ex.Message.ToString, MsgBoxStyle.Information, "Ds1 byteRead Error")
|
||||
End Try
|
||||
|
||||
'MsgBox("pos=" & Br.BaseStream.Position & vbCrLf & DS1.Length, MsgBoxStyle.Information, DS1Len)
|
||||
If Not PrjIsError Then
|
||||
Dim Ms As New IO.MemoryStream(DS1)
|
||||
Try
|
||||
Ms.Position = 0
|
||||
|
||||
Dim tempds As New DS()
|
||||
tempds.ReadXml(Ms)
|
||||
|
||||
DSImport.Clear()
|
||||
DSImport.Merge(tempds) ' DSET1.ReadXml(Ms)
|
||||
DSImport.AcceptChanges()
|
||||
Ms.Close()
|
||||
|
||||
tempds.Dispose()
|
||||
Catch ex As Exception
|
||||
Prj.IsError = True
|
||||
MsgBox("파일이 손상되었습니다(Read DataSet)" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Information, "DSImport Open Error")
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
Case "01" '//기본버젼(+암호
|
||||
PrjUIVersion = STB(Br.ReadBytes(10))
|
||||
PrjLGVersino = STB(Br.ReadBytes(10))
|
||||
Select Case PrjLGVersino
|
||||
Case "2009123100", "2010030700", "2010031400"
|
||||
PrjLGVersino = StartVersion
|
||||
End Select
|
||||
Select Case PrjUIVersion
|
||||
Case "2009123100", "2010030700", "2010031400"
|
||||
PrjUIVersion = StartVersion
|
||||
End Select
|
||||
Prjname = STB(Br.ReadBytes(100))
|
||||
prjdesc = STB(Br.ReadBytes(256))
|
||||
prjmaketime = STB(Br.ReadBytes(19))
|
||||
prjedittime = STB(Br.ReadBytes(19))
|
||||
PrjPassword = STB(Br.ReadBytes(8)) '//암호에 8바이트할당한다. 즉 8개의문자가가능 한글은 불가로한다
|
||||
' MsgBox(Br.BaseStream.Position)
|
||||
|
||||
'//DS1 데이터초기화 및 오픈
|
||||
DSImport.Clear() : DSImport.AcceptChanges()
|
||||
Dim DS1Len As Int64 = Br.ReadInt64
|
||||
'MsgBox("pos=" & Br.BaseStream.Position & vbCrLf & DS1Len, MsgBoxStyle.Information, Hex(DS1Len))
|
||||
Dim DS1() As Byte = Br.ReadBytes(CInt(DS1Len))
|
||||
'MsgBox("pos=" & Br.BaseStream.Position & vbCrLf & DS1.Length, MsgBoxStyle.Information, DS1Len)
|
||||
Dim Ms As New IO.MemoryStream(DS1)
|
||||
Try
|
||||
|
||||
Dim tempds As New DS()
|
||||
tempds.ReadXml(Ms)
|
||||
|
||||
DSImport.Clear()
|
||||
DSImport.Merge(tempds) ' DSET1.ReadXml(Ms)
|
||||
DSImport.AcceptChanges()
|
||||
Ms.Close()
|
||||
|
||||
tempds.Dispose()
|
||||
Catch ex As Exception
|
||||
MsgBox("파일이 손상되었습니다." & vbCrLf & ex.Message.ToString, MsgBoxStyle.Information, "Ds1 Open Error")
|
||||
End Try
|
||||
|
||||
|
||||
PrjIsError = False
|
||||
Case Else
|
||||
MsgBox("파일을 불러올 수 없습니다1", MsgBoxStyle.Critical, "불러오기실패")
|
||||
PrjIsError = True
|
||||
End Select
|
||||
|
||||
|
||||
Else
|
||||
Select Case Prj.SFType
|
||||
Case "10" '//일반공개버전
|
||||
|
||||
|
||||
SyncServer = True ' 2011.06.15 추가 공개버전은 자동적으로 공용코드와 기상코드를 동기화
|
||||
PrjUIVersion = STB(Br.ReadBytes(10))
|
||||
PrjLGVersino = STB(Br.ReadBytes(10))
|
||||
Select Case PrjLGVersino
|
||||
Case "2009123100", "2010030700", "2010031400"
|
||||
PrjLGVersino = StartVersion
|
||||
End Select
|
||||
Select Case PrjUIVersion
|
||||
Case "2009123100", "2010030700", "2010031400"
|
||||
PrjUIVersion = StartVersion
|
||||
PrjUIVersion = StartVersion
|
||||
End Select
|
||||
|
||||
Prjname = STB(Br.ReadBytes(100))
|
||||
prjdesc = STB(Br.ReadBytes(256))
|
||||
prjmaketime = STB(Br.ReadBytes(19))
|
||||
prjedittime = STB(Br.ReadBytes(19))
|
||||
' MsgBox(Br.BaseStream.Position)
|
||||
|
||||
'//DS1 데이터초기화 및 오픈
|
||||
DSImport.Clear() : DSImport.AcceptChanges()
|
||||
Dim DS1Len As Int64 = Br.ReadInt64
|
||||
'MsgBox("pos=" & Br.BaseStream.Position & vbCrLf & DS1Len, MsgBoxStyle.Information, Hex(DS1Len))
|
||||
Dim DS1() As Byte = Br.ReadBytes(CInt(DS1Len))
|
||||
'MsgBox("pos=" & Br.BaseStream.Position & vbCrLf & DS1.Length, MsgBoxStyle.Information, DS1Len)
|
||||
Dim Ms As New IO.MemoryStream(DS1)
|
||||
Try
|
||||
Dim tempds As New DS()
|
||||
tempds.ReadXml(Ms)
|
||||
|
||||
DSImport.Clear()
|
||||
DSImport.Merge(tempds) ' DSET1.ReadXml(Ms)
|
||||
DSImport.AcceptChanges()
|
||||
Ms.Close()
|
||||
|
||||
tempds.Dispose()
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("파일이 손상되었습니다." & vbCrLf & ex.Message.ToString, MsgBoxStyle.Information, "Ds1 Open Error")
|
||||
End Try
|
||||
|
||||
PrjIsError = False
|
||||
Case Else
|
||||
MsgBox("파일을 불러올 수 없습니다2", MsgBoxStyle.Critical, "불러오기실패")
|
||||
PrjIsError = True
|
||||
End Select
|
||||
End If
|
||||
|
||||
Br.Close()
|
||||
FS.Close()
|
||||
|
||||
pLog.Add(String.Format("Project Name={0},Desc={1},Version={2}", Prj.Name, Prj.Desc, Prj.UIVersion))
|
||||
|
||||
If Not Prj.IsError Then
|
||||
PrjOpened = True
|
||||
|
||||
DSET1.tbl_importdata.Clear()
|
||||
|
||||
If DSImport.tbl_Desc.Rows.Count < 1 Then
|
||||
MsgBox("해당 파일에 건물개요가 없습니다", MsgBoxStyle.Critical, "불러오기실패")
|
||||
Return False
|
||||
End If
|
||||
|
||||
If DSET1.tbl_Desc.Rows.Count < 1 Then
|
||||
MsgBox("현재 파일에 건물개요가 없습니다", MsgBoxStyle.Critical, "불러오기실패")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim drdesc As DS.tbl_DescRow = DSImport.tbl_Desc.Rows(0)
|
||||
Dim drdesc_current As DS.tbl_DescRow = DSET1.tbl_Desc.Rows(0)
|
||||
Pub.Importsameaddress = drdesc.buildaddr.Trim() = drdesc_current.buildaddr.Trim()
|
||||
|
||||
For Each dr As DS.tbl_exportdataRow In DSImport.tbl_exportdata
|
||||
Dim newdr As DS.tbl_importdataRow = DSET1.tbl_importdata.Newtbl_importdataRow()
|
||||
newdr.mon = dr.mon
|
||||
newdr.외부전기도입량 = dr.외부전기생산량
|
||||
DSET1.tbl_importdata.Addtbl_importdataRow(newdr)
|
||||
Next
|
||||
|
||||
|
||||
DSET1.tbl_importdata.AcceptChanges()
|
||||
|
||||
If DSET1.tbl_importdata.Rows.Count < 1 Then
|
||||
MsgBox("해당 파일에 외부출력 신재생이 없습니다.", MsgBoxStyle.Critical, "불러오기실패")
|
||||
Return False
|
||||
End If
|
||||
|
||||
importok = True
|
||||
Return True
|
||||
|
||||
Else
|
||||
pLog.Add("Open File Error", True)
|
||||
Return False
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
@@ -87,6 +87,7 @@
|
||||
|
||||
Private Sub login()
|
||||
Prj.Admin = False
|
||||
Dim servertime As String = Format(Now, "yyyy-MM-dd HH:mm:ss")
|
||||
Dim UseriNfo As ArinLogin.ArinLOgin.User_Info
|
||||
If tb_id.Text.StartsWith("guest") Then
|
||||
UseriNfo = New ArinLogin.ArinLOgin.User_Info()
|
||||
@@ -99,6 +100,8 @@
|
||||
Else
|
||||
Work_msg("서버 응답을 기다리는중")
|
||||
Dim L As New ArinLogin.ArinLOgin
|
||||
|
||||
servertime = L.Get_ServerTime()
|
||||
pLog.Add(String.Format("Login Try ID = {0}", tb_id.Text))
|
||||
UseriNfo = L.Check_user("eco_user", Me.tb_id.Text, Me.tb_pw.Text)
|
||||
Work_msg("")
|
||||
@@ -108,8 +111,11 @@
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim authtype As String = UseriNfo.authtype
|
||||
If authtype.StartsWith("BOTH_C_") Then authtype = "BOTH"
|
||||
|
||||
Select Case UseriNfo.authtype
|
||||
|
||||
Select Case authtype
|
||||
Case "IP"
|
||||
If Me.tb_id.Text.ToLower() <> "guest" AndAlso Not Me.tb_id.Text.ToLower().StartsWith("user") Then
|
||||
If Prj.CUrIP.ToUpper <> UseriNfo.authip.ToUpper AndAlso UseriNfo.authip <> "0.0.0.0" Then
|
||||
@@ -164,15 +170,30 @@
|
||||
|
||||
pLog.Add(String.Format("Login OK ID={0}", Me.tb_id.Text))
|
||||
|
||||
Prj.LoginTime = Format(Now, "yyyy-MM-dd HH:mi:ss")
|
||||
|
||||
|
||||
Prj.LoginTime = servertime '/ Format(Now, "yyyy-MM-dd HH:mi:ss")
|
||||
Prj.UserId = Me.tb_id.Text
|
||||
Prj.UserPass = Me.tb_pw.Text
|
||||
If Me.tb_id.Text.ToLower() = "guest" Then
|
||||
Prj.UserAuthType = "BOTH0"
|
||||
Prj.UserAuthType_Real = "BOTH0"
|
||||
ElseIf Me.tb_id.Text.ToLower().StartsWith("user") Then
|
||||
Prj.UserAuthType = "BOTH"
|
||||
Prj.UserAuthType_Real = "BOTH"
|
||||
Else
|
||||
Prj.UserAuthType = UseriNfo.authtype
|
||||
If Prj.UserAuthType.StartsWith("BOTH_C_") Then
|
||||
Prj.UserAuthType = "BOTH"
|
||||
'//server time
|
||||
Dim stime As String = Prj.LoginTime.Substring(0, 7).Replace("-", "").Trim()
|
||||
Dim ctime As String = UseriNfo.authtype.Substring(7).Trim()
|
||||
If String.Compare(ctime, stime) < 0 Then
|
||||
MsgBox("사용기간이 경과되어 로그인이 불가합니다", MsgBoxStyle.Critical, "확인")
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
Prj.UserAuthType_Real = UseriNfo.authtype
|
||||
End If
|
||||
|
||||
Save_SEtting()
|
||||
|
||||
20
ArinWarev1/Forms_Basic/frm_batch.Designer.vb
generated
20
ArinWarev1/Forms_Basic/frm_batch.Designer.vb
generated
@@ -27,6 +27,7 @@ Partial Class frm_batch
|
||||
Me.btcalc = New System.Windows.Forms.Button()
|
||||
Me.prb1 = New System.Windows.Forms.ProgressBar()
|
||||
Me.chkMyoun = New System.Windows.Forms.CheckBox()
|
||||
Me.Button1 = New System.Windows.Forms.Button()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'tbPath
|
||||
@@ -48,7 +49,7 @@ Partial Class frm_batch
|
||||
'
|
||||
'btcalc
|
||||
'
|
||||
Me.btcalc.Location = New System.Drawing.Point(12, 83)
|
||||
Me.btcalc.Location = New System.Drawing.Point(12, 57)
|
||||
Me.btcalc.Name = "btcalc"
|
||||
Me.btcalc.Size = New System.Drawing.Size(726, 39)
|
||||
Me.btcalc.TabIndex = 2
|
||||
@@ -58,7 +59,7 @@ Partial Class frm_batch
|
||||
'prb1
|
||||
'
|
||||
Me.prb1.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.prb1.Location = New System.Drawing.Point(0, 146)
|
||||
Me.prb1.Location = New System.Drawing.Point(0, 154)
|
||||
Me.prb1.Name = "prb1"
|
||||
Me.prb1.Size = New System.Drawing.Size(750, 25)
|
||||
Me.prb1.TabIndex = 4
|
||||
@@ -66,18 +67,28 @@ Partial Class frm_batch
|
||||
'chkMyoun
|
||||
'
|
||||
Me.chkMyoun.AutoSize = True
|
||||
Me.chkMyoun.Location = New System.Drawing.Point(449, 12)
|
||||
Me.chkMyoun.Location = New System.Drawing.Point(427, 24)
|
||||
Me.chkMyoun.Name = "chkMyoun"
|
||||
Me.chkMyoun.Size = New System.Drawing.Size(88, 16)
|
||||
Me.chkMyoun.TabIndex = 5
|
||||
Me.chkMyoun.Text = "입력면 추출"
|
||||
Me.chkMyoun.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button1
|
||||
'
|
||||
Me.Button1.Location = New System.Drawing.Point(12, 101)
|
||||
Me.Button1.Name = "Button1"
|
||||
Me.Button1.Size = New System.Drawing.Size(726, 39)
|
||||
Me.Button1.TabIndex = 6
|
||||
Me.Button1.Text = "히트펌프비율계산"
|
||||
Me.Button1.UseVisualStyleBackColor = True
|
||||
'
|
||||
'frm_batch
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(750, 171)
|
||||
Me.ClientSize = New System.Drawing.Size(750, 179)
|
||||
Me.Controls.Add(Me.Button1)
|
||||
Me.Controls.Add(Me.chkMyoun)
|
||||
Me.Controls.Add(Me.prb1)
|
||||
Me.Controls.Add(Me.btcalc)
|
||||
@@ -94,4 +105,5 @@ Partial Class frm_batch
|
||||
Friend WithEvents prb1 As System.Windows.Forms.ProgressBar
|
||||
Public WithEvents tbPath As System.Windows.Forms.TextBox
|
||||
Public WithEvents chkMyoun As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents Button1 As System.Windows.Forms.Button
|
||||
End Class
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Public Class frm_batch
|
||||
|
||||
Public heatpumpcalc As Boolean = False
|
||||
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles btPath.Click
|
||||
Dim fd As New FolderBrowserDialog()
|
||||
If fd.ShowDialog() = Windows.Forms.DialogResult.OK Then
|
||||
@@ -26,7 +27,7 @@
|
||||
Return
|
||||
End If
|
||||
|
||||
|
||||
heatpumpcalc = False
|
||||
DialogResult = Windows.Forms.DialogResult.OK
|
||||
|
||||
|
||||
@@ -35,4 +36,27 @@
|
||||
Private Sub frm_Macro_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click_1(sender As System.Object, e As System.EventArgs) Handles Button1.Click
|
||||
'//calc
|
||||
Dim di As New System.IO.DirectoryInfo(tbPath.Text)
|
||||
If di.Exists = False Then
|
||||
MsgBox("no folder")
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim files1() As System.IO.FileInfo
|
||||
Dim files2() As System.IO.FileInfo
|
||||
|
||||
files1 = di.GetFiles("*.tpl", IO.SearchOption.TopDirectoryOnly)
|
||||
files2 = di.GetFiles("*.tplx", IO.SearchOption.TopDirectoryOnly)
|
||||
|
||||
If files1.Length < 1 AndAlso files2.Length < 1 Then
|
||||
MsgBox("no file")
|
||||
Return
|
||||
End If
|
||||
|
||||
heatpumpcalc = True
|
||||
DialogResult = Windows.Forms.DialogResult.OK
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user