Xml Inst2 Page - Complete Education



Similar documents
ResPage.aspx. Imports System.IO Imports System.Xml Imports System.Xml.XPath Imports System.Xml.Xsl Imports PDFDocScout

Be06. Public Shared v_win_rf As String = "38.6." Public Shared improvement As String = ".01"

Visual Web Development

Form Tasarımı - 5. Veri Tabanı Veri tabanı ismi; m Tablo ismi; mt

CRM Setup Factory Installer V 3.0 Developers Guide

CRYSTAL REPORTS IN VISUAL STUDIO.NET 2003

ClientAce WPF Project Example

ResellerPlus - Bulk Http API Specification. (This Document gives details on how to send messages via the Bulk HTTP API for the RouteSms SMPP System)

Hands-On Lab. Client Workflow. Lab version: Last updated: 2/23/2011

How To: Create a Crystal Report from ADO.NET Dataset using Visual Basic.NET

Many applications consist of one or more classes, each containing one or more methods. If you become part of a development team in industry, you may

Lab 8: ASP.NET 2.0 Configuration API and Health Monitoring

VB.NET - WEB PROGRAMMING

Ambientes de Desenvolvimento Avançados

(Ch: 1) Building ASP.NET Pages. A. ASP.NET and the.net Framework B. Introducing ASP.NET Controls C. Adding Application logic to an ASP.

webcrm API Getting Started

Hi, processing. Code of the vb.net version. Imports System.Data Imports System.Data.SqlClient

Changing the Display Frequency During Scanning Within an ImageControls 3 Application

Introduction. Why (GIS) Programming? Streamline routine/repetitive procedures Implement new algorithms Customize user applications

STUDENTS ATTENDANCE MANAGEMENT SYSTEM MINI PROJECT REPORT. Submitted by. KALAISANKARAN B Roll No: 11MCA020

EViews Database Extension Interface

The VB development environment

Module 6: Validating User Input

Business Rule Based Configuration Management and Software System Implementation Using Decision Tables

TRANSITION FROM TEACHING VB6 TO VB.NET

bbc Developing Applications Using Interapplication Communication Adobe Acrobat SDK November 2006 Version 8.0

(Document Version 1.4) (This Document gives details on how to send messages via the Bulk HTTP API for the RouteSms SMPP System)

Appendix B - VoIP SARRA Source Codes and Cisco XML Objects

National Database System (NDS-32) Macro Programming Standards For Microsoft Word Annex - 8

Visual Basic Programming. An Introduction

'========================================================================== ==== Scans a range of A/D Input Channels

USER GUIDE Appointment Manager

Códigos fuentes aplicativo Agenda con VB.NET

THE SET ANALYSIS. Summary

GetLibraryUserOrderList

Design of Conveyor Monitoring Controller with Wireless System

OnTime Web Services User Guide

Introduction to Python

a) What is the major difference between a program that runs under a virtual machine vs. one that does not?

Our server platform consists of Microsoft Windows 2008 servers with SQL Server 2005 which are under 24/24 monitoring.

DEVELOPING CONTRACT - DRIVEN WEB SERVICES USING JDEVELOPER. The purpose of this tutorial is to develop a java web service using a top-down approach.

VB.NET - DATABASE ACCESS

Deleting A Record Updating the Database Binding Data Tables to Controls Binding the Data Table to the Data Grid View...

HEAT PUMPS AS A LINK BETWEEN INDUSTRY AND DISTRICT HEATING

Secure Mail. Detailed Technical Information & In Depth of Understanding of Application. SY Chua SYWORKS PROGRAMMING

Kepware Technologies ClientAce: Creating a Simple Windows Form Application

Visual Basic 2010 Essentials

SPARROW Gateway. Developer API. Version 2.00

ComponentOne. Windows for WPF

Tracing and Debugging in ASP.NET

All of my instructors showed a true compassion for teaching. This passion helped students enjoy every class. Amanda

