Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer...

112
Web-based Application Development using a MEDITECH Data Repository & Microsoft Visual Web Developer 2005 Glen R. D’Abate Acmeware, Inc. www.acmeware.com

Transcript of Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer...

Page 1: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Web-based Application Development

using a MEDITECH Data Repository &

Microsoft Visual Web Developer 2005

Glen R. D’Abate

Acmeware, Inc.

www.acmeware.com

Page 2: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Course Agenda

Introduction & History

Course Overview and Objective

Web Developer Implementation and Interact

Development Environment (IDE)

Using Web Developer Data Bound Controls

Example Project – Downtime Patient

Registration using the Data Repository

Questions & Discussions

Page 3: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Acmeware / Data Repository

History

Instructor background

Acmeware, Inc.

Recent Acmeware Application

Development Strategies (Access, Visual

Basic, Visual C++, Visual InterDev)

Why Visual Web-Developer 2005

Page 4: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Course Format

PowerPoint Presentation to keep me on Track

Demonstrate Concepts using active session of Visual Web Developer 2005

Demonstrate a Downtime Registration Routine that was written using Visual Web Developer

Encourage Questions and Comments During the Training

Page 5: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Objective

Be able to rapidly develop and deploy web-based applications that make use of the DR

Make these applications look, feel, and act like professionally developed web-based products

Minimize the need to develop code that has to be supported

Use application data marts with data derived from the DR

Page 6: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Don’t Reinvent the Web-Wheel

Web-Application programming tools from

Microsoft have been iffy at best Front-Page has limitation building a robust interactive

environment and database manipulation

Visual InterDev (Visual Studio 6.0 was a bust)

Other Products exist (e.g., Cold Fusion)

but we’ve tried to stay all Microsoft

Visual Web-Developer Finally brings all

of the pieces together!

Page 7: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Helpful Prerequisites

Familiarity with MEDITECH HCIS

Familiarity with Data Repository (we are using MEDITECH’s but applies to MSM or TSG)

Knowledge of SQL Server or RDMS

Web design basics (HTML tags…)