Principles of Database Management Systems. Overview. Principles of Data Layout. Topic for today. "Executive Summary": here.

A Microsoft Access Based System, Using SAS as a Background Number Cruncher David Kiasi, Applications Alternatives, Upper Marlboro, MD

TUTORIAL. BUILDING A SIMPLE MAPPING APPLICATION

Hands-On: Introduction to Object-Oriented Programming in LabVIEW

Scanner. It takes input and splits it into a sequence of tokens. A token is a group of characters which form some unit.

ACE 2011 International. Role Based Clients. aras.com

e ag u g an L g ter lvin v E ram Neal G g ro va P Ja

Introduction to Visual Basic and Visual C++ Database Foundation. Types of Databases. Data Access Application Models. Introduction to Database System

Hands-On Lab. Building a Data-Driven Master/Detail Business Form using Visual Studio Lab version: Last updated: 12/10/2010.

Creating Reports Using Crystal Reports

NiceLabel WebSDK Programming Guide

Chapter 12: How to send with one attached file by WP-8xx7, XP-8xx7-CE6, VP-2xW7, Wincon-8xx7 or ipac-8447 / 8847 or upac-7186eg?

Informatica Cloud Connector for SharePoint 2010/2013 User Guide

Masters programmes in Computer Science and Information Systems. Object-Oriented Design and Programming. Sample module entry test xxth December 2013

Best Practices: ediscovery Search

Moving from C++ to VBA

Color Screen Phones: SIP-T48G and SIP-T46G with firmware version 73

LINQ: Language Integrated Query. ST Colloquium, Tom Lokhorst

Advanced Workflow Concepts Using SharePoint Designer 2010

Business Requirements Document. BCBP Passenger Data exchange using the 2D Barcode. Version March 2009

Software Developer Guide

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.


CSE 1223: Introduction to Computer Programming in Java Chapter 7 File I/O

CHAPTER 9: DATAPORT AND XMLPORT CHANGES

AdFalcon Android SDK Developer's Guide. AdFalcon Mobile Ad Network Product of Noqoush Mobile Media Group

TITLE PAGE WEB BASED APPLICATION FOR INSURANCE SERVICES CASE STUDY OF THE INSURANCE COMPANY ESEDEBE FIDELIA OGECHUKWU (CST/2009/333)

Distributed Text Mining with tm

Virtual Fax API User Guide

Package hive. January 10, 2011

VB.NET Programming Fundamentals

ASP.NET Dynamic Data

Getting Started with STATISTICA Enterprise Programming

Autotask Web Services API. API Version 1.1

Transcription:

Imports System.Xml Inst2Page.aspx Partial Class Inst2Form Inherits System.Web.UI.Page Protected Sub InitVent(ByRef XMLDoc As XmlDocument) For Each elem As String In Std.ventType Type1.Items.Add(elem) Dim n0 As XmlNode Dim Elements As XmlNodeList = XMLDoc.GetElementsByTagName("VENTILATION") For Each n0 In Elements Dim part As Integer = n0.item("part").innertext Dim typ As Integer = Std.GetTyp(part) Dim im As Integer = Std.GetImp(part) Type1.SelectedIndex = typ Protected Sub UpdateVent(ByRef XMLDoc As XmlDocument) Dim i0 As Integer = Type1.SelectedIndex Be06.UpdateVent(XMLDoc, i0) Protected Sub ShowDistHt() For Each elem As String In Std.DistHt Protected Sub ShowBoiler(ByVal type As Integer) If type > 11 Then Loss.Text = "0" Loss.Text = CType(Session("boiler_loss"), String) Dim elem As String Type2.Items.Clear() Select Case type Case 0, 2 For Each elem In Std.BoilerGroup_02 Case 1, 3 For Each elem In Std.BoilerGroup_13 Case 4 For Each elem In Std.BoilerGroup_4 Case 5 For Each elem In Std.BoilerGroup_5 Case 6 For Each elem In Std.BoilerGroup_6 Case For Each elem In Std.BoilerGroup_7 Side 1

End Select Inst2Page.aspx Protected Sub InitHeating(ByRef xml As XmlDocument) For Each elem As String In Std.VpType VpType.Items.Add(elem) Dim item As String = Be06.GetElement(xml, "BOILER", "id") Dim heat As Integer = Be06.GetHeatType(xml) If heat = 1 Then HeatType.Text = "Fjernvarme" ShowDistHt() VpType.Enabled = True Type2.SelectedValue = item Boiler.Items.Add("Intet valg") Boiler.Visible = False If heat = 0 Then VpType.Enabled = True Dim fuel_oil As Boolean = Be06.FuelOil(xml) If fuel_oil Then HeatType.Text = "Oliekedel" For Each elem As String In Std.BoilerType Boiler.Items.Add(elem) Dim group As Integer = Be06.GetElement(xml, "DESCRIPT", "id") If group < 0 Then Dim year As Integer = CType(Session("year"), Integer) group = Std.BoilerGroup(year) Boiler.SelectedIndex = group ShowBoiler(group) Type2.SelectedValue = item SelBoiler.Visible = True LabelLoss.Visible = True Loss.Visible = True HeatType.Text = "Gaskedel" For Each elem As String In Std.GasBoilerType Type2.SelectedValue = item Boiler.Visible = False HeatType.Text = "El" Type2.Items.Add("Intet valg") Type2.Enabled = False VpType.Enabled = True Boiler.Items.Add("Intet valg") Boiler.Visible = False Dim ht_sup As Integer = CType(Session("heat_sup"), Integer) Dim fu_sup As Integer = CType(Session("fuel_sup"), Integer) Dim cons_sup As String = CType(Session("cons_sup"), String) If cons_sup.length < 1 Then ConsSup.Text = "0" If ht_sup > 0 Then HeatSup.Text = Std.NameSupFuel(fu_sup) ConsSup.Enabled = True ConsSup.Text = cons_sup HeatSup.Text = "Ingen supplerende opvarmning" ConsSup.Enabled = False ConsSup.BackColor = Drawing.Color.LightGray Side 2

Protected Sub UpdateHeating(ByRef xml As XmlDocument) Dim i0 As Integer = Type2.SelectedIndex Dim id0 As String = Type2.SelectedItem.Text Dim ht_type = Be06.GetHeatType(xml) Select Case ht_type Case 0 ' kedel If Be06.FuelOil(xml) Then Dim i2 As Integer = Boiler.SelectedIndex Be06.UpdateBoiler(xml, Std.oil2_table, i2, id0) Be06.EditModel(xml, "DESCRIPT", "id", i2) ' boiler group Session.Item("boiler_loss") = Loss.Text Be06.UpdateBoiler(xml, Std.gas_table, i0, id0) Case 1 ' fjernvarme Be06.UpdateDistHt(xml, i0) Case 2 ' el End Select Be06.EditModel(xml, "COOLING", "id", Loss.Text) Be06.EditModel(xml, "BOILER", "id", Type2.SelectedItem.Text) Be06.EditModel(xml, "DESCRIPT", "bbr", ConsSup.Text) ' Consumption sup Session.Item("cons_sup") = ConsSup.Text Protected Sub ShowSolarPanel(ByRef xml As XmlDocument) Svtype.Items.Clear() For Each elem As String In Std.SunColType Svtype.Items.Add(elem) Dim active As Boolean = Be06.IsTrue(Be06.GetElement(xml, "BUILDING", "solarpanel")) Area.Text = Be06.GetElement(xml, "SOLAR_COLLECTOR", "area").replace(".", ",") Orient.Text = Be06.GetElement(xml, "SOLAR_COLLECTOR", "orient").replace(".", ",") Slope.Text = Be06.GetElement(xml, "SOLAR_COLLECTOR", "slope").replace(".", ",") Dim type As String = Be06.GetElement(xml, "SOLAR_COLLECTOR", "has_type") If Not active Then Svtype.SelectedIndex = 0 If type = ".K_TYPE." Then Svtype.SelectedIndex = 2 Svtype.SelectedIndex = 1 VpType.SelectedIndex = Session.Item("heatpump") Session.Item("hp_ex") = VpType.SelectedIndex Protected Sub UpdateSolarPanel(ByRef xml As XmlDocument) Dim hpump As Integer = VpType.SelectedIndex Session.Item("heatpump") = hpump Be06.UpdateHeatPump(xml, hpump) Dim a0 As Double = Area.Text.Replace(".", ",") Dim col As Integer = Svtype.SelectedIndex Be06.EditModel(xml, "BUILDING", "solarpanel", Be06.GetBool(col > 0 And a0 > 0.0)) Dim n0 As XmlNode Dim Elements As XmlNodeList = xml.getelementsbytagname("solar_collector") For Each n0 In Elements n0.item("area").innertext = Area.Text.Replace(",", ".") n0.item("orient").innertext = Orient.Text.Replace(",", ".") n0.item("slope").innertext = Slope.Text.Replace(",", ".") If col > 1 Then n0.item("has_type").innertext = ".K_TYPE." n0.item("has_type").innertext = ".B_TYPE." Side 3