Programming experience (C# or Visual Basic are ideal, but we won’t be doing much anyway)

Familiarity with Microsoft development environments

Object Oriented Programming (i.e., Attributes, Methods, Events)

Page 9: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Section #1

Installing Visual Studio Web Developer 2005 Express Edition &

Reviewing its Interactive Development Environment

Page 10: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

About Visual Web Developer

Express 2005

Microsoft's Words: Easy to Use Fun Easy to Learn

Location where Visual

Web Developer can be

downloaded

Page 11: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Installing Web Developer

Typical Microsoft

Application Installation

Wizard

Page 12: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

MSDN Provides Product

Documentation

SQL Server 2005 Express

Provides a Location to Build

Databases – We will use the DR

on a SQL Server 2000 Platform

Page 13: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Put aside a solid

hour to download

and install software

You must register

software or you can

only use it for 30 days

Visual Studio 8, ASP.NET

2.0 and SQL Server 2005

appear to run fine along

side of SQL Server 2000,

Visual Studio 7, and

ASP.NET 1.1

Page 14: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Launching Web Developer

Visual Web Developer and

Microsoft SQL Server 2005 will

be added to the Startup menu

Page 15: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Default Start Page

Microsoft Related News

MRU List

Other

Resources

Page 16: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Creating a New Web Form App

From Toolbar Menu,

Select New Web Site

Name the Web

Site Project

Select Language – For This

Course It Hardly Matters buy

we will Choose C# (VB or J#)

New Web Site Dialog

Page 17: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Web Developer New Project

Toolbox

Error List Property

Solutions Explorer

Page Design View(s)

Toolbars

Menu Bar

Design Views

Available for a

Specific Page

Page Tabs

Page 18: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Visual Studio File Locations

Project

Control

Files

Project

Pages

Page 19: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Demonstration #1 – Setting Up

Empty Project & Reviewing IDE

Page 20: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Section #2

IDE Details & Our First Application

“MUSE IS GREAT”

Page 21: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

In This Section

Take a brief look under the hood of ASP.NET 2.0 and Web Application Processing

Add a Label and Button objects to a Web Page and modify object properties

Discuss Debugging Web Applications

Take a more detailed look at the IDE focusing on where and how code is entered

Create our first interactive Web Application project

Page 22: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

What Happens When We

Running a Web Application? A page “request” is made to the web server based on some

action (e.g., default page opening, button selected, drop-

down box changed, etc.)

A page response is “served” from the web-server

(development server or IIS) to the client’s browser

In the process of serving the page, the code we develop for

a web page is essentially converted into a “mini-application”

that runs from beginning to end within the client’s browser in

milliseconds (as opposed to a typical executable)

The mini-application is constructed as HTML code using: HTML code we have placed on the page Server side objects we’ve place on the page Event handlers that are responding to an action that caused the page request

(e.g., selected a button) State information about the Application or Session that is stored on the server or

passed with the Page request

Page 23: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Design View with Objects

Button Object

Label Object

Label

Properties

Web Pages

Start Debugging

Drag & Drop objects

from Toolbox to Design

View

Page 24: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Debugging a Web Application

Visual Web Developer Express includes a Development Web Server that runs on a local system (no need for IIS)

This development web-server is completely secure to outside world (i.e., network attack)

Web.config file

is required for

debugging

Development server can be seen in

notification area application icons

Page 25: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

More on Debugging

Powerful debugging and

tracing capabilities beyond

the scope of this course

ASP.NET 2.0 Web Site

Administration Tool

Page 26: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Source View of Web Page

HTML tags and Active Server Page (ASP) server

control code for those who are familiar

Runtime Engine

used to translate

ASP.NET 2.0

Code to HTML

Everything in Design View is

represented in Source View code –

nothing is hidden

Page 27: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

View of Web App in Browser

Development server can be

seen in address window

Page Objects

The Web Page is “Posted” to the client

initially. User action in the Web Page

(e.g., pressing a button) can result in a

“Post Back” of the current Page or

initiation of a new Page

Page 28: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

HTML Code Behind Web App

HTML Code

Input type of “submit”

creates a Button

Button Text

Absolute

Positioning

Label Text

ASP.NET “State” Information kept in

__VIEWSTATE as a hidden object.

An example would be data already

entered in a textbox control.

Page 29: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Code Behind

Double Mouse-Click on Object

to Bring up “Code Behind”

“Code Behind” can exist in .aspx file

(traditional), or in a dependant

aspx.cs file as shown here

Code Behind is processed

based on an event and is

used to construct the Page

Response in original Page

or Post Back

Page 30: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Code Behind Revealed

Looks Like DHTML

Code for those familiar

Also looks like Access

Event Handlers

The using statement is

similar to “Import” in VB

and is used by Intellisense

and the compiler

Intellisense brings up

“Text” property for

infoLabel Label object

This is about the extent of

“programming” we will

perform in this course

Page 31: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Intellisense & Tool Tips

Property

C# syntax

requires “;”

Intellisense brings

objects as well as

object attributes

and methods

Mouse over brings

up tool tip with

valuable information

Page 32: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Demonstration #2 – “Muse Is

Great” Application

Page 33: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Section #3

More on Web Controls, Web

Formatting, & Adding User

Interface Validation

Page 34: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

In This Section:

Load Several new Controls onto our

Web Page and Discuss Commonly used

Attributes and Methods

Use the Visual Studio Tools to Layout

our Page

Create a Mini Provider Dictionary Form

Add Data Validation Testing to Our Form

Page 35: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Add a new Web Page to Project

Select Web

Form Again

Name it

Again, We’ll

Select C#, But it

Hardly Matters

We Will Place the Code in

a Separate aspx.cs File

Many Types of File Templates are

Available. We Will Only Look at a Few

Page 36: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Provider Dictionary Controls

New Files

Our Provider Dictionary

Will Collect the

Following Information:

1. Provider Name,

Page 37: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Relative Versus Absolute Positioning

Layout Controls

Position Controls

Absolute Positioning Allows Object to

Be Placed Anywhere on Page

Page 38: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Formatting Objects on the Page

Format Controls

Left Aligned

Evenly

Spaced

Always Set

ID Property

Objects Added to

our Test Page

Page 39: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

CheckBox Properties

Set Default Value

Name Object (New Convention Uses

Descriptive Name Followed By Object Type)

Page 40: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Drop Down Control Quick Tasks Button Allows Easy

Access to Attributes and Methods

DropDownList Objects use

ListItem Collections. This

Dialogue is Available to

Hardcode Values into the

ListItem Collection.

Enter a Default Value of

“-SELECT-” to Prompt

User to Make An Entry

Data Can be Entered Directly using Edit

Items, or Can Be Derived From a Data

Source (e.g. the Data Repository)

Return a

Numeric Value

Page 41: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Radio Buttons for Specialties

RadioButtonList Also Uses a

ListItem Collection

RadioButtonList by Default

Forms a Group So The System

Knows that When Any Radio

Button Is Toggled On, All Other

Items in the Group Should be

Toggled Off

Page 42: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Provider Dictionary So Far –

in the Browser

No Default Value Entered

-SELECT- Entry (0)

Defaults to Active As Defined

Our Page Doesn’t

Really Do Anything Yet!

Page 43: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Data Validation Controls –

Required Field Validation

Validation

Controls

Entry for

Provider Is

Required

Text Attribute Determines What

Displays In Validation Control

Select Control to Which The

Validation Control is Validating

Page 44: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Compare Validation Control

Compares Selection with

Default Value of “-SELECT-

” to be Certain Selection is

Made

Page 45: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Summary Validation Control

A Summary Validation

Control is Used to

Consolidate All Errors

in a Single Place on

The Page

A Summary Validation Control is Used by the

Error Text Attribute of other Validation

Controls to Determine the Error Message

Page 46: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Demonstration #3 – Form Controls

and Data Validation

Page 47: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Section #4

Web Application State and the

Persistence of Data

Page 48: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

In This Section

Discuss the Page Objects and the Major

Component Objects that Comprise the

Page

Review PostBack And How Data Is

Automatically Passed From Page to Page

Review Three Mechanisms to Maintain

State Variables in Your Application

Page 49: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Page Object - Components

Request Object (Information about the request from the web-browser. Data in an address bar, browser type, data in http://get, etc.)

Response & Form Object (Information sent back out to the web page in response to the users request. (e.g. Response.Write, Response.Redirect).

ViewState Object (Keeps a Page’s state values as it is posted back from the server

Application Object (Information about the application as a whole)

Session Object (Information about activity from a specific user at a specific time on our web site)

Page 50: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Request Object

Information in the Request object can be

seen by entering it in TextBoxes and

displaying this information on a Page

Request Object attributes can be used to

determine what action to take in Event

handler code. An application could be

written to function differently for a “super

user” and a regular user using the

Request object

Page 51: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Response Object

The Response Object is

used generally to

invoke its methods and

perform some response

action to a users event

input action

Redirect it is a

PostBack to this Page

Objects on Response.aspx

example Page First Post of Response

Page in browser

Page Load

Event

Page 52: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Objects Maintaining State

This Event Handler Explains How

Label Gets Value

What Explains Why the TextBoxes Still

Have Their Values After PostBack

Page 53: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

__ViewState

__ViewState Keeps state

information on Page objects.

This can be used to maintain

continuity in the application __ViewState is also be used by

the server to identify changes in

values and trigger events!

__ViewState coded value

encapsulating controls & values

Page 54: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Testing Variable State App

We will create this application

four times over the next few

slides, each time demonstrating

how we maintain state from Page

to Page in our application

When UP is selected, counter

increments. When DOWN is

selected, counter decrements.

Page 55: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Creating ViewState Variables

Code behind of ViewState application with Three

events to perform actions based on the event

During page initialization (i.e., when

not PostBack, create the __ViewState

variable called “Counter” and set it to

a value of zero

Increment Counter variable

Decrement Counter variable

Page 56: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Counter Application with ViewState

The hidden __VIEWSTATE

object on the web page contains

information about the controls

and their values (including the

counter) so that when the Page

is Posted Back,

VIEWSTATE encrypted value has the state information of the current page

which is compared with the objects during a Page Request to determine if

something has changed (e.g. button pressed signaling a button select event)

Page 57: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Application & Session Variables

Application and Session Variables are

kept on the Web Server in memory

There is a special file named

Global.aspx where Application and

Session variables can be initialized

Application and Session variables are

“Added” to the Application and Session

objects using the .Add() method and

retrieved using the .Get() method

Page 58: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Creating Session Variable

Looks & Functions the same as

the __VIEWSTATE solution, but

rather than passing the values

back and forth between Pages,

the Session Counter value is

maintained on the Web Server

Session Object Initialized

when Page is first posted

Page 59: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Session Variable Counter

Counter will be set to zero for each user session

on this web application and incremented or

decremented based on the button selected

Page 60: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Global Application Class

The Global Application Class

file gives us access to initialize

and clean up Session or

Application variables

Page 61: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Global.aspx Events Five Global events

where code can be

entered

Session Start & End

Application Start & End

Application Error Handling

Page 62: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Application Variables

Application State

transcends Sessions so

multiple IE instances will

impact each other’s state

Page 63: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Problems with ViewState and

Global.aspx Variables

Not Strongly Typed

Not Available in Intellisense

Data is stored in Web Page for

ViewState…can make big web pages that

are slow when served over the Internet

Application and Session variables are

stored in memory, which can be a problem

if there are lots of Web application users

Page 64: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Profile Object – New in ASP 2.0

Profile Objects solve the problems with

__VIEWSTATE and Session/Application

variables

Uses Web.config file to define the Profile

Object and any associated variables

(properties)

Profile variables are typed, are available

to intellisense, and can be designated to

a data structure

Page 65: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Enabling Profile Object in

Web.config File Code added to Web.config file.

Currently this must be hand coded

but I suspect this will change

Page 66: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Using the Profile Variables

Profile object is accessible

through Intellisense as is

the “ProfileCounter”

variable we create

Note “ProfileCounter” was

typed as an integer,

therefore it can be treated

as an integer in code

without any conversion

Page 67: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Demonstration #4 – Web Application

State and Persistence of Data

Page 68: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Section #5

Using Data Sources

Page 69: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

In This Section:

Another Look at the Drop Down List Control, this

time using a DR Table to Populate Values

Add a SqlDataSource to the Project that is used by

our Drop Down Control

Create a Connection String that Gets stored in the

Web.config file and is available to any DataSource

Add SQL filter logic to our SqlDataSource and

discuss the use of Tables, SQL Text, and Stored

Procedures and the Pros and Cons of each.

Page 70: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

DropDownList Quick Tasks Options

DropDownList can be DataBound to specific

values that populate the list box. Note, this is

different than being DataBound to a ResultSet

Record. A DropDownList on a Form can be

populated from one DataSource, but

DataBound to a different DataSource

Can force a PostBack so the Page

redraws (or is Redirected()) based on

changing the SelectIndex of the

DropDownList

Last time we hand entered values

Page 71: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Selecting a Data Source

If a DataSource has already been

defined for this Page, it can be selected.

Otherwise, a new DataSource can be

defined using the Wizard

Page 72: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Options for Where Data Resides

SQL Server database where DR resides

Give it an easily

identifiable name

Page 73: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Must Create a Connection String

to the DR Database

The connection string provides the

information the DataSource to connect to

a database. This can be saved and

used anywhere in the Project

New Connection Wizard

Page 74: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Adding a

Connection

Classic MDAC

Connection Dialog Box

Data Repository Server

or Data Mart Server

Authentication Mode

Database (DR)

Page 75: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Saving the Connection in

Web.config File for Later Use

When deploying (i.e., going from

Acmeware’s development

environment to this laptop), this file

can easily be modified

Can be used on any

Page in the Project

Page 76: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Connection String in Web.config

Connection String

Note, if you use SQL Server

Authentication, the Password is stored

in this file so it must be secure

Page 77: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Choosing the Table / View SP / or

SQL Statement

MEDITECH DR MIS

Financial Class Dictionary

Only select one column

(Name) in this example.

Probably should include

the ClassID as unique

identifier, though it

wouldn’t be displayed in

the DropDownList

Filters Results

Distinct Records

Sorts Results

Options for Updateable Datasets

Page 78: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Adding a WHERE Clause Filter

Lots of powerful

options available!!

We are only interested

in Active Financial

Classes, so we

hardcode the Filter to a

value of “Y” as it is

stored in the DR

Page 79: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Testing the SQL Data Source

Testing the DataSource

Page 80: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

SqlDataSource in Design View

SqlDataSource in

Design View

Databound Control

Page 81: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

DropDownList in

Web Browser

Active Financial Class in

the DR DMisFinancial

Class Dictionary

Page 82: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Demonstration #5 – SQL

DataSource

Page 83: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Section #6

Useful Databound Controls

Page 84: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

In This Section

Configure a new DataSource using the

Data Repository

Create a DataBound Grid View Control

and Configure Its Attributes (View Only

version)

DetailsView Control (View Only)

In-Line Editable GridView

FormView Control (Enter / Edit / Delete)

Page 85: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

GridView Control Quick Tasks

Quick Tasks

GridView show Data

Records in Table Format

We will create a new

DataSource to populate

the GridView

Page 86: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

SQL Data Source linked to a

Medical Records Table

Named for MriPatients

(DR) table

SQL Server (Or other

OLE DB) Data Source

Page 87: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Select Statement in DataSource

In this example, we are interested

in the Patient’s Name, Sex and

DOB, but we return the PatientID

as a unique identifier

We recommend using SPs

for support reasons, but in

this example we will simply

chose the MriPatients

Choosing table actually results

in a simple SQL statement

Page 88: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Auto Format Option

The Auto Format Quick Task

options allows an easy

mechanism to provide a nice

look to the control

Page 89: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Paging, Sorting, Selection

Page 90: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

GridView Control in IE

Automatically sorts on

selected column header

Easy paging through a

large number of records

Select option

allows an

individual record

to be identified,

then event

action can occur

based on the

selected record

Page 91: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Look at Control’s Source Code The GridView Control has no

Code Behind, all of the

source Code is generated as

Server Control Tags

Page 92: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Adding a DetailsView Control

The Details View is designed

to show Detail of a specific

data record in a Form format

Page 93: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Details View Data Source

In this example, we will

select the same MriPatients

DR table again, but choose

many more fields to display

in our Details View

Page 94: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Linking Controls

The SelectIndexChange

event is used to trigger a

change in the PageIndex of

the DetailsView sot that it

equals the new GridView

Selected Index

Page 95: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

As different GridView items

are selected, the details for

the specific patient are

displayed in the DetailsView

control

Page 96: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Lab Results Data Mart Next, we will use Visual Web

Developer controls to modify

and update data. In this

scenario, we would not link

directly to the DR. However,

we might use DR data to

create a Data Mart, to which

we link our controls. We create a table to store

Lab Result values for patient

accounts on specific dates

Page 97: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

SP to Create My Lab Data Mart

This is a simple SQL Stored

Procedure that loads Lab

Results into a table

(MyLabResultsDataMart)

Page 98: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

In-Line Editable GridView

A GridView that is editable is

the same as a GridView that

is View only, the difference is

in the DataSource

configuration

We will create a new

SqlDataSource using a

connection string to our

“downtimedr” database

Page 99: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Data Mart Data Source

Again, the Database option

for the DR

Page 100: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

In-Line Editable GridView

Select the Data

Mart we defined

Make sure to

include the Primary

Key (ID) column

Page 101: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Advanced Button We can now choose to

allow Insert, Update, and

Delete statements

automatically with our

GridView

Page 102: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Quick Task options for

Editable GridView

Choosing checkbox

adds the corresponding

Select, Edit, or Delete

selection options as

columns in the GridView

Page 103: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Editable Grid View with no Code

When Edit is selected,

each column of the

GridView for the

corresponding record is

placed into a TextBox,

where it can be edited

Changes can be

accepted using the

Update option or

Cancelled

Page 104: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Form View Control

The FormView Control is the equivalent to the

DetailsView, but has the same Insert, Edit, Update and

Delete capabilities using Templates for each Form

Page 105: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Demonstration #6 – DataBound

Controls

Page 106: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Section #7

Downtime Registration Example

Page 107: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Downtime Registration Process

Provides the ability to continue to register patients

as if system never went down

Works during planned or unplanned downtime

Use demographic recall (and any other required

data) from the DR

Can be developed and deployed in hours with

virtually no coding

New registration information can be easily scripted

back into Admission Module when it is back up (or

transmitted through HL7 into InBox)

Page 108: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Demo Recall MRI Lookup A TextBox is used to enter information to

perform a Demo Recall lookup for the

patient

Patient demographics are displays to help Identify

Once the patient is identified, she is selected which

generates a new downtime record with default values and

opens the FormView control to allow editing

Page 109: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

SQL Side Development

New Database called “downtimedb”

New Tables Visits (this is the core table and used to script the downtime

registration data back when the system comes back up

Providers

Locations

Services

New Stored Procedures First Searches the Demo Recall data to find match to input data (By

Name, Past Account #, Unit #, SS#, etc.)

Once Demo Recall record is selected which initiates a CacheNewVists stored procedure that either

Page 110: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Inpatient Long Form (Downtime)

Page 111: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Demonstration #7 – Downtime

Registration Routine

Page 112: Web-based Application Development using a MEDITECH · PDF filesession of Visual Web Developer 2005 ... a web page is essentially converted into a “mini-application” ... Visual

Questions