If Area.Text > 0.0 Then If hpump < 1 Then If col = 1 Then ' brugsvand Be06.EditModel(xml, "DHW_TANK", "vol", "192") Be06.EditModel(xml, "DHW_TANK", "heat_loss", "2.7") Be06.EditModel(xml, "DHW_TANK", "vol", "400") Be06.EditModel(xml, "DHW_TANK", "heat_loss", "3.2") Be06.EditModel(xml, "DHW_TANK", "has_el_heat", ".DHW_S.") Be06.EditModel(xml, "DHW_TANK", "solar_heat", ".T.") If hpump < 1 Then Be06.EditModel(xml, "DHW_TANK", "vol", "60") Be06.EditModel(xml, "DHW_TANK", "heat_loss", "0.9") Be06.EditModel(xml, "DHW_TANK", "has_el_heat", ".DHW_N.") Be06.EditModel(xml, "DHW_TANK", "solar_heat", ".F.") Protected Function GetData(ByRef data As String) As String Dim m0 As Integer = data.indexof(";") Dim str As String = data.substring(0, m0) data = data.substring(m0 + 1) str End Function Protected Function UpdateBuildingData(ByRef xml As XmlDocument, ByVal cons As String) As Boolean Dim data As String = Be06.GetElement(xml, "COMMENTS", "id") Try If data.length > 0 Then Dim id As String = GetData(data) If id = Be06.model_id Then For i = 1 To 5 Dim parm0 As String = GetData(data) id += ";" + parm0 Dim parm As String = GetData(data) id += ";" + cons id += ";" + data True Catch ex As Exception End Try False End Function Be06.EditModel(xml, "COMMENTS", "id", id) Protected Sub Dim ex As Integer = CType(Session("exist"), Integer) Dim xml2 As String = CType(Session("savexmldoc"), String) Dim xml As XmlDocument = New XmlDocument If ex > 0 Then xml = CType(Session("xmldoc"), XmlDocument) xml.loadxml(xml2) UpdateVent(xml) UpdateSolarPanel(xml) UpdateHeating(xml) UpdateBuildingData(xml, Consumption.Text) Dim kr As Double = CType(Session("eprice"), Double) Dim el_price As Double = CType(Session("el_price"), Double) Dim ht As Integer = CType(Session("heating"), Double) Dim xml0 As String = xml.outerxml Side 4 ' Bygningsdata

If ex < 1 Then Dim no_change As Boolean = xml0.equals(xml2) If no_change Then Session.Item("exist") = 2 Session.Item("xmldoc") = xml Dim price, el0 As Double Dim dem As Double = Be06.GetDemand(xml, kr, el_price, price, el0) Dim std_cons = Be06.GetConsUnit(ht, dem - el0) ' forbrug i valgte enhed/m2 If Math.Abs(std_cons) < 0.001 Then std_cons = dem Session.Item("consump") = Consumption.Text Session.Item("consump_kr") = Consumption.Text * kr Session.Item("std_cons0") = std_cons Session.Item("cons0") = dem Session.Item("last_kwh") = dem Session.Item("last_kr0") = price Session.Item("el0") = el0 Session.Item("kr0") = price Session.Item("savexmldoc") = xml0 Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init If Not Page.IsPostBack Then Dim ex As Integer = CType(Session("exist"), Integer) Dim ht As Integer = Session("heating") Dim tmp As String = "" Be06.ShowCons(ht, Cons.Text, tmp) Dim cons0 As String = CType(Session("consump"), String) Consumption.Text = cons0 Dim xml As XmlDocument = New XmlDocument If ex > 0 Then xml = CType(Session("xmldoc"), XmlDocument) Dim doc As String = CType(Session("savexmldoc"), String) xml.loadxml(doc) InitVent(xml) InitHeating(xml) ShowSolarPanel(xml) Protected Function CheckVars() As Boolean Dim ok As Boolean = True Message.Text = "" If Not Be06.IsNum(Loss.Text) Then Message.Text += " Røggastab" Dim ls As Double = Loss.Text If ls < 0.0 Or ls > 50.0 Then Message.Text += " Ikke tilladt røggastab" If Not Be06.IsNum(Consumption.Text) Then Message.Text += " Varmeforbrug" If Not Be06.IsNum(ConsSup.Text) Then Message.Text += " Varmeforbrug, supplerende" Side 5

If Not Be06.IsNum(Area.Text) Then Message.Text += " Areal" If Not Be06.IsNum(Slope.Text) Then Message.Text += " Hældning" If Not ok Then Message.Text += " er udefineret." ok End Function Protected Sub RedirSession(ByRef link As String) If CheckVars() Then Page.Response.Redirect(link) Protected Sub ButtonBack_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonBack.Click RedirSession("WinexPage.aspx") Protected Sub Button_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button.Click RedirSession("WallPage.aspx") Protected Sub ImageAbout_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageAbout.Click Session.Item("PrevPage") = "Inst2Page.aspx" Page.Response.Redirect("AboutPage.aspx") Protected Sub ImageHelp_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageHelp.Click Session.Item("PrevPage") = "Inst2Page.aspx" Page.Response.Redirect("HelpPage.aspx") Protected Sub ImageMain_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageMain.Click RedirSession("Default.aspx") Protected Sub ImageWall0_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageWall0.Click RedirSession("EnvPage.aspx") Protected Sub ImageWin0_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageWin0.Click RedirSession("WinexPage.aspx") Protected Sub ImageWall1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageWall1.Click RedirSession("WallPage.aspx") Protected Sub ImageWin1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageWin1.Click RedirSession("WinPage.aspx") Side 6

Protected Sub ImageInst1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageInst1.Click RedirSession("Install2Page.aspx") Protected Sub ImageDoc_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageDoc.Click RedirSession("ResPage.aspx") Protected Sub Boiler_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Boiler.SelectedIndexChanged ShowBoiler(Boiler.SelectedIndex) Protected Sub Check_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Check.Click If CheckVars() Then Dim ht As Integer = Session("heating") Dim area As Double = CType(Session("area"), Double) Dim cons0 As Double = CType(Session("std_cons0"), Double) cons0 = Math.Round(area * cons0, 0) Dim unit As String = Be06.Unit(ht) Dim cons As Double = CType(Consumption.Text, Double) Dim dif As Double = Math.Round(100.0 * (cons - cons0) / cons0, 0) dif = Math.Abs(dif) Message.Text = "Teoretisk varmeforbrug: " & cons0 & " " & unit & " + opgivet biobrændsel. Opgivet forbrug afviger " & dif & "%" Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click RedirSession("http://tools.sparolie.dk/positivliste.asp") End Class Side 7