Merge remote-tracking branch 'refs/remotes/Microsoft/master'
@@ -66,6 +66,8 @@ You can configure the amount of data produced by modifying the number of orders
|
||||
|
||||
7. Execute the script **7-wwi-enable-full-features.sql**. This script enables features not available in standard edition. Skip this step when creating the sample database targeting standard edition.
|
||||
|
||||
- Note: Full-Text Indexing should be installed in order to configure the full-text options. If the feature is not installed, you will receive a warning message when running the script.
|
||||
|
||||
8. Execute the script **8-wwi-backup.sql**. This creates a backup of the database. Make sure to adjust the file path of the backup to match your folder structure. (A sample restore script **9-wwi-restore.sql** is also provided).
|
||||
|
||||
9. If required, remove the **WWI_Preparation** database.
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# Order Processing Benchmark using In-Memory OLTP
|
||||
|
||||
Sample order processing workload that can be used for benchmarking transactional processing with in-memory technologies. The scripts in this folder leverage the In-Memory OLTP feature in SQL Server 2016.
|
||||
|
||||
<a name=about-this-sample></a>
|
||||
|
||||
## About this sample
|
||||
|
||||
* **Applies to:** SQL Server 2016 (or higher)
|
||||
* **Key features:** In-Memory OLTP
|
||||
* **Workload:** OLTP
|
||||
* **Programming Language:** T-SQL
|
||||
* **Authors:** Jos de Bruijn, Liang Yang
|
||||
|
||||
|
||||
## Running this sample
|
||||
|
||||
1. Create the database, tables, and stored procedures using the T-SQL scripts in the corresponding subfolders.
|
||||
|
||||
- The hash indexes are sized for large databases, processing billions of orders. They are appropriate for 1TB and larger database size. For smaller database and memory size, adjust the bucket counts accordingly.
|
||||
|
||||
2. Run the stored procedures using the following mix.
|
||||
|
||||
- There are plans to make a scalable workload driver available as well. Timeline is TBD.
|
||||
|
||||
|Stored Procedure|Weight|Distribution|
|
||||
|----------|--------|-------|
|
||||
|GetOrdersByCustomerID|8|25.8%|
|
||||
|GetProductsByType|6|19.4%|
|
||||
|GetProductsPriceByPK |4 |12.9%|
|
||||
|ProductSelectionCriteria |2 |6.5%|
|
||||
|InsertOrder |10 |32.3%|
|
||||
|FulfillOrders |1 |3.2%|
|
||||
|
||||
|
||||
|
||||
## Workload description
|
||||
|
||||
|Transaction |Type| Description|
|
||||
|-----|-----|------|
|
||||
|GetOrdersByCustomerID |Read-only |Select customer info, orders, and order lines for a given customer.|
|
||||
|GetProductsByType |Read-only |Select top 10 products of a given type, ordered by price.|
|
||||
|GetProductsPriceByPK |Read-only |Select all products in a given ID range, ordered by price.|
|
||||
|ProductSelectionCriteria |Read-only |Select top 20 products in a given ID range with the highest computed “closeness” factor against the |PurchaseCriteria|
|
||||
|InsertOrder |Read-write |Insert a new order for a given customer with up to five order lines.|
|
||||
|FulfillOrders |Read-write |Fulfill 10 oldest outstanding orders.|
|
||||
|
||||
|
||||
|
||||
## More information
|
||||
- [In-Memory OLTP (In-Memory Optimization)] (https://msdn.microsoft.com/library/dn133186.aspx)
|
||||
- [OLTP and database management] (https://www.microsoft.com/en-us/server-cloud/solutions/oltp-database-management.aspx)
|
||||
@@ -0,0 +1,68 @@
|
||||
USE master
|
||||
GO
|
||||
|
||||
-- create main database files
|
||||
CREATE DATABASE InMemDB
|
||||
ON PRIMARY
|
||||
( NAME = InMemDB_root,
|
||||
FILENAME = 'F:\InMemDB_Data\InMem_root.mdf',
|
||||
SIZE = 2048MB,
|
||||
FILEGROWTH = 10),
|
||||
FILEGROUP InMem_fg CONTAINS MEMORY_OPTIMIZED_DATA
|
||||
( NAME = InMemDB_1,
|
||||
FILENAME = 'G:\InMemDB_Data_1\InMem_1'),
|
||||
( NAME = InMemDB_2,
|
||||
FILENAME = 'G:\InMemDB_Data_2\InMem_2'),
|
||||
( NAME = InMemDB_3,
|
||||
FILENAME = 'G:\InMemDB_Data_3\InMem_3'),
|
||||
( NAME = InMemDB_4,
|
||||
FILENAME = 'G:\InMemDB_Data_4\InMem_4'),
|
||||
( NAME = InMemDB_5,
|
||||
FILENAME = 'H:\InMemDB_Data_5\InMem_5'),
|
||||
( NAME = InMemDB_6,
|
||||
FILENAME = 'H:\InMemDB_Data_6\InMem_6'),
|
||||
( NAME = InMemDB_7,
|
||||
FILENAME = 'H:\InMemDB_Data_7\InMem_7'),
|
||||
( NAME = InMemDB_8,
|
||||
FILENAME = 'H:\InMemDB_Data_8\InMem_8'),
|
||||
( NAME = InMemDB_9,
|
||||
FILENAME = 'I:\InMemDB_Data_9\InMem_9'),
|
||||
( NAME = InMemDB_10,
|
||||
FILENAME = 'I:\InMemDB_Data_10\InMem_10'),
|
||||
( NAME = InMemDB_11,
|
||||
FILENAME = 'I:\InMemDB_Data_11\InMem_11'),
|
||||
( NAME = InMemDB_12,
|
||||
FILENAME = 'I:\InMemDB_Data_12\InMem_12'),
|
||||
( NAME = InMemDB_13,
|
||||
FILENAME = 'J:\InMemDB_Data_13\InMem_13'),
|
||||
( NAME = InMemDB_14,
|
||||
FILENAME = 'J:\InMemDB_Data_14\InMem_14'),
|
||||
( NAME = InMemDB_15,
|
||||
FILENAME = 'J:\InMemDB_Data_15\InMem_15'),
|
||||
( NAME = InMemDB_16,
|
||||
FILENAME = 'J:\InMemDB_Data_16\InMem_16')
|
||||
LOG ON
|
||||
( NAME = InMemDB_log_1,
|
||||
FILENAME = 'K:\InMemDB_Log_1\InMem_log_1.ldf',
|
||||
SIZE = 1968GB,
|
||||
FILEGROWTH = 10),
|
||||
( NAME = InMemDB_log_2,
|
||||
FILENAME = 'K:\InMemDB_Log_2\InMem_log_2.ldf',
|
||||
SIZE = 1968GB,
|
||||
FILEGROWTH = 10),
|
||||
( NAME = InMemDB_log_3,
|
||||
FILENAME = 'K:\InMemDB_Log_3\InMem_log_3.ldf',
|
||||
SIZE = 1968GB,
|
||||
FILEGROWTH = 10)
|
||||
COLLATE Latin1_General_BIN
|
||||
GO
|
||||
|
||||
USE InMemDB
|
||||
GO
|
||||
|
||||
/** For memory-optimized tables, automatically map all lower isolation levels (including READ COMMITTED) to SNAPSHOT **/
|
||||
ALTER DATABASE CURRENT SET MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT = ON
|
||||
GO
|
||||
|
||||
ALTER AUTHORIZATION ON DATABASE::InMemDB TO sa
|
||||
GO
|
||||
@@ -0,0 +1,40 @@
|
||||
------------------------------------------------------------------
|
||||
-- --
|
||||
-- File: Create_TVPs.SQL --
|
||||
-- Version: 0.0.0-1003 --
|
||||
-- --
|
||||
------------------------------------------------------------------
|
||||
SET QUOTED_IDENTIFIER OFF
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
USE InMemDB
|
||||
GO
|
||||
|
||||
|
||||
IF EXISTS ( SELECT name FROM sysobjects WHERE xtype = 'TT' AND name LIKE 'TT_InMemDBTVPOrders%' )
|
||||
DROP TYPE dbo.InMemDBTVPOrders
|
||||
GO
|
||||
|
||||
CREATE TYPE dbo.InMemDBTVPOrders AS TABLE(
|
||||
SEQ int NOT NULL,
|
||||
PR_ID bigint NOT NULL,
|
||||
PR_QTY int
|
||||
|
||||
INDEX PK_IMDBTVPOrders NONCLUSTERED HASH ( SEQ )
|
||||
WITH (BUCKET_COUNT = 10)
|
||||
)
|
||||
WITH ( MEMORY_OPTIMIZED = ON )
|
||||
GO
|
||||
|
||||
|
||||
CREATE TYPE dbo.InMemDBTVPTypes AS TABLE(
|
||||
REQ_TYPE tinyint NOT NULL
|
||||
|
||||
INDEX PK_IMDBTVPTypes NONCLUSTERED HASH ( REQ_TYPE )
|
||||
WITH (BUCKET_COUNT = 10)
|
||||
)
|
||||
WITH ( MEMORY_OPTIMIZED = ON )
|
||||
GO
|
||||
@@ -0,0 +1,55 @@
|
||||
------------------------------------------------------------------
|
||||
-- --
|
||||
-- File: usp_FulfillOrders.SQL --
|
||||
-- --
|
||||
------------------------------------------------------------------
|
||||
SET QUOTED_IDENTIFIER OFF
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
USE InMemDB
|
||||
GO
|
||||
|
||||
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'usp_FulfillOrders' )
|
||||
DROP PROCEDURE usp_FulfillOrders
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE dbo.usp_FulfillOrders
|
||||
WITH NATIVE_COMPILATION, EXECUTE AS OWNER, SCHEMABINDING
|
||||
AS BEGIN ATOMIC WITH
|
||||
(
|
||||
TRANSACTION ISOLATION LEVEL = SNAPSHOT,
|
||||
LANGUAGE = N'us_english'
|
||||
)
|
||||
DECLARE @OrderID bigint,
|
||||
@OrderCID bigint,
|
||||
@FulfillmentDate datetime = GETDATE(),
|
||||
@OrdersToProcess int = 10
|
||||
|
||||
WHILE (@OrdersToProcess > 0)
|
||||
BEGIN
|
||||
SELECT TOP 1
|
||||
@OrderID = O_ID,
|
||||
@OrderCID = O_C_ID
|
||||
FROM dbo.Orders
|
||||
WHERE O_FM_DTS = '1900-01-01 00:00:00.000'
|
||||
ORDER BY O_DTS ASC
|
||||
|
||||
IF @OrderID IS NOT NULL
|
||||
BEGIN
|
||||
-- update the order with the fulfilment date
|
||||
UPDATE dbo.Orders
|
||||
SET O_FM_DTS = @FulfillmentDate
|
||||
WHERE O_ID = @OrderID
|
||||
|
||||
-- insert the data into the FulFillment table
|
||||
INSERT INTO dbo.Fulfillment (FM_O_ID, FM_C_ID, FM_DTS) VALUES (@OrderID, @OrderCID, @FulfillmentDate)
|
||||
|
||||
SELECT @OrderID AS 'OrderID Fulfilled'
|
||||
END
|
||||
|
||||
SET @OrdersToProcess = @OrdersToProcess - 1
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,61 @@
|
||||
------------------------------------------------------------------
|
||||
-- --
|
||||
-- File: usp_GetOrdersByCustomerID.SQL --
|
||||
-- Version: 0.0.0-1006 --
|
||||
-- --
|
||||
------------------------------------------------------------------
|
||||
SET QUOTED_IDENTIFIER OFF
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
USE InMemDB
|
||||
GO
|
||||
|
||||
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'usp_GetOrdersByCustomerID' )
|
||||
DROP PROCEDURE usp_GetOrdersByCustomerID
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE dbo.usp_GetOrdersByCustomerID
|
||||
( @C_ID bigint)
|
||||
WITH NATIVE_COMPILATION, EXECUTE AS OWNER, SCHEMABINDING
|
||||
AS BEGIN ATOMIC WITH
|
||||
(
|
||||
TRANSACTION ISOLATION LEVEL = SNAPSHOT,
|
||||
LANGUAGE = N'us_english'
|
||||
)
|
||||
DECLARE @c_f_name varchar(20),
|
||||
@c_l_name varchar(25),
|
||||
@c_email varchar(50),
|
||||
@o_id bigint,
|
||||
@o_total decimal(9,2),
|
||||
@o_dts datetime
|
||||
|
||||
|
||||
SELECT @c_f_name = C_F_NAME,
|
||||
@c_l_name = C_L_NAME,
|
||||
@c_email = C_EMAIL
|
||||
FROM dbo.Customer
|
||||
WHERE C_ID = @C_ID
|
||||
|
||||
SELECT @o_id = O_ID,
|
||||
@o_total = O_TOTAL,
|
||||
@o_dts = O_DTS
|
||||
FROM dbo.Orders
|
||||
WHERE O_C_ID = @c_id
|
||||
ORDER BY O_ID ASC
|
||||
|
||||
SELECT OL_SEQ,
|
||||
OL_PR_ID,
|
||||
OL_QTY,
|
||||
OL_PRICE
|
||||
FROM dbo.OrderLines
|
||||
WHERE OL_O_ID = @o_id
|
||||
|
||||
SELECT @c_f_name,
|
||||
@c_l_name,
|
||||
@c_email
|
||||
END
|
||||
|
||||
GO
|
||||
@@ -0,0 +1,40 @@
|
||||
------------------------------------------------------------------
|
||||
-- --
|
||||
-- File: usp_GetProductsByType.SQL --
|
||||
-- Version: 0.0.0-1006 --
|
||||
-- --
|
||||
------------------------------------------------------------------
|
||||
SET QUOTED_IDENTIFIER OFF
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
USE InMemDB
|
||||
GO
|
||||
|
||||
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'usp_GetProductsByType' )
|
||||
DROP PROCEDURE usp_GetProductsByType
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE dbo.usp_GetProductsByType
|
||||
( @REQ_TYPE int )
|
||||
WITH NATIVE_COMPILATION, EXECUTE AS OWNER, SCHEMABINDING
|
||||
AS BEGIN ATOMIC WITH
|
||||
(
|
||||
TRANSACTION ISOLATION LEVEL = SNAPSHOT,
|
||||
LANGUAGE = N'us_english'
|
||||
)
|
||||
SELECT TOP 10
|
||||
PR_ID,
|
||||
PR_NAME,
|
||||
PR_TYPE,
|
||||
PR_DESC,
|
||||
PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_TYPE = @REQ_TYPE
|
||||
ORDER BY PR_PRICE ASC
|
||||
|
||||
END
|
||||
|
||||
GO
|
||||
@@ -0,0 +1,167 @@
|
||||
------------------------------------------------------------------
|
||||
-- --
|
||||
-- File: usp_InsertOrder.SQL --
|
||||
-- Version: 0.0.0-1006 --
|
||||
-- --
|
||||
------------------------------------------------------------------
|
||||
SET QUOTED_IDENTIFIER OFF
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
USE InMemDB
|
||||
GO
|
||||
|
||||
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'usp_InsertOrder' )
|
||||
DROP PROCEDURE usp_InsertOrder
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE [dbo].[usp_InsertOrder]
|
||||
( @C_ID bigint,
|
||||
@OL_SEQ_1 tinyint,
|
||||
@OL_PR_ID_1 bigint,
|
||||
@OL_PR_QTY_1 int,
|
||||
@OL_SEQ_2 tinyint,
|
||||
@OL_PR_ID_2 bigint,
|
||||
@OL_PR_QTY_2 int,
|
||||
@OL_SEQ_3 tinyint,
|
||||
@OL_PR_ID_3 bigint,
|
||||
@OL_PR_QTY_3 int,
|
||||
@OL_SEQ_4 tinyint,
|
||||
@OL_PR_ID_4 bigint,
|
||||
@OL_PR_QTY_4 int,
|
||||
@OL_SEQ_5 tinyint,
|
||||
@OL_PR_ID_5 bigint,
|
||||
@OL_PR_QTY_5 int)
|
||||
WITH NATIVE_COMPILATION, EXECUTE AS OWNER, SCHEMABINDING
|
||||
AS BEGIN ATOMIC WITH
|
||||
(
|
||||
TRANSACTION ISOLATION LEVEL = SNAPSHOT,
|
||||
LANGUAGE = N'us_english'
|
||||
)
|
||||
DECLARE @Order_Id bigint,
|
||||
@TotalPrice decimal(12,2) = 0,
|
||||
@NullDate datetime = '1900-01-01',
|
||||
@SeqNumber tinyint = 0,
|
||||
@SeqCount tinyint = 5,
|
||||
@SeqID tinyint,
|
||||
@PR_ID bigint,
|
||||
@PR_Qty int,
|
||||
@PR_Price numeric(9,2),
|
||||
@InsertFlag bit = 0
|
||||
|
||||
--insert an Order record to claim the O_ID
|
||||
INSERT INTO dbo.Orders (O_C_ID, O_TOTAL, O_DTS, O_FM_DTS) VALUES (@C_ID, 0, GETDATE(), @NullDate)
|
||||
|
||||
-- get the inserted order id
|
||||
SELECT @order_id = SCOPE_IDENTITY()
|
||||
|
||||
-- now process the order lines
|
||||
WHILE (@SeqNumber < @SeqCount)
|
||||
BEGIN
|
||||
SELECT @SeqNumber = @SeqNumber + 1
|
||||
|
||||
IF @SeqNumber = 1
|
||||
BEGIN
|
||||
SELECT @SeqID = @OL_SEQ_1,
|
||||
@PR_ID = @OL_PR_ID_1,
|
||||
@PR_Qty = @OL_PR_QTY_1,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_1
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
SET @InsertFlag = 1
|
||||
SET @TotalPrice = @TotalPrice + (@PR_QTY * @PR_Price)
|
||||
END
|
||||
END
|
||||
|
||||
IF @SeqNumber = 2
|
||||
BEGIN
|
||||
SELECT @SeqID = @OL_SEQ_2,
|
||||
@PR_ID = @OL_PR_ID_2,
|
||||
@PR_Qty = @OL_PR_QTY_2,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_2
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
SET @InsertFlag = 1
|
||||
SET @TotalPrice = @TotalPrice + (@PR_QTY * @PR_Price)
|
||||
END
|
||||
END
|
||||
|
||||
IF @SeqNumber = 3
|
||||
BEGIN
|
||||
SELECT @SeqID = @OL_SEQ_3,
|
||||
@PR_ID = @OL_PR_ID_3,
|
||||
@PR_Qty = @OL_PR_QTY_3,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_3
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
SET @InsertFlag = 1
|
||||
SET @TotalPrice = @TotalPrice + (@PR_QTY * @PR_Price)
|
||||
END
|
||||
END
|
||||
|
||||
IF @SeqNumber = 4
|
||||
BEGIN
|
||||
SELECT @SeqID = @OL_SEQ_4,
|
||||
@PR_ID = @OL_PR_ID_4,
|
||||
@PR_Qty = @OL_PR_QTY_4,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_4
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
SET @InsertFlag = 1
|
||||
SET @TotalPrice = @TotalPrice + (@PR_QTY * @PR_Price)
|
||||
END
|
||||
END
|
||||
|
||||
IF @SeqNumber = 5
|
||||
BEGIN
|
||||
SELECT @SeqID = @OL_SEQ_5,
|
||||
@PR_ID = @OL_PR_ID_5,
|
||||
@PR_Qty = @OL_PR_QTY_5,
|
||||
@PR_Price = PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID = @OL_PR_ID_5
|
||||
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
SET @InsertFlag = 1
|
||||
SET @TotalPrice = @TotalPrice + (@PR_QTY * @PR_Price)
|
||||
END
|
||||
END
|
||||
|
||||
IF (@InsertFlag = 1)
|
||||
BEGIN
|
||||
INSERT INTO dbo.OrderLines VALUES (@order_id, @SeqID, @PR_ID, @PR_QTY, @PR_Price, GETDATE())
|
||||
SET @InsertFlag = 0
|
||||
END
|
||||
END
|
||||
|
||||
-- now update the order with the total price
|
||||
UPDATE dbo.Orders
|
||||
SET O_TOTAL = @TotalPrice
|
||||
WHERE O_ID = @Order_id AND
|
||||
O_C_ID = @C_ID
|
||||
|
||||
SELECT @order_id,
|
||||
@C_ID,
|
||||
@TotalPrice
|
||||
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
------------------------------------------------------------------
|
||||
-- --
|
||||
-- File: usp_ProductSelectionCriteria.sql --
|
||||
-- Version: 0.0.0-1006 --
|
||||
-- --
|
||||
------------------------------------------------------------------
|
||||
SET QUOTED_IDENTIFIER OFF
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
USE InMemDB
|
||||
GO
|
||||
|
||||
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'usp_ProductSelectionCriteria' )
|
||||
DROP PROCEDURE usp_ProductSelectionCriteria
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE [dbo].usp_ProductSelectionCriteria
|
||||
( @LOWER_PR_ID bigint,
|
||||
@UPPER_PR_ID bigint,
|
||||
@PC_ID bigint)
|
||||
WITH NATIVE_COMPILATION, EXECUTE AS OWNER, SCHEMABINDING
|
||||
AS BEGIN ATOMIC WITH
|
||||
(
|
||||
TRANSACTION ISOLATION LEVEL = SNAPSHOT,
|
||||
LANGUAGE = N'us_english'
|
||||
)
|
||||
DECLARE @pc_dec001 float,
|
||||
@pc_dec002 float,
|
||||
@pc_dec003 float,
|
||||
@pc_dec004 float,
|
||||
@pc_dec005 float,
|
||||
@pc_dec006 float,
|
||||
@pc_dec007 float,
|
||||
@pc_dec008 float,
|
||||
@pc_dec009 float,
|
||||
@pc_dec010 float,
|
||||
@pc_dec011 float,
|
||||
@pc_dec012 float,
|
||||
@pc_dec013 float,
|
||||
@pc_dec014 float,
|
||||
@pc_dec015 float,
|
||||
@pc_dec016 float,
|
||||
@pc_dec017 float,
|
||||
@pc_dec018 float,
|
||||
@pc_dec019 float,
|
||||
@pc_dec020 float,
|
||||
@pc_dec021 float,
|
||||
@pc_dec022 float,
|
||||
@pc_dec023 float,
|
||||
@pc_dec024 float,
|
||||
@pc_dec025 float,
|
||||
@pc_dec026 float,
|
||||
@pc_dec027 float,
|
||||
@pc_dec028 float,
|
||||
@pc_dec029 float,
|
||||
@pc_dec030 float,
|
||||
@pc_dec031 float,
|
||||
@pc_dec032 float,
|
||||
@pc_dec033 float,
|
||||
@pc_dec034 float,
|
||||
@pc_dec035 float,
|
||||
@pc_dec036 float,
|
||||
@pc_dec037 float,
|
||||
@pc_dec038 float,
|
||||
@pc_dec039 float,
|
||||
@pc_dec040 float,
|
||||
@pc_dec041 float,
|
||||
@pc_dec042 float,
|
||||
@pc_dec043 float,
|
||||
@pc_dec044 float,
|
||||
@pc_dec045 float,
|
||||
@pc_dec046 float,
|
||||
@pc_dec047 float,
|
||||
@pc_dec048 float,
|
||||
@pc_dec049 float,
|
||||
@pc_dec050 float,
|
||||
@pc_dec051 float,
|
||||
@pc_dec052 float,
|
||||
@pc_dec053 float,
|
||||
@pc_dec054 float,
|
||||
@pc_dec055 float,
|
||||
@pc_dec056 float,
|
||||
@pc_dec057 float,
|
||||
@pc_dec058 float,
|
||||
@pc_dec059 float,
|
||||
@pc_dec060 float,
|
||||
@pc_dec061 float,
|
||||
@pc_dec062 float,
|
||||
@pc_dec063 float,
|
||||
@pc_dec064 float,
|
||||
@pc_dec065 float,
|
||||
@pc_dec066 float,
|
||||
@pc_dec067 float,
|
||||
@pc_dec068 float,
|
||||
@pc_dec069 float,
|
||||
@pc_dec070 float,
|
||||
@pc_dec071 float,
|
||||
@pc_dec072 float,
|
||||
@pc_dec073 float,
|
||||
@pc_dec074 float,
|
||||
@pc_dec075 float,
|
||||
@pc_dec076 float,
|
||||
@pc_dec077 float,
|
||||
@pc_dec078 float,
|
||||
@pc_dec079 float,
|
||||
@pc_dec080 float,
|
||||
@pc_dec081 float,
|
||||
@pc_dec082 float,
|
||||
@pc_dec083 float,
|
||||
@pc_dec084 float,
|
||||
@pc_dec085 float,
|
||||
@pc_dec086 float,
|
||||
@pc_dec087 float,
|
||||
@pc_dec088 float,
|
||||
@pc_dec089 float,
|
||||
@pc_dec090 float,
|
||||
@pc_dec091 float,
|
||||
@pc_dec092 float,
|
||||
@pc_dec093 float,
|
||||
@pc_dec094 float,
|
||||
@pc_dec095 float,
|
||||
@pc_dec096 float,
|
||||
@pc_dec097 float,
|
||||
@pc_dec098 float,
|
||||
@pc_dec099 float,
|
||||
@pc_dec100 float
|
||||
|
||||
SELECT @pc_dec001 = PC_DEC1,
|
||||
@pc_dec002 = PC_DEC2,
|
||||
@pc_dec003 = PC_DEC3,
|
||||
@pc_dec004 = PC_DEC4,
|
||||
@pc_dec005 = PC_DEC5,
|
||||
@pc_dec006 = PC_DEC6,
|
||||
@pc_dec007 = PC_DEC7,
|
||||
@pc_dec008 = PC_DEC8,
|
||||
@pc_dec009 = PC_DEC9,
|
||||
@pc_dec010 = PC_DEC10,
|
||||
@pc_dec011 = PC_DEC11,
|
||||
@pc_dec012 = PC_DEC12,
|
||||
@pc_dec013 = PC_DEC13,
|
||||
@pc_dec014 = PC_DEC14,
|
||||
@pc_dec015 = PC_DEC15,
|
||||
@pc_dec016 = PC_DEC16,
|
||||
@pc_dec017 = PC_DEC17,
|
||||
@pc_dec018 = PC_DEC18,
|
||||
@pc_dec019 = PC_DEC19,
|
||||
@pc_dec020 = PC_DEC20,
|
||||
@pc_dec021 = PC_DEC21,
|
||||
@pc_dec022 = PC_DEC22,
|
||||
@pc_dec023 = PC_DEC23,
|
||||
@pc_dec024 = PC_DEC24,
|
||||
@pc_dec025 = PC_DEC25,
|
||||
@pc_dec026 = PC_DEC26,
|
||||
@pc_dec027 = PC_DEC27,
|
||||
@pc_dec028 = PC_DEC28,
|
||||
@pc_dec029 = PC_DEC29,
|
||||
@pc_dec030 = PC_DEC30,
|
||||
@pc_dec031 = PC_DEC31,
|
||||
@pc_dec032 = PC_DEC32,
|
||||
@pc_dec033 = PC_DEC33,
|
||||
@pc_dec034 = PC_DEC34,
|
||||
@pc_dec035 = PC_DEC35,
|
||||
@pc_dec036 = PC_DEC36,
|
||||
@pc_dec037 = PC_DEC37,
|
||||
@pc_dec038 = PC_DEC38,
|
||||
@pc_dec039 = PC_DEC39,
|
||||
@pc_dec040 = PC_DEC40,
|
||||
@pc_dec041 = PC_DEC41,
|
||||
@pc_dec042 = PC_DEC42,
|
||||
@pc_dec043 = PC_DEC43,
|
||||
@pc_dec044 = PC_DEC44,
|
||||
@pc_dec045 = PC_DEC45,
|
||||
@pc_dec046 = PC_DEC46,
|
||||
@pc_dec047 = PC_DEC47,
|
||||
@pc_dec048 = PC_DEC48,
|
||||
@pc_dec049 = PC_DEC49,
|
||||
@pc_dec050 = PC_DEC50,
|
||||
@pc_dec051 = PC_DEC51,
|
||||
@pc_dec052 = PC_DEC52,
|
||||
@pc_dec053 = PC_DEC53,
|
||||
@pc_dec054 = PC_DEC54,
|
||||
@pc_dec055 = PC_DEC55,
|
||||
@pc_dec056 = PC_DEC56,
|
||||
@pc_dec057 = PC_DEC57,
|
||||
@pc_dec058 = PC_DEC58,
|
||||
@pc_dec059 = PC_DEC59,
|
||||
@pc_dec060 = PC_DEC60,
|
||||
@pc_dec061 = PC_DEC61,
|
||||
@pc_dec062 = PC_DEC62,
|
||||
@pc_dec063 = PC_DEC63,
|
||||
@pc_dec064 = PC_DEC64,
|
||||
@pc_dec065 = PC_DEC65,
|
||||
@pc_dec066 = PC_DEC66,
|
||||
@pc_dec067 = PC_DEC67,
|
||||
@pc_dec068 = PC_DEC68,
|
||||
@pc_dec069 = PC_DEC69,
|
||||
@pc_dec070 = PC_DEC70,
|
||||
@pc_dec071 = PC_DEC71,
|
||||
@pc_dec072 = PC_DEC72,
|
||||
@pc_dec073 = PC_DEC73,
|
||||
@pc_dec074 = PC_DEC74,
|
||||
@pc_dec075 = PC_DEC75,
|
||||
@pc_dec076 = PC_DEC76,
|
||||
@pc_dec077 = PC_DEC77,
|
||||
@pc_dec078 = PC_DEC78,
|
||||
@pc_dec079 = PC_DEC79,
|
||||
@pc_dec080 = PC_DEC80,
|
||||
@pc_dec081 = PC_DEC81,
|
||||
@pc_dec082 = PC_DEC82,
|
||||
@pc_dec083 = PC_DEC83,
|
||||
@pc_dec084 = PC_DEC84,
|
||||
@pc_dec085 = PC_DEC85,
|
||||
@pc_dec086 = PC_DEC86,
|
||||
@pc_dec087 = PC_DEC87,
|
||||
@pc_dec088 = PC_DEC88,
|
||||
@pc_dec089 = PC_DEC89,
|
||||
@pc_dec090 = PC_DEC90,
|
||||
@pc_dec091 = PC_DEC91,
|
||||
@pc_dec092 = PC_DEC92,
|
||||
@pc_dec093 = PC_DEC93,
|
||||
@pc_dec094 = PC_DEC94,
|
||||
@pc_dec095 = PC_DEC95,
|
||||
@pc_dec096 = PC_DEC96,
|
||||
@pc_dec097 = PC_DEC97,
|
||||
@pc_dec098 = PC_DEC98,
|
||||
@pc_dec099 = PC_DEC99,
|
||||
@pc_dec100 = PC_DEC100
|
||||
FROM dbo.Purchase_Criteria
|
||||
WHERE PC_ID = @PC_ID
|
||||
|
||||
SELECT TOP 20 PR_NAME,
|
||||
((@pc_dec001/PR_DEC1-1)+(@pc_dec002/PR_DEC2-1)+(@pc_dec003/PR_DEC3-1)+(@pc_dec004/PR_DEC4-1)+(@pc_dec005/PR_DEC5-1)+(@pc_dec006/PR_DEC6-1)+(@pc_dec007/PR_DEC7-1)+(@pc_dec008/PR_DEC8-1)+(@pc_dec009/PR_DEC9-1)+(@pc_dec010/PR_DEC10-1)+(@pc_dec011/PR_DEC11-1)+(@pc_dec012/PR_DEC12-1)+(@pc_dec013/PR_DEC13-1)+(@pc_dec014/PR_DEC14-1)+(@pc_dec015/PR_DEC15-1)+(@pc_dec016/PR_DEC16-1)+(@pc_dec017/PR_DEC17-1)+(@pc_dec018/PR_DEC18-1)+(@pc_dec019/PR_DEC19-1)+(@pc_dec020/PR_DEC20-1)+(@pc_dec021/PR_DEC21-1)+(@pc_dec022/PR_DEC22-1)+(@pc_dec023/PR_DEC23-1)+(@pc_dec024/PR_DEC24-1)+(@pc_dec025/PR_DEC25-1)+(@pc_dec026/PR_DEC26-1)+(@pc_dec027/PR_DEC27-1)+(@pc_dec028/PR_DEC28-1)+(@pc_dec029/PR_DEC29-1)+(@pc_dec030/PR_DEC30-1)+(@pc_dec031/PR_DEC31-1)+(@pc_dec032/PR_DEC32-1)+(@pc_dec033/PR_DEC33-1)+(@pc_dec034/PR_DEC34-1)+(@pc_dec035/PR_DEC35-1)+(@pc_dec036/PR_DEC36-1)+(@pc_dec037/PR_DEC37-1)+(@pc_dec038/PR_DEC38-1)+(@pc_dec039/PR_DEC39-1)+(@pc_dec040/PR_DEC40-1)+(@pc_dec041/PR_DEC41-1)+(@pc_dec042/PR_DEC42-1)+(@pc_dec043/PR_DEC43-1)+(@pc_dec044/PR_DEC44-1)+(@pc_dec045/PR_DEC45-1)+(@pc_dec046/PR_DEC46-1)+(@pc_dec047/PR_DEC47-1)+(@pc_dec048/PR_DEC48-1)+(@pc_dec049/PR_DEC49-1)+(@pc_dec050/PR_DEC50-1)+(@pc_dec051/PR_DEC51-1)+(@pc_dec052/PR_DEC52-1)+(@pc_dec053/PR_DEC53-1)+(@pc_dec054/PR_DEC54-1)+(@pc_dec055/PR_DEC55-1)+(@pc_dec056/PR_DEC56-1)+(@pc_dec057/PR_DEC57-1)+(@pc_dec058/PR_DEC58-1)+(@pc_dec059/PR_DEC59-1)+(@pc_dec060/PR_DEC60-1)+(@pc_dec061/PR_DEC61-1)+(@pc_dec062/PR_DEC62-1)+(@pc_dec063/PR_DEC63-1)+(@pc_dec064/PR_DEC64-1)+(@pc_dec065/PR_DEC65-1)+(@pc_dec066/PR_DEC66-1)+(@pc_dec067/PR_DEC67-1)+(@pc_dec068/PR_DEC68-1)+(@pc_dec069/PR_DEC69-1)+(@pc_dec070/PR_DEC70-1)+(@pc_dec071/PR_DEC71-1)+(@pc_dec072/PR_DEC72-1)+(@pc_dec073/PR_DEC73-1)+(@pc_dec074/PR_DEC74-1)+(@pc_dec075/PR_DEC75-1)+(@pc_dec076/PR_DEC76-1)+(@pc_dec077/PR_DEC77-1)+(@pc_dec078/PR_DEC78-1)+(@pc_dec079/PR_DEC79-1)+(@pc_dec080/PR_DEC80-1)+(@pc_dec081/PR_DEC81-1)+(@pc_dec082/PR_DEC82-1)+(@pc_dec083/PR_DEC83-1)+(@pc_dec084/PR_DEC84-1)+(@pc_dec085/PR_DEC85-1)+(@pc_dec086/PR_DEC86-1)+(@pc_dec087/PR_DEC87-1)+(@pc_dec088/PR_DEC88-1)+(@pc_dec089/PR_DEC89-1)+(@pc_dec090/PR_DEC90-1)+(@pc_dec091/PR_DEC91-1)+(@pc_dec092/PR_DEC92-1)+(@pc_dec093/PR_DEC93-1)+(@pc_dec094/PR_DEC94-1)+(@pc_dec095/PR_DEC95-1)+(@pc_dec096/PR_DEC96-1)+(@pc_dec097/PR_DEC97-1)+(@pc_dec098/PR_DEC98-1)+(@pc_dec099/PR_DEC99-1)+(@pc_dec100/PR_DEC100-1)) AS Closeness
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID BETWEEN @LOWER_PR_ID AND @UPPER_PR_ID
|
||||
ORDER BY Closeness ASC
|
||||
|
||||
END
|
||||
GO
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
------------------------------------------------------------------
|
||||
-- --
|
||||
-- File: usp_GetProductsPriceByPK.SQL --
|
||||
-- Version: 0.0.0-1006 --
|
||||
-- --
|
||||
------------------------------------------------------------------
|
||||
SET QUOTED_IDENTIFIER OFF
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
USE InMemDB
|
||||
GO
|
||||
|
||||
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'usp_GetProductsPriceByPK' )
|
||||
DROP PROCEDURE usp_GetProductsPriceByPK
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE dbo.usp_GetProductsPriceByPK
|
||||
( @LOWER_PK bigint,
|
||||
@UPPER_PK bigint)
|
||||
WITH NATIVE_COMPILATION, EXECUTE AS OWNER, SCHEMABINDING
|
||||
AS BEGIN ATOMIC WITH
|
||||
(
|
||||
TRANSACTION ISOLATION LEVEL = SNAPSHOT,
|
||||
LANGUAGE = N'us_english'
|
||||
)
|
||||
SELECT PR_ID,
|
||||
PR_NAME,
|
||||
PR_TYPE,
|
||||
PR_DESC,
|
||||
PR_PRICE
|
||||
FROM dbo.Products
|
||||
WHERE PR_ID BETWEEN @LOWER_PK AND @UPPER_PK
|
||||
ORDER BY PR_PRICE ASC
|
||||
END
|
||||
|
||||
GO
|
||||
@@ -0,0 +1,298 @@
|
||||
-------------------------------------------
|
||||
-- version 0.0.0-1006
|
||||
-------------------------------------------
|
||||
|
||||
USE InMemDB
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
-- CUSTOMER Table
|
||||
CREATE TABLE dbo.Customer(
|
||||
C_ID bigint NOT NULL PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUNT = 400000000),
|
||||
C_L_NAME varchar(25) COLLATE Latin1_General_100_BIN2,
|
||||
C_F_NAME varchar(20) COLLATE Latin1_General_100_BIN2,
|
||||
C_EMAIL varchar(50) NULL
|
||||
|
||||
) WITH ( MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA )
|
||||
GO
|
||||
|
||||
-- FULFILLMENT Table
|
||||
CREATE TABLE dbo.Fulfillment(
|
||||
FM_ID bigint IDENTITY(1,1) NOT NULL PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUNT = 1073741824),
|
||||
FM_O_ID bigint NOT NULL,
|
||||
FM_C_ID bigint NOT NULL,
|
||||
FM_DTS datetime NOT NULL
|
||||
|
||||
) WITH ( MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA )
|
||||
GO
|
||||
|
||||
-- ORDERLINES Table
|
||||
CREATE TABLE dbo.OrderLines(
|
||||
OL_O_ID bigint NOT NULL,
|
||||
OL_SEQ int NOT NULL,
|
||||
OL_PR_ID bigint NOT NULL,
|
||||
OL_QTY int NOT NULL,
|
||||
OL_PRICE decimal(9,2) NOT NULL,
|
||||
OL_DTS datetime NOT NULL,
|
||||
|
||||
CONSTRAINT PK_OrderLInes PRIMARY KEY NONCLUSTERED HASH ( OL_O_ID, OL_SEQ )
|
||||
WITH (BUCKET_COUNT = 1073741824),
|
||||
|
||||
INDEX IX_OrderLinesOL_O_ID HASH (OL_O_ID) WITH (BUCKET_COUNT = 1073741824)
|
||||
|
||||
) WITH ( MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA )
|
||||
GO
|
||||
|
||||
-- ORDERS Table
|
||||
CREATE TABLE dbo.Orders(
|
||||
O_ID bigint IDENTITY(1,1) NOT NULL,
|
||||
O_C_ID bigint NOT NULL INDEX IX_Orders_O_C_ID HASH WITH (BUCKET_COUNT = 1073741824),
|
||||
O_TOTAL decimal(9,2) NOT NULL,
|
||||
O_DTS datetime NOT NULL,
|
||||
O_FM_DTS datetime NOT NULL,
|
||||
|
||||
CONSTRAINT PK_Orders PRIMARY KEY NONCLUSTERED HASH ( O_ID )
|
||||
WITH (BUCKET_COUNT = 1073741824),
|
||||
|
||||
INDEX IX_Orders_DTS (O_FM_DTS, O_DTS ASC)
|
||||
|
||||
) WITH ( MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA )
|
||||
GO
|
||||
|
||||
-- PRODUCTs Table
|
||||
CREATE TABLE dbo.Products(
|
||||
PR_ID bigint NOT NULL,
|
||||
PR_NAME varchar(50) COLLATE Latin1_General_100_BIN2 NOT NULL,
|
||||
PR_TYPE int NOT NULL,
|
||||
PR_DESC varchar(1000) COLLATE Latin1_General_100_BIN2 NOT NULL,
|
||||
PR_PRICE decimal(9,2) NOT NULL,
|
||||
PR_DEC1 float NOT NULL,
|
||||
PR_DEC2 float NOT NULL,
|
||||
PR_DEC3 float NOT NULL,
|
||||
PR_DEC4 float NOT NULL,
|
||||
PR_DEC5 float NOT NULL,
|
||||
PR_DEC6 float NOT NULL,
|
||||
PR_DEC7 float NOT NULL,
|
||||
PR_DEC8 float NOT NULL,
|
||||
PR_DEC9 float NOT NULL,
|
||||
PR_DEC10 float NOT NULL,
|
||||
PR_DEC11 float NOT NULL,
|
||||
PR_DEC12 float NOT NULL,
|
||||
PR_DEC13 float NOT NULL,
|
||||
PR_DEC14 float NOT NULL,
|
||||
PR_DEC15 float NOT NULL,
|
||||
PR_DEC16 float NOT NULL,
|
||||
PR_DEC17 float NOT NULL,
|
||||
PR_DEC18 float NOT NULL,
|
||||
PR_DEC19 float NOT NULL,
|
||||
PR_DEC20 float NOT NULL,
|
||||
PR_DEC21 float NOT NULL,
|
||||
PR_DEC22 float NOT NULL,
|
||||
PR_DEC23 float NOT NULL,
|
||||
PR_DEC24 float NOT NULL,
|
||||
PR_DEC25 float NOT NULL,
|
||||
PR_DEC26 float NOT NULL,
|
||||
PR_DEC27 float NOT NULL,
|
||||
PR_DEC28 float NOT NULL,
|
||||
PR_DEC29 float NOT NULL,
|
||||
PR_DEC30 float NOT NULL,
|
||||
PR_DEC31 float NOT NULL,
|
||||
PR_DEC32 float NOT NULL,
|
||||
PR_DEC33 float NOT NULL,
|
||||
PR_DEC34 float NOT NULL,
|
||||
PR_DEC35 float NOT NULL,
|
||||
PR_DEC36 float NOT NULL,
|
||||
PR_DEC37 float NOT NULL,
|
||||
PR_DEC38 float NOT NULL,
|
||||
PR_DEC39 float NOT NULL,
|
||||
PR_DEC40 float NOT NULL,
|
||||
PR_DEC41 float NOT NULL,
|
||||
PR_DEC42 float NOT NULL,
|
||||
PR_DEC43 float NOT NULL,
|
||||
PR_DEC44 float NOT NULL,
|
||||
PR_DEC45 float NOT NULL,
|
||||
PR_DEC46 float NOT NULL,
|
||||
PR_DEC47 float NOT NULL,
|
||||
PR_DEC48 float NOT NULL,
|
||||
PR_DEC49 float NOT NULL,
|
||||
PR_DEC50 float NOT NULL,
|
||||
PR_DEC51 float NOT NULL,
|
||||
PR_DEC52 float NOT NULL,
|
||||
PR_DEC53 float NOT NULL,
|
||||
PR_DEC54 float NOT NULL,
|
||||
PR_DEC55 float NOT NULL,
|
||||
PR_DEC56 float NOT NULL,
|
||||
PR_DEC57 float NOT NULL,
|
||||
PR_DEC58 float NOT NULL,
|
||||
PR_DEC59 float NOT NULL,
|
||||
PR_DEC60 float NOT NULL,
|
||||
PR_DEC61 float NOT NULL,
|
||||
PR_DEC62 float NOT NULL,
|
||||
PR_DEC63 float NOT NULL,
|
||||
PR_DEC64 float NOT NULL,
|
||||
PR_DEC65 float NOT NULL,
|
||||
PR_DEC66 float NOT NULL,
|
||||
PR_DEC67 float NOT NULL,
|
||||
PR_DEC68 float NOT NULL,
|
||||
PR_DEC69 float NOT NULL,
|
||||
PR_DEC70 float NOT NULL,
|
||||
PR_DEC71 float NOT NULL,
|
||||
PR_DEC72 float NOT NULL,
|
||||
PR_DEC73 float NOT NULL,
|
||||
PR_DEC74 float NOT NULL,
|
||||
PR_DEC75 float NOT NULL,
|
||||
PR_DEC76 float NOT NULL,
|
||||
PR_DEC77 float NOT NULL,
|
||||
PR_DEC78 float NOT NULL,
|
||||
PR_DEC79 float NOT NULL,
|
||||
PR_DEC80 float NOT NULL,
|
||||
PR_DEC81 float NOT NULL,
|
||||
PR_DEC82 float NOT NULL,
|
||||
PR_DEC83 float NOT NULL,
|
||||
PR_DEC84 float NOT NULL,
|
||||
PR_DEC85 float NOT NULL,
|
||||
PR_DEC86 float NOT NULL,
|
||||
PR_DEC87 float NOT NULL,
|
||||
PR_DEC88 float NOT NULL,
|
||||
PR_DEC89 float NOT NULL,
|
||||
PR_DEC90 float NOT NULL,
|
||||
PR_DEC91 float NOT NULL,
|
||||
PR_DEC92 float NOT NULL,
|
||||
PR_DEC93 float NOT NULL,
|
||||
PR_DEC94 float NOT NULL,
|
||||
PR_DEC95 float NOT NULL,
|
||||
PR_DEC96 float NOT NULL,
|
||||
PR_DEC97 float NOT NULL,
|
||||
PR_DEC98 float NOT NULL,
|
||||
PR_DEC99 float NOT NULL,
|
||||
PR_DEC100 float NOT NULL,
|
||||
|
||||
CONSTRAINT PK_Products PRIMARY KEY NONCLUSTERED HASH ( PR_ID )
|
||||
WITH (BUCKET_COUNT = 1073741824),
|
||||
|
||||
INDEX IX_Products_PR_ID NONCLUSTERED (PR_ID),
|
||||
|
||||
INDEX Products_TYPE (PR_TYPE ASC)
|
||||
|
||||
) WITH ( MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA )
|
||||
GO
|
||||
|
||||
-- PURCHASE_CRITERIA Table
|
||||
CREATE TABLE dbo.Purchase_Criteria(
|
||||
PC_ID bigint NOT NULL,
|
||||
PC_DEC1 float NOT NULL,
|
||||
PC_DEC2 float NOT NULL,
|
||||
PC_DEC3 float NOT NULL,
|
||||
PC_DEC4 float NOT NULL,
|
||||
PC_DEC5 float NOT NULL,
|
||||
PC_DEC6 float NOT NULL,
|
||||
PC_DEC7 float NOT NULL,
|
||||
PC_DEC8 float NOT NULL,
|
||||
PC_DEC9 float NOT NULL,
|
||||
PC_DEC10 float NOT NULL,
|
||||
PC_DEC11 float NOT NULL,
|
||||
PC_DEC12 float NOT NULL,
|
||||
PC_DEC13 float NOT NULL,
|
||||
PC_DEC14 float NOT NULL,
|
||||
PC_DEC15 float NOT NULL,
|
||||
PC_DEC16 float NOT NULL,
|
||||
PC_DEC17 float NOT NULL,
|
||||
PC_DEC18 float NOT NULL,
|
||||
PC_DEC19 float NOT NULL,
|
||||
PC_DEC20 float NOT NULL,
|
||||
PC_DEC21 float NOT NULL,
|
||||
PC_DEC22 float NOT NULL,
|
||||
PC_DEC23 float NOT NULL,
|
||||
PC_DEC24 float NOT NULL,
|
||||
PC_DEC25 float NOT NULL,
|
||||
PC_DEC26 float NOT NULL,
|
||||
PC_DEC27 float NOT NULL,
|
||||
PC_DEC28 float NOT NULL,
|
||||
PC_DEC29 float NOT NULL,
|
||||
PC_DEC30 float NOT NULL,
|
||||
PC_DEC31 float NOT NULL,
|
||||
PC_DEC32 float NOT NULL,
|
||||
PC_DEC33 float NOT NULL,
|
||||
PC_DEC34 float NOT NULL,
|
||||
PC_DEC35 float NOT NULL,
|
||||
PC_DEC36 float NOT NULL,
|
||||
PC_DEC37 float NOT NULL,
|
||||
PC_DEC38 float NOT NULL,
|
||||
PC_DEC39 float NOT NULL,
|
||||
PC_DEC40 float NOT NULL,
|
||||
PC_DEC41 float NOT NULL,
|
||||
PC_DEC42 float NOT NULL,
|
||||
PC_DEC43 float NOT NULL,
|
||||
PC_DEC44 float NOT NULL,
|
||||
PC_DEC45 float NOT NULL,
|
||||
PC_DEC46 float NOT NULL,
|
||||
PC_DEC47 float NOT NULL,
|
||||
PC_DEC48 float NOT NULL,
|
||||
PC_DEC49 float NOT NULL,
|
||||
PC_DEC50 float NOT NULL,
|
||||
PC_DEC51 float NOT NULL,
|
||||
PC_DEC52 float NOT NULL,
|
||||
PC_DEC53 float NOT NULL,
|
||||
PC_DEC54 float NOT NULL,
|
||||
PC_DEC55 float NOT NULL,
|
||||
PC_DEC56 float NOT NULL,
|
||||
PC_DEC57 float NOT NULL,
|
||||
PC_DEC58 float NOT NULL,
|
||||
PC_DEC59 float NOT NULL,
|
||||
PC_DEC60 float NOT NULL,
|
||||
PC_DEC61 float NOT NULL,
|
||||
PC_DEC62 float NOT NULL,
|
||||
PC_DEC63 float NOT NULL,
|
||||
PC_DEC64 float NOT NULL,
|
||||
PC_DEC65 float NOT NULL,
|
||||
PC_DEC66 float NOT NULL,
|
||||
PC_DEC67 float NOT NULL,
|
||||
PC_DEC68 float NOT NULL,
|
||||
PC_DEC69 float NOT NULL,
|
||||
PC_DEC70 float NOT NULL,
|
||||
PC_DEC71 float NOT NULL,
|
||||
PC_DEC72 float NOT NULL,
|
||||
PC_DEC73 float NOT NULL,
|
||||
PC_DEC74 float NOT NULL,
|
||||
PC_DEC75 float NOT NULL,
|
||||
PC_DEC76 float NOT NULL,
|
||||
PC_DEC77 float NOT NULL,
|
||||
PC_DEC78 float NOT NULL,
|
||||
PC_DEC79 float NOT NULL,
|
||||
PC_DEC80 float NOT NULL,
|
||||
PC_DEC81 float NOT NULL,
|
||||
PC_DEC82 float NOT NULL,
|
||||
PC_DEC83 float NOT NULL,
|
||||
PC_DEC84 float NOT NULL,
|
||||
PC_DEC85 float NOT NULL,
|
||||
PC_DEC86 float NOT NULL,
|
||||
PC_DEC87 float NOT NULL,
|
||||
PC_DEC88 float NOT NULL,
|
||||
PC_DEC89 float NOT NULL,
|
||||
PC_DEC90 float NOT NULL,
|
||||
PC_DEC91 float NOT NULL,
|
||||
PC_DEC92 float NOT NULL,
|
||||
PC_DEC93 float NOT NULL,
|
||||
PC_DEC94 float NOT NULL,
|
||||
PC_DEC95 float NOT NULL,
|
||||
PC_DEC96 float NOT NULL,
|
||||
PC_DEC97 float NOT NULL,
|
||||
PC_DEC98 float NOT NULL,
|
||||
PC_DEC99 float NOT NULL,
|
||||
PC_DEC100 float NOT NULL,
|
||||
|
||||
CONSTRAINT PK_Purchase_Criteria PRIMARY KEY NONCLUSTERED HASH ( PC_ID )
|
||||
WITH (BUCKET_COUNT = 400000000)
|
||||
|
||||
) WITH ( MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA )
|
||||
GO
|
||||
|
||||
SET ANSI_PADDING OFF
|
||||
GO
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#SQL Security
|
||||
|
||||
Placeholder for summary.
|
||||
<!--laceholder for summary.-->
|
||||
|
||||
[Azure Active Directory Authentication Sample](azure-active-directory-auth)
|
||||
[Azure Active Directory Authentication Demos](azure-active-directory-auth)
|
||||
|
||||
[Azure SQL Security Demo](https://github.com/Microsoft/azure-sql-security-sample)
|
||||
|
||||
[SQL 2016 Security Demo](contoso-clinic)
|
||||
|
||||
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 101 KiB |
|
After Width: | Height: | Size: 89 KiB |
@@ -56,6 +56,8 @@ To run this sample, you need the following prerequisites:
|
||||
|
||||
[Password Demo](password)
|
||||
|
||||
[Token Demo](token)
|
||||
|
||||
<a name=sample-details></a>
|
||||
|
||||
## Sample details
|
||||
@@ -65,7 +67,7 @@ This demo provides a simple tool for exploring Azure Active Directory authentica
|
||||
Azure Active Directory authentication with Azure SQL Database V12 supports the following authentication methods:
|
||||
- User/password authentication
|
||||
- Integrated authentication
|
||||
- Application token authentication [Demo coming soon!]
|
||||
- Application token authentication
|
||||
|
||||
<a name=disclaimers></a>
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="ida:AADInstance" value="https://login.windows.net/{0}"/>
|
||||
<add key="ida:Tenant" value="cqclinic.onmicrosoft.com" />
|
||||
<add key="ida:ClientId" value="a4bbfe26-dbaa-4fec-8ef5-223d229f647d"/>
|
||||
<add key="ida:CertName" value="CN=mytokentestCert"/>
|
||||
<add key="sqldb:ResourceId" value="https://database.windows.net/"/>
|
||||
</appSettings>
|
||||
</configuration>
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace ClinicService
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
|
||||
builder["Data Source"] = "aad-managed-demo.database.windows.net"; // replace with your server name
|
||||
builder["Initial Catalog"] = "demo"; // replace with your database name
|
||||
builder["Connect Timeout"] = 30;
|
||||
|
||||
string accessToken = TokenFactory.GetAccessToken();
|
||||
if (accessToken == null)
|
||||
{
|
||||
Console.WriteLine("Fail to acuire the token to the database.");
|
||||
}
|
||||
using (SqlConnection connection = new SqlConnection(builder.ConnectionString))
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.AccessToken = accessToken;
|
||||
connection.Open();
|
||||
Console.WriteLine("Connected to the database");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
Console.WriteLine("Please press any key to stop");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Token")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Token")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("fd1b972e-0e8a-43df-94a4-5f9d0ae1a9aa")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,96 @@
|
||||
# Token Authentication sample for Azure Active Directory
|
||||
|
||||
### Contents
|
||||
|
||||
[About this sample](#about-this-sample)<br/>
|
||||
[Run this sample](#run-this-sample)<br/>
|
||||
[Sample details](#sample-details)<br/>
|
||||
|
||||
## About this sample
|
||||
|
||||
The Token project contains a simple console application that connects to Azure SQL database using a self-signed certificate.
|
||||
|
||||
**Software prerequisites:**
|
||||
|
||||
1. The `makecert.exe` utility, which is included in the Windows SDK
|
||||
+ It is sometimes included in Visual Studio installations (depending on the selections made during installation). A search of your machine for `makecert.exe` would provide verification that the Windows SDK was installed.
|
||||
+ If the Windows SDK was not installed, you may [download it here](http://msdn.microsoft.com/en-US/windows/desktop/aa904949)
|
||||
+ You can learn more about the `makecert.exe` [utility here](https://msdn.microsoft.com/library/windows/desktop/aa386968.aspx)
|
||||
2. PowerShell with Azure Active Directory Module
|
||||
+ To download the latest PowerShell version [see this page](https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/#Install)
|
||||
+ [Install the Azure AD PowerShell Module](https://msdn.microsoft.com/en-us/library/azure/jj151815.aspx), if it is not already installed in your client machine.
|
||||
|
||||
<a name=run-this-sample></a>
|
||||
## Run this sample
|
||||
|
||||
1. Create an application account in Azure AD for your service.
|
||||
- Sign in to the Azure management portal.
|
||||
- Click on Azure Active Directory in the left hand navigation
|
||||
- Click the directory tenant where you wish to register the sample application. This must be the same directory that is associated with your database (the server hosting your database).
|
||||
- Click the Applications tab
|
||||
- In the drawer, click Add.
|
||||
- Click "Add an application my organization is developing".
|
||||
- Enter mytokentest as a friendly name for the application, select "Web Application and/or Web API", and click next.
|
||||
- Assuming this application is a daemon/service and not a web application, it doesn't have a sign-in URL or app ID URI. For these two fields, enter http://mytokentest
|
||||
- While still in the Azure portal, click the Configure tab of your application.
|
||||
- Find the Client ID value and copy it into a text editor, you will need this later when configuring your application ( i.e. a4bbfe26-dbaa-4fec-8ef5-223d229f647d /see the snapshot below/)
|
||||

|
||||
|
||||
2. Logon to your Azure SQL Server’s user database as an Azure AD admin and using a T-SQL command provision a contained database user for your application principal:
|
||||
```sql
|
||||
CREATE USER [mytokentest] FROM EXTERNAL PROVIDER
|
||||
```
|
||||
- [See this link](https://azure.microsoft.com/en-us/documentation/articles/sql-database-aad-authentication/) for more details on how to create an Azure Ad admin and a contained database user.
|
||||
|
||||
3. On the machine you are going to run the project on, generate and install a self-signed certificate.
|
||||
- To complete this step, you will need to use `Makecert.exe`
|
||||
- Open a command prompt window
|
||||
- Navigate to a folder where you want to generate a certificate file ( such as the folder where the demo files are) and change the following command for your environment
|
||||
```
|
||||
<Windows SDK Path>\makecert.exe -r -pe -n "CN=Cert_name" -ss My -len 2048 Cert_name.cer
|
||||
```
|
||||
for example, like so:
|
||||
```
|
||||
c:/"Program Files (x86)/Windows Kits/8.1/bin/x64"/makecert -r -pe -n "CN=mytokentestCert" -ss My -len 2048 mytokentestCert.cer
|
||||
```
|
||||
4. Add the certificate as a key for the application you created in Azure AD.
|
||||
- Click the Microsoft Azure Active Directory Module for Windows PowerShell shortcut on desktop to open a Windows PowerShell workspace that has the Azure AD cmdlets.
|
||||
- Copy the following code snippet to a text editor.
|
||||
- `connect-msolservice` will ask for you Azure AD credentials. Please be sure to use credentials that are part of Azure AD global admin to connect and to proceed with the scripts below.
|
||||
```
|
||||
connect-msolservice
|
||||
|
||||
$cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate
|
||||
$cer.Import("<full path>\Cert_name.cer")
|
||||
$binCert = $cer.GetRawCertData()
|
||||
$credValue = [System.Convert]::ToBase64String($binCert);
|
||||
New-MsolServicePrincipalCredential -AppPrincipalId "<client id>" -Type asymmetric -Value $credValue -Usage verify
|
||||
```
|
||||
+ Replace <full path> with the path to your certificate and Cert_name with your Certificate name that you used in step 3 above.
|
||||
+ Replace <client id> with the client ID you copied in step 1.
|
||||
+ Copy and paste your snippet into the powershell window and run it.
|
||||
- The following command will verify that you added the certificate to your application's Active Directory Registration
|
||||
``` Get-MsolServicePrincipalCredential –ServicePrincipalName "URL"-ReturnKeyValues 0 ```
|
||||
|
||||
5. Configure the certificate and your application account in the *app.config* file in the project.
|
||||
+ In Visual Studio, open *app.config* in the Solution Explorer
|
||||

|
||||
- Find the app key `ida:Tenant` and replace the value with your AAD tenant name (your AAD domain)
|
||||
- Find the app key `ida:ClientID` and replace the value with the Client ID for the application registration from the Azure Portal (the value from step 1).
|
||||
- Find the app key `ida:Cert_Name` and replace the value with the subject name (CN) of the self-signed certificate you created
|
||||
- For example:
|
||||
```csharp
|
||||
<add key="ida:Tenant" value="cqclinic.onmicrosoft.com" /> //this is the AAD domain
|
||||
<add key="ida:ClientId" value="a4bbfe26-dbaa-4fec-8ef5-223d229f647d"/> //this is the Client ID
|
||||
<add key="ida:CertName" value="CN=mytokentestCert"/> //this is the Cert_name use by makecert.exe
|
||||
```
|
||||
+ In Visual Studio, open *Program.cs* in the Solution Explorer
|
||||

|
||||
- Make the following changes:
|
||||
```csharp
|
||||
builder["Data Source"] = "aad-managed-demo.database.windows.net"; // replace with your server name
|
||||
builder["Initial Catalog"] = "demo"; // replace with your database name
|
||||
```
|
||||
6. Run the demo. (Click *Run* or press *F5*)
|
||||
+ A successful authorization should result in a message that states "Connected to the database" similar to the following:
|
||||

|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{FD1B972E-0E8A-43DF-94A4-5F9D0AE1A9AA}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Token</RootNamespace>
|
||||
<AssemblyName>Token</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.9.10826.1824\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.9.10826.1824\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TokenFactory.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,136 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Globalization;
|
||||
using Microsoft.IdentityModel.Clients.ActiveDirectory;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Configuration;
|
||||
|
||||
namespace ClinicService
|
||||
{
|
||||
class TokenFactory
|
||||
{
|
||||
//
|
||||
// The Client ID is used by the application to uniquely identify itself to Azure AD.
|
||||
// The Cert Name is the subject name of the certificate used to authenticate this application to Azure AD.
|
||||
// The Tenant is the name of the Azure AD tenant in which this application is registered.
|
||||
// The AAD Instance is the instance of Azure, for example public Azure or Azure China.
|
||||
// The Authority is the sign-in URL of the tenant.
|
||||
//
|
||||
private static string aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"];
|
||||
private static string tenant = ConfigurationManager.AppSettings["ida:Tenant"];
|
||||
private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
|
||||
private static string certName = ConfigurationManager.AppSettings["ida:CertName"];
|
||||
|
||||
static string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant);
|
||||
|
||||
//
|
||||
// To authenticate to the To Do list service, the client needs to know the service's App ID URI.
|
||||
// To contact the To Do list service we need it's URL as well.
|
||||
//
|
||||
private static string sqlDBResourceId = ConfigurationManager.AppSettings["sqldb:ResourceId"];
|
||||
//private static string todoListBaseAddress = ConfigurationManager.AppSettings["todo:TodoListBaseAddress"];
|
||||
|
||||
private static HttpClient httpClient = new HttpClient();
|
||||
private static AuthenticationContext authContext = null;
|
||||
private static ClientAssertionCertificate certCred = null;
|
||||
private static string token;
|
||||
|
||||
public static string GetAccessToken()
|
||||
{
|
||||
//
|
||||
// Create the authentication context to be used to acquire tokens.
|
||||
//
|
||||
authContext = new AuthenticationContext(authority);
|
||||
|
||||
//
|
||||
// Initialize the Certificate Credential to be used by ADAL.
|
||||
// First find the matching certificate in the cert store.
|
||||
//
|
||||
|
||||
X509Certificate2 cert = null;
|
||||
X509Store store = new X509Store(StoreLocation.CurrentUser);
|
||||
try
|
||||
{
|
||||
store.Open(OpenFlags.ReadOnly);
|
||||
// Place all certificates in an X509Certificate2Collection object.
|
||||
X509Certificate2Collection certCollection = store.Certificates;
|
||||
// Find unexpired certificates.
|
||||
X509Certificate2Collection currentCerts = certCollection.Find(X509FindType.FindByTimeValid, DateTime.Now, false);
|
||||
// From the collection of unexpired certificates, find the ones with the correct name.
|
||||
X509Certificate2Collection signingCert = currentCerts.Find(X509FindType.FindBySubjectDistinguishedName, certName, false);
|
||||
if (signingCert.Count == 0)
|
||||
{
|
||||
throw new Exception("Cannot find certificate: " + certName);
|
||||
}
|
||||
// Return the first certificate in the collection, has the right name and is current.
|
||||
cert = signingCert[0];
|
||||
}
|
||||
finally
|
||||
{
|
||||
store.Close();
|
||||
}
|
||||
|
||||
// Then create the certificate credential.
|
||||
certCred = new ClientAssertionCertificate(clientId, cert);
|
||||
AcquireToken().Wait();
|
||||
return token;
|
||||
}
|
||||
|
||||
static async Task AcquireToken()
|
||||
{
|
||||
//
|
||||
// Get an access token from Azure AD using client credentials.
|
||||
// If the attempt to get a token fails because the server is unavailable, retry twice after 3 seconds each.
|
||||
//
|
||||
AuthenticationResult result = null;
|
||||
int retryCount = 0;
|
||||
bool retry = false;
|
||||
token = null;
|
||||
|
||||
do
|
||||
{
|
||||
retry = false;
|
||||
try
|
||||
{
|
||||
// ADAL includes an in memory cache, so this call will only send a message to the server if the cached token is expired.
|
||||
result = await authContext.AcquireTokenAsync(sqlDBResourceId, certCred);
|
||||
}
|
||||
catch (AdalException ex)
|
||||
{
|
||||
if (ex.ErrorCode == "temporarily_unavailable")
|
||||
{
|
||||
retry = true;
|
||||
retryCount++;
|
||||
Thread.Sleep(3000);
|
||||
}
|
||||
|
||||
Console.WriteLine(
|
||||
String.Format("An error occurred while acquiring a token\nTime: {0}\nError: {1}\nRetry: {2}\n",
|
||||
DateTime.Now.ToString(),
|
||||
ex.ToString(),
|
||||
retry.ToString()));
|
||||
}
|
||||
|
||||
} while ((retry == true) && (retryCount < 3));
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
Console.WriteLine("Canceling attempt to contact To Do list service.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
token = result.AccessToken;
|
||||
Console.WriteLine("The access token obtained is:");
|
||||
Console.WriteLine("--------------------------------------------------");
|
||||
Console.WriteLine(result.AccessToken);
|
||||
Console.WriteLine("--------------------------------------------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.9.10826.1824" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -0,0 +1,7 @@
|
||||
src/.vs/
|
||||
src/packages/
|
||||
src/ContosoClinic/obj
|
||||
src/ContosoClinic/bin
|
||||
src/ContosoClinicProject/ContosoClinic/Project_Readme.html
|
||||
src/ContosoClinic/ContosoClinic.csproj.user
|
||||
!src/ContosoClinic.sln
|
||||
@@ -0,0 +1,152 @@
|
||||
#Contoso Clinic Demo Application
|
||||
|
||||
Sample application with database that showcases security features of SQL Server 2016.
|
||||
|
||||
## About this sample
|
||||
- **Applies to:** Azure SQL Database, Azure Web App Service, Azure Key Vault
|
||||
- **Programming Language:** .NET C#, T-SQL
|
||||
- **Authors:** Jakub Szymaszek [jaszymas-MSFT], Daniel Rediske [daredis-msft]
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](http://microsoft.github.io/codeofconduct). For more information see the [Code of Conduct FAQ](http://microsoft.github.io/codeofconduct/faq.md) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||
##Contents
|
||||
1. [Prerequisites] (#prerequisites)
|
||||
2. [Setup] (#setup)
|
||||
* Set up the Demo Database
|
||||
* Modify the Sample Application
|
||||
4. [SQL 2016 Security Features in this demo] (#sql-2016-security-features-in-this-demo)
|
||||
* Always Encrypted
|
||||
* Row Level Security
|
||||
* Dynamic Data Masking
|
||||
5. [Application Notes] (#application-notes)
|
||||
|
||||
|
||||
|
||||
##Prerequisites
|
||||
1. Visual Studio 2015 (or newer)
|
||||
2. [SQL Server 2016](https://www.microsoft.com/en-us/evalcenter/evaluate-sql-server-2016) OR an Azure SQL Database (V12) [portal link](https://portal.azure.com)
|
||||
3. [SQL Server Management Studio](https://msdn.microsoft.com/en-us/library/mt238290.aspx.)
|
||||
|
||||
##Setup
|
||||
### Set up the Demo Database
|
||||
1. Clone/Download the repository
|
||||
2. While connected to your database (master) via SSMS, execute [Create-Application-Login.sql](tsql/Create-Application-Login.sql) link.
|
||||
+ You should change the default password in the script before running it.
|
||||
3. Import the *Clinic* database
|
||||
+ Open SSMS and connect to your SQL Server 2016 instance (or Azure SQL Database instance)
|
||||
+ In SSMS, right-click on *Databases* in Object Explorer and select *Import Data-tier Application...*.
|
||||
+ Locate your copy of the bacpac file, located in the */setup* folder.
|
||||

|
||||
+ Complete the steps of the wizard.
|
||||
+ NOTE: the Clinic database contains the ContosoClinicApplication database user, based on the ContosoClinicApplication login, which you provisioned above. The user is assigned a few roles and is granted permissions which are required to complete the demos in this package.
|
||||
|
||||
### Modify and Set up the Sample Application Project
|
||||
1. Start Visual Studio and open the Contoso Application solution file- located in /src.
|
||||
2. Modify the connection string in the demo web app.
|
||||
|
||||
+ Using Solution Explorer, locate and open the web.config file under the ContosoClinic project.
|
||||
+ Look for the line that looks like this:
|
||||
```csharp
|
||||
<add name="DefaultConnection" connectionString="Data Source=<servername>;Initial Catalog=Clinic;User
|
||||
ID=ContosoClinicApplication;Password=<password>" providerName="System.Data.SqlClient" />
|
||||
```
|
||||
+ Update the value of the *Data Source* key word in the database connection string to denote your server (either your local SQL Server instance of your logical server in Azure SQL Database)
|
||||
+ Make sure the *password* for your application users is correct (matches the password that you configured earlier)
|
||||
+ Make sure the *Initial Catalog* value is set to *Clinic*
|
||||
+ Save the file
|
||||
|
||||
3. Make sure the .NET Framework 4.6.1 or higher is configured as the target .NET Framework for your project.
|
||||
|
||||
+ Right click on your project in Solution Explorer and select *Properties*
|
||||
+ Verify the value of the Target framework property is correct (change it, if necessary)
|
||||

|
||||
|
||||
4. Test the Demo Setup
|
||||
+ Run the ContosoClinic application from Visual Studio (by hitting *F5* OR select *Debug* > *Start Debugging*). This will compile the solution and open the application in your default web browser.
|
||||
+ Click on the *Patients* tab. You should see a list of patients.
|
||||

|
||||
+ Click *Edit* for one of the patients, change patient's SSN and click *Save*. The updated SSN should show up in the list of patients.
|
||||
+ You are now ready to demo the security features described below.
|
||||
|
||||
## SQL 2016 Security Features in this Demo
|
||||
### Always Encrypted
|
||||
####Enable Always Encrypted
|
||||
+ Connect to your database using SSMS:
|
||||
- For more information on using SSMS to connect to a Database, [click here](https://azure.microsoft.com/en-us/documentation/articles/sql-database-connect-query-ssms/)
|
||||
+ Encrypt Sensitive Data Columns using the Column Encryption Wizard
|
||||
- Right click on the **Patients** table in the **Clinic** database and select **Encrypt Columns...**
|
||||

|
||||
- The Column Encryption wizard will open. Click **Next**.
|
||||

|
||||
- Select the **SSN** and **BirthDate** columns.
|
||||
* Select **Deterministic Encryption** for **SSN** as the application needs to be able to search patients by SSN; Deterministic Encryption preserves that functionality for our app without leaving data exposed.
|
||||
* Select **Randomized Encryption** for **BirthDate**
|
||||

|
||||
- Leave **CEK_Auto1 (New)** as the Key for both columns. Click **Next**.
|
||||
- On the **Master Key Configuration** page, the Master Key Source should default to to **Windows Certificate Store**, with the **Master Key Source** defaulted to **Current User**. (This will store the key on your local machine.)
|
||||

|
||||
- Click the **Next** button on the Validation page.
|
||||

|
||||
- The Summary Page provides an overview of the settings we selected. Click **Finish**.
|
||||

|
||||
- Monitor the progress of the wizard; once finished, click **Close**.
|
||||

|
||||
+ View the data in SSMS (in SSMS use: `SELECT SSN, BirthDate FROM dbo.Patients` or `SELECT * FROM dbo.Patients` )
|
||||
- Note that the data is now encrypted on the server for both the **SSN** and **BirthDate** columns.
|
||||
+ Navigate to or refresh the /patients page
|
||||
- Notice that the application now throws an exception.
|
||||
- This was expected as the application driver does not know how to handle the encrypted data.
|
||||
- We designed this web app to have a type mismatch, but more flexible webpage design would expose the encrypted value.
|
||||
+ Configure the web app to use Always Encrypted
|
||||
- Stop the web app (close the window/ or click *Stop Debugging*)
|
||||
- Using the Solution Explorer of Visual Studio, locate and open the web.config file under the ContosoClinic project.
|
||||
- Look for the connection string, and add `Column Encryption Setting=Enabled` to the end of the connection string so that it reads like this:
|
||||
```csharp
|
||||
<add name="DefaultConnection" connectionString="Data Source=.;Initial Catalog=Clinic;User
|
||||
ID=ContosoClinicApplication;Password={Some Strong Password};Column Encryption Setting=Enabled"
|
||||
providerName="System.Data.SqlClient" />
|
||||
```
|
||||
- Run the ContosoClinic application from Visual Studio (by hitting *F5* OR select *Debug* > *Start Debugging*)
|
||||
- Click on the *Patients* tab. You should see a list of patients again.
|
||||
|
||||
####How did that work?
|
||||
##### Connection String
|
||||
Our connection string for our application now contains `Column Encryption Setting=Enabled` which instructs the driver to automatically encrypt parameters targeting encrypted columns and decrypt any results retrieved from encrypted columns, without code changes. Don't forget this for your app if you intend to use Always Encrypted functonality. For more information this feature, [see our blog](https://blogs.msdn.microsoft.com/sqlsecurity/2016/07/11/always-encrypted-in-azure-sql-database-is-generally-available/).
|
||||
|
||||
### Row Level Security (RLS)
|
||||
|
||||
####Login to the application
|
||||
Sign in using (Rachel@contoso.com/Password1!) or (alice@contoso.com/Password1!)
|
||||
|
||||
####Enable Row Level Security (RLS)
|
||||
+ Connect to your database using SSMS:
|
||||
[Instructions](https://azure.microsoft.com/en-us/documentation/articles/sql-database-connect-query-ssms/)
|
||||
+ Open Enable-RLS.sql ( [Find it here](Security%20Demo%20Queries/Enable-RLS.sql))
|
||||
+ Execute the commands
|
||||
+ Observe the changes to the results returned on the /visits or /patients page
|
||||
|
||||
#### How did that work?
|
||||
|
||||
#####The application leverages an Entity Framework feature called **interceptors**
|
||||
Specifically, we used a `DbConnectionInterceptor`. The `Opened()` function is called whenever Entity Framework opens a connection and we set SESSION_CONTEXT with the current application `UserId` there.
|
||||
|
||||
##### Predicate functions
|
||||
The predicate functions we created in Enable-RLS.sql identify users by the `UserId` which was set by our interceptor whenever a connection is established from the application. The two types of predicates we created were **Filter** and **Block**.
|
||||
+ **Filter** predicates silently filter `SELECT`, `UPDATE`, and `DELETE` operations to exclude rows that do not satisfy the predicate.
|
||||
+ **Block** predicates explicitly block (throw errors) on `INSERT`, `UPDATE`, and `DELETE` operations that do not satisfy the predicate.
|
||||
|
||||
### Dynamic Data Masking
|
||||
|
||||
#### Enable Dynamic Data Masking
|
||||
+ Navigate to the /patients page
|
||||
+ Connect to your deployed database using SSMS: [Instructions](https://azure.microsoft.com/en-us/documentation/articles/sql-database-connect-query-ssms/)
|
||||
+ Open Enable-DDM.sql ([Find it here](Security%20Demo%20Queries/Enable-DDM.sql))
|
||||
+ Execute the commands
|
||||
+ Observe the changes in results returned on the /visits page
|
||||
|
||||
#### How did that work?
|
||||
Dynamic data masking limits sensitive data exposure by masking the data according to policies defined on the database level while the data in the database remains unchanged; this is based on the database user's permissions. Those with the `UNMASK` permission will
|
||||
have the ability to see the data without masks. In our case, the application's database login did not have the `UNMASK` permission and saw the data as masked. For your administrator login, the data was visible, as the user had the `UNMASK` permission. For more information on Dynamic Data Masking, [see the documentation](https://msdn.microsoft.com/en-us/library/mt130841.aspx).
|
||||
|
||||
## Application Notes
|
||||
The code included in this sample is only intended to provide a simple demo platform for users to enable and gain experience with SQL Server 2016 security features; the demo web app is not intended to hold sensitive data and should not be used as a reference for applications that use or store sensitive data. Please take adequate steps to securely develop your application and store your data.
|
||||
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,3 @@
|
||||
-- Create a non-sysadmin account for the application to use
|
||||
CREATE LOGIN ContosoClinicApplication WITH PASSWORD = '{Some Strong Password}'
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContosoClinic", "ContosoClinic\ContosoClinic.csproj", "{CD00D85A-BCAC-4784-AAEE-F8A04F671168}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CD00D85A-BCAC-4784-AAEE-F8A04F671168}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CD00D85A-BCAC-4784-AAEE-F8A04F671168}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CD00D85A-BCAC-4784-AAEE-F8A04F671168}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CD00D85A-BCAC-4784-AAEE-F8A04F671168}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Web;
|
||||
using System.Web.Optimization;
|
||||
|
||||
namespace ContosoClinic
|
||||
{
|
||||
public class BundleConfig
|
||||
{
|
||||
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
|
||||
public static void RegisterBundles(BundleCollection bundles)
|
||||
{
|
||||
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
|
||||
"~/Scripts/jquery-{version}.js"));
|
||||
|
||||
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
|
||||
"~/Scripts/jquery.validate*"));
|
||||
|
||||
// Use the development version of Modernizr to develop with and learn from. Then, when you're
|
||||
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
|
||||
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
|
||||
"~/Scripts/modernizr-*"));
|
||||
|
||||
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
|
||||
"~/Scripts/bootstrap.js",
|
||||
"~/Scripts/respond.js"));
|
||||
|
||||
bundles.Add(new StyleBundle("~/Content/css").Include(
|
||||
"~/Content/bootstrap.css",
|
||||
"~/Content/site.css"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace ContosoClinic
|
||||
{
|
||||
public class FilterConfig
|
||||
{
|
||||
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
|
||||
{
|
||||
filters.Add(new HandleErrorAttribute());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using Microsoft.AspNet.Identity.Owin;
|
||||
using Microsoft.Owin;
|
||||
using Microsoft.Owin.Security;
|
||||
using ContosoClinic.Models;
|
||||
|
||||
namespace ContosoClinic
|
||||
{
|
||||
public class EmailService : IIdentityMessageService
|
||||
{
|
||||
public Task SendAsync(IdentityMessage message)
|
||||
{
|
||||
// Plug in your email service here to send an email.
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
}
|
||||
|
||||
public class SmsService : IIdentityMessageService
|
||||
{
|
||||
public Task SendAsync(IdentityMessage message)
|
||||
{
|
||||
// Plug in your SMS service here to send a text message.
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
}
|
||||
|
||||
// Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application.
|
||||
public class ApplicationUserManager : UserManager<ApplicationUser>
|
||||
{
|
||||
public ApplicationUserManager(IUserStore<ApplicationUser> store)
|
||||
: base(store)
|
||||
{
|
||||
}
|
||||
|
||||
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
|
||||
{
|
||||
var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<ApplicationDbContext>()));
|
||||
// Configure validation logic for usernames
|
||||
manager.UserValidator = new UserValidator<ApplicationUser>(manager)
|
||||
{
|
||||
AllowOnlyAlphanumericUserNames = false,
|
||||
RequireUniqueEmail = true
|
||||
};
|
||||
|
||||
// Configure validation logic for passwords
|
||||
manager.PasswordValidator = new PasswordValidator
|
||||
{
|
||||
RequiredLength = 6,
|
||||
RequireNonLetterOrDigit = true,
|
||||
RequireDigit = true,
|
||||
RequireLowercase = true,
|
||||
RequireUppercase = true,
|
||||
};
|
||||
|
||||
// Configure user lockout defaults
|
||||
manager.UserLockoutEnabledByDefault = true;
|
||||
manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5);
|
||||
manager.MaxFailedAccessAttemptsBeforeLockout = 5;
|
||||
|
||||
// Register two factor authentication providers. This application uses Phone and Emails as a step of receiving a code for verifying the user
|
||||
// You can write your own provider and plug it in here.
|
||||
manager.RegisterTwoFactorProvider("Phone Code", new PhoneNumberTokenProvider<ApplicationUser>
|
||||
{
|
||||
MessageFormat = "Your security code is {0}"
|
||||
});
|
||||
manager.RegisterTwoFactorProvider("Email Code", new EmailTokenProvider<ApplicationUser>
|
||||
{
|
||||
Subject = "Security Code",
|
||||
BodyFormat = "Your security code is {0}"
|
||||
});
|
||||
manager.EmailService = new EmailService();
|
||||
manager.SmsService = new SmsService();
|
||||
var dataProtectionProvider = options.DataProtectionProvider;
|
||||
if (dataProtectionProvider != null)
|
||||
{
|
||||
manager.UserTokenProvider =
|
||||
new DataProtectorTokenProvider<ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity"));
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
}
|
||||
|
||||
// Configure the application sign-in manager which is used in this application.
|
||||
public class ApplicationSignInManager : SignInManager<ApplicationUser, string>
|
||||
{
|
||||
public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticationManager)
|
||||
: base(userManager, authenticationManager)
|
||||
{
|
||||
}
|
||||
|
||||
public override Task<ClaimsIdentity> CreateUserIdentityAsync(ApplicationUser user)
|
||||
{
|
||||
return user.GenerateUserIdentityAsync((ApplicationUserManager)UserManager);
|
||||
}
|
||||
|
||||
public static ApplicationSignInManager Create(IdentityFactoryOptions<ApplicationSignInManager> options, IOwinContext context)
|
||||
{
|
||||
return new ApplicationSignInManager(context.GetUserManager<ApplicationUserManager>(), context.Authentication);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace ContosoClinic
|
||||
{
|
||||
public class RouteConfig
|
||||
{
|
||||
public static void RegisterRoutes(RouteCollection routes)
|
||||
{
|
||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||
|
||||
routes.MapRoute(
|
||||
name: "Default",
|
||||
url: "{controller}/{action}/{id}",
|
||||
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNet.Identity.Owin;
|
||||
using Microsoft.Owin;
|
||||
using Microsoft.Owin.Security.Cookies;
|
||||
using Microsoft.Owin.Security.Google;
|
||||
using Owin;
|
||||
using ContosoClinic.Models;
|
||||
|
||||
namespace ContosoClinic
|
||||
{
|
||||
public partial class Startup
|
||||
{
|
||||
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
|
||||
public void ConfigureAuth(IAppBuilder app)
|
||||
{
|
||||
// Configure the db context, user manager and signin manager to use a single instance per request
|
||||
app.CreatePerOwinContext(ApplicationDbContext.Create);
|
||||
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
|
||||
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
|
||||
|
||||
// Enable the application to use a cookie to store information for the signed in user
|
||||
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
|
||||
// Configure the sign in cookie
|
||||
app.UseCookieAuthentication(new CookieAuthenticationOptions
|
||||
{
|
||||
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
|
||||
LoginPath = new PathString("/Account/Login"),
|
||||
Provider = new CookieAuthenticationProvider
|
||||
{
|
||||
// Enables the application to validate the security stamp when the user logs in.
|
||||
// This is a security feature which is used when you change a password or add an external login to your account.
|
||||
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
|
||||
validateInterval: TimeSpan.FromMinutes(30),
|
||||
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
|
||||
}
|
||||
});
|
||||
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
|
||||
|
||||
// Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process.
|
||||
app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));
|
||||
|
||||
// Enables the application to remember the second login verification factor such as phone or email.
|
||||
// Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from.
|
||||
// This is similar to the RememberMe option when you log in.
|
||||
app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);
|
||||
|
||||
// Uncomment the following lines to enable logging in with third party login providers
|
||||
//app.UseMicrosoftAccountAuthentication(
|
||||
// clientId: "",
|
||||
// clientSecret: "");
|
||||
|
||||
//app.UseTwitterAuthentication(
|
||||
// consumerKey: "",
|
||||
// consumerSecret: "");
|
||||
|
||||
//app.UseFacebookAuthentication(
|
||||
// appId: "",
|
||||
// appSecret: "");
|
||||
|
||||
//app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
|
||||
//{
|
||||
// ClientId = "",
|
||||
// ClientSecret = ""
|
||||
//});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
body {
|
||||
padding-top: 50px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
/* Set padding to keep content from hitting the edges */
|
||||
.body-content {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
/* Override the default bootstrap behavior where horizontal description lists
|
||||
will truncate terms that are too long to fit in the left column
|
||||
*/
|
||||
.dl-horizontal dt {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
/* Set width on the form input elements since they're 100% wide by default */
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
max-width: 280px;
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
|
||||
<Import Project="..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{CD00D85A-BCAC-4784-AAEE-F8A04F671168}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ContosoClinic</RootNamespace>
|
||||
<AssemblyName>ContosoClinic</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<MvcBuildViews>false</MvcBuildViews>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Entity" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http">
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest">
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Optimization">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WebGrease">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\WebGrease.1.5.2\lib\WebGrease.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Antlr3.Runtime">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework">
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer">
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.AspNet.Identity.Core">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.AspNet.Identity.Owin">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.AspNet.Identity.EntityFramework">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Identity.EntityFramework.2.2.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Owin">
|
||||
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin">
|
||||
<HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Host.SystemWeb">
|
||||
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Security">
|
||||
<HintPath>..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Security.Facebook">
|
||||
<HintPath>..\packages\Microsoft.Owin.Security.Facebook.3.0.1\lib\net45\Microsoft.Owin.Security.Facebook.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Security.Cookies">
|
||||
<HintPath>..\packages\Microsoft.Owin.Security.Cookies.3.0.1\lib\net45\Microsoft.Owin.Security.Cookies.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Security.OAuth">
|
||||
<HintPath>..\packages\Microsoft.Owin.Security.OAuth.3.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Security.Google">
|
||||
<HintPath>..\packages\Microsoft.Owin.Security.Google.3.0.1\lib\net45\Microsoft.Owin.Security.Google.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Security.Twitter">
|
||||
<HintPath>..\packages\Microsoft.Owin.Security.Twitter.3.0.1\lib\net45\Microsoft.Owin.Security.Twitter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin.Security.MicrosoftAccount">
|
||||
<HintPath>..\packages\Microsoft.Owin.Security.MicrosoftAccount.3.0.1\lib\net45\Microsoft.Owin.Security.MicrosoftAccount.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App_Start\BundleConfig.cs" />
|
||||
<Compile Include="App_Start\FilterConfig.cs" />
|
||||
<Compile Include="App_Start\IdentityConfig.cs" />
|
||||
<Compile Include="App_Start\RouteConfig.cs" />
|
||||
<Compile Include="App_Start\Startup.Auth.cs" />
|
||||
<Compile Include="Controllers\AccountController.cs" />
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
<Compile Include="Controllers\ManageController.cs" />
|
||||
<Compile Include="Controllers\PatientsController.cs" />
|
||||
<Compile Include="Controllers\VisitsController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201602170540262_Initial.cs" />
|
||||
<Compile Include="Migrations\201602170540262_Initial.Designer.cs">
|
||||
<DependentUpon>201602170540262_Initial.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201602170605457_Visits.cs" />
|
||||
<Compile Include="Migrations\201602170605457_Visits.Designer.cs">
|
||||
<DependentUpon>201602170605457_Visits.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201602170720063_Nullability.cs" />
|
||||
<Compile Include="Migrations\201602170720063_Nullability.Designer.cs">
|
||||
<DependentUpon>201602170720063_Nullability.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201602170857179_Assignments.cs" />
|
||||
<Compile Include="Migrations\201602170857179_Assignments.Designer.cs">
|
||||
<DependentUpon>201602170857179_Assignments.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Models\AccountViewModels.cs" />
|
||||
<Compile Include="Models\ClinicModels.cs" />
|
||||
<Compile Include="Models\IdentityModels.cs" />
|
||||
<Compile Include="Models\ManageViewModels.cs" />
|
||||
<Compile Include="Models\SessionContextInterceptor.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Startup.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\bootstrap.css" />
|
||||
<Content Include="Content\bootstrap.min.css" />
|
||||
<Content Include="favicon.ico" />
|
||||
<Content Include="fonts\glyphicons-halflings-regular.svg" />
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="Content\Site.css" />
|
||||
<Content Include="Scripts\bootstrap.js" />
|
||||
<Content Include="Scripts\bootstrap.min.js" />
|
||||
<None Include="Properties\PublishProfiles\app.pubxml" />
|
||||
<None Include="Scripts\jquery-1.10.2.intellisense.js" />
|
||||
<Content Include="Scripts\jquery-1.10.2.js" />
|
||||
<Content Include="Scripts\jquery-1.10.2.min.js" />
|
||||
<None Include="Scripts\jquery.validate-vsdoc.js" />
|
||||
<Content Include="Scripts\jquery.validate.js" />
|
||||
<Content Include="Scripts\jquery.validate.min.js" />
|
||||
<Content Include="Scripts\jquery.validate.unobtrusive.js" />
|
||||
<Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
|
||||
<Content Include="Scripts\modernizr-2.6.2.js" />
|
||||
<Content Include="Scripts\respond.js" />
|
||||
<Content Include="Scripts\respond.min.js" />
|
||||
<Content Include="Scripts\_references.js" />
|
||||
<Content Include="Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Web.Release.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Views\Web.config" />
|
||||
<Content Include="Views\_ViewStart.cshtml" />
|
||||
<Content Include="Views\Shared\Error.cshtml" />
|
||||
<Content Include="Views\Shared\_Layout.cshtml" />
|
||||
<Content Include="Views\Home\About.cshtml" />
|
||||
<Content Include="Views\Home\Contact.cshtml" />
|
||||
<Content Include="Views\Home\Index.cshtml" />
|
||||
<Content Include="Views\Account\_ExternalLoginsListPartial.cshtml" />
|
||||
<Content Include="Views\Account\ConfirmEmail.cshtml" />
|
||||
<Content Include="Views\Account\ExternalLoginConfirmation.cshtml" />
|
||||
<Content Include="Views\Account\ExternalLoginFailure.cshtml" />
|
||||
<Content Include="Views\Account\ForgotPassword.cshtml" />
|
||||
<Content Include="Views\Account\ForgotPasswordConfirmation.cshtml" />
|
||||
<Content Include="Views\Account\Login.cshtml" />
|
||||
<Content Include="Views\Account\Register.cshtml" />
|
||||
<Content Include="Views\Account\ResetPassword.cshtml" />
|
||||
<Content Include="Views\Account\ResetPasswordConfirmation.cshtml" />
|
||||
<Content Include="Views\Account\SendCode.cshtml" />
|
||||
<Content Include="Views\Account\VerifyCode.cshtml" />
|
||||
<Content Include="Views\Manage\AddPhoneNumber.cshtml" />
|
||||
<Content Include="Views\Manage\ChangePassword.cshtml" />
|
||||
<Content Include="Views\Manage\Index.cshtml" />
|
||||
<Content Include="Views\Manage\ManageLogins.cshtml" />
|
||||
<Content Include="Views\Manage\SetPassword.cshtml" />
|
||||
<Content Include="Views\Manage\VerifyPhoneNumber.cshtml" />
|
||||
<Content Include="Views\Shared\Lockout.cshtml" />
|
||||
<Content Include="Views\Shared\_LoginPartial.cshtml" />
|
||||
<Content Include="Views\Patients\Create.cshtml" />
|
||||
<Content Include="Views\Patients\Delete.cshtml" />
|
||||
<Content Include="Views\Patients\Details.cshtml" />
|
||||
<Content Include="Views\Patients\Edit.cshtml" />
|
||||
<Content Include="Views\Patients\Index.cshtml" />
|
||||
<Content Include="Views\Visits\Create.cshtml" />
|
||||
<Content Include="Views\Visits\Delete.cshtml" />
|
||||
<Content Include="Views\Visits\Details.cshtml" />
|
||||
<Content Include="Views\Visits\Edit.cshtml" />
|
||||
<Content Include="Views\Visits\Index.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="fonts\glyphicons-halflings-regular.woff" />
|
||||
<Content Include="fonts\glyphicons-halflings-regular.ttf" />
|
||||
<Content Include="fonts\glyphicons-halflings-regular.eot" />
|
||||
<Content Include="packages.config" />
|
||||
<None Include="Project_Readme.html" />
|
||||
<Content Include="Scripts\jquery-1.10.2.min.map" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Migrations\201602170540262_Initial.resx">
|
||||
<DependentUpon>201602170540262_Initial.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201602170605457_Visits.resx">
|
||||
<DependentUpon>201602170605457_Visits.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201602170720063_Nullability.resx">
|
||||
<DependentUpon>201602170720063_Nullability.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201602170857179_Assignments.resx">
|
||||
<DependentUpon>201602170857179_Assignments.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
|
||||
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
|
||||
</Target>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>True</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>1192</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:1192/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target> -->
|
||||
</Project>
|
||||
@@ -0,0 +1,485 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNet.Identity.Owin;
|
||||
using Microsoft.Owin.Security;
|
||||
using ContosoClinic.Models;
|
||||
|
||||
namespace ContosoClinic.Controllers
|
||||
{
|
||||
[Authorize]
|
||||
public class AccountController : Controller
|
||||
{
|
||||
private ApplicationSignInManager _signInManager;
|
||||
private ApplicationUserManager _userManager;
|
||||
|
||||
public AccountController()
|
||||
{
|
||||
}
|
||||
|
||||
public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager )
|
||||
{
|
||||
UserManager = userManager;
|
||||
SignInManager = signInManager;
|
||||
}
|
||||
|
||||
public ApplicationSignInManager SignInManager
|
||||
{
|
||||
get
|
||||
{
|
||||
return _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>();
|
||||
}
|
||||
private set
|
||||
{
|
||||
_signInManager = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ApplicationUserManager UserManager
|
||||
{
|
||||
get
|
||||
{
|
||||
return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
|
||||
}
|
||||
private set
|
||||
{
|
||||
_userManager = value;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/Login
|
||||
[AllowAnonymous]
|
||||
public ActionResult Login(string returnUrl)
|
||||
{
|
||||
ViewBag.ReturnUrl = returnUrl;
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Account/Login
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return View(model);
|
||||
}
|
||||
|
||||
// This doesn't count login failures towards account lockout
|
||||
// To enable password failures to trigger account lockout, change to shouldLockout: true
|
||||
var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false);
|
||||
switch (result)
|
||||
{
|
||||
case SignInStatus.Success:
|
||||
return RedirectToLocal(returnUrl);
|
||||
case SignInStatus.LockedOut:
|
||||
return View("Lockout");
|
||||
case SignInStatus.RequiresVerification:
|
||||
return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
|
||||
case SignInStatus.Failure:
|
||||
default:
|
||||
ModelState.AddModelError("", "Invalid login attempt.");
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/VerifyCode
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult> VerifyCode(string provider, string returnUrl, bool rememberMe)
|
||||
{
|
||||
// Require that the user has already logged in via username/password or external login
|
||||
if (!await SignInManager.HasBeenVerifiedAsync())
|
||||
{
|
||||
return View("Error");
|
||||
}
|
||||
return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe });
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Account/VerifyCode
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> VerifyCode(VerifyCodeViewModel model)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return View(model);
|
||||
}
|
||||
|
||||
// The following code protects for brute force attacks against the two factor codes.
|
||||
// If a user enters incorrect codes for a specified amount of time then the user account
|
||||
// will be locked out for a specified amount of time.
|
||||
// You can configure the account lockout settings in IdentityConfig
|
||||
var result = await SignInManager.TwoFactorSignInAsync(model.Provider, model.Code, isPersistent: model.RememberMe, rememberBrowser: model.RememberBrowser);
|
||||
switch (result)
|
||||
{
|
||||
case SignInStatus.Success:
|
||||
return RedirectToLocal(model.ReturnUrl);
|
||||
case SignInStatus.LockedOut:
|
||||
return View("Lockout");
|
||||
case SignInStatus.Failure:
|
||||
default:
|
||||
ModelState.AddModelError("", "Invalid code.");
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/Register
|
||||
[AllowAnonymous]
|
||||
public ActionResult Register()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Account/Register
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> Register(RegisterViewModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
|
||||
var result = await UserManager.CreateAsync(user, model.Password);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false);
|
||||
|
||||
// For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
|
||||
// Send an email with this link
|
||||
// string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
|
||||
// var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
|
||||
// await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");
|
||||
|
||||
return RedirectToAction("Index", "Home");
|
||||
}
|
||||
AddErrors(result);
|
||||
}
|
||||
|
||||
// If we got this far, something failed, redisplay form
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/ConfirmEmail
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult> ConfirmEmail(string userId, string code)
|
||||
{
|
||||
if (userId == null || code == null)
|
||||
{
|
||||
return View("Error");
|
||||
}
|
||||
var result = await UserManager.ConfirmEmailAsync(userId, code);
|
||||
return View(result.Succeeded ? "ConfirmEmail" : "Error");
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/ForgotPassword
|
||||
[AllowAnonymous]
|
||||
public ActionResult ForgotPassword()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Account/ForgotPassword
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var user = await UserManager.FindByNameAsync(model.Email);
|
||||
if (user == null || !(await UserManager.IsEmailConfirmedAsync(user.Id)))
|
||||
{
|
||||
// Don't reveal that the user does not exist or is not confirmed
|
||||
return View("ForgotPasswordConfirmation");
|
||||
}
|
||||
|
||||
// For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
|
||||
// Send an email with this link
|
||||
// string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id);
|
||||
// var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
|
||||
// await UserManager.SendEmailAsync(user.Id, "Reset Password", "Please reset your password by clicking <a href=\"" + callbackUrl + "\">here</a>");
|
||||
// return RedirectToAction("ForgotPasswordConfirmation", "Account");
|
||||
}
|
||||
|
||||
// If we got this far, something failed, redisplay form
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/ForgotPasswordConfirmation
|
||||
[AllowAnonymous]
|
||||
public ActionResult ForgotPasswordConfirmation()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/ResetPassword
|
||||
[AllowAnonymous]
|
||||
public ActionResult ResetPassword(string code)
|
||||
{
|
||||
return code == null ? View("Error") : View();
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Account/ResetPassword
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> ResetPassword(ResetPasswordViewModel model)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return View(model);
|
||||
}
|
||||
var user = await UserManager.FindByNameAsync(model.Email);
|
||||
if (user == null)
|
||||
{
|
||||
// Don't reveal that the user does not exist
|
||||
return RedirectToAction("ResetPasswordConfirmation", "Account");
|
||||
}
|
||||
var result = await UserManager.ResetPasswordAsync(user.Id, model.Code, model.Password);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
return RedirectToAction("ResetPasswordConfirmation", "Account");
|
||||
}
|
||||
AddErrors(result);
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/ResetPasswordConfirmation
|
||||
[AllowAnonymous]
|
||||
public ActionResult ResetPasswordConfirmation()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Account/ExternalLogin
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult ExternalLogin(string provider, string returnUrl)
|
||||
{
|
||||
// Request a redirect to the external login provider
|
||||
return new ChallengeResult(provider, Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl }));
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/SendCode
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult> SendCode(string returnUrl, bool rememberMe)
|
||||
{
|
||||
var userId = await SignInManager.GetVerifiedUserIdAsync();
|
||||
if (userId == null)
|
||||
{
|
||||
return View("Error");
|
||||
}
|
||||
var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(userId);
|
||||
var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList();
|
||||
return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe });
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Account/SendCode
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> SendCode(SendCodeViewModel model)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
// Generate the token and send it
|
||||
if (!await SignInManager.SendTwoFactorCodeAsync(model.SelectedProvider))
|
||||
{
|
||||
return View("Error");
|
||||
}
|
||||
return RedirectToAction("VerifyCode", new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe });
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/ExternalLoginCallback
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
|
||||
{
|
||||
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
|
||||
if (loginInfo == null)
|
||||
{
|
||||
return RedirectToAction("Login");
|
||||
}
|
||||
|
||||
// Sign in the user with this external login provider if the user already has a login
|
||||
var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false);
|
||||
switch (result)
|
||||
{
|
||||
case SignInStatus.Success:
|
||||
return RedirectToLocal(returnUrl);
|
||||
case SignInStatus.LockedOut:
|
||||
return View("Lockout");
|
||||
case SignInStatus.RequiresVerification:
|
||||
return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = false });
|
||||
case SignInStatus.Failure:
|
||||
default:
|
||||
// If the user does not have an account, then prompt the user to create an account
|
||||
ViewBag.ReturnUrl = returnUrl;
|
||||
ViewBag.LoginProvider = loginInfo.Login.LoginProvider;
|
||||
return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = loginInfo.Email });
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Account/ExternalLoginConfirmation
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl)
|
||||
{
|
||||
if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
return RedirectToAction("Index", "Manage");
|
||||
}
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Get the information about the user from the external login provider
|
||||
var info = await AuthenticationManager.GetExternalLoginInfoAsync();
|
||||
if (info == null)
|
||||
{
|
||||
return View("ExternalLoginFailure");
|
||||
}
|
||||
var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
|
||||
var result = await UserManager.CreateAsync(user);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
result = await UserManager.AddLoginAsync(user.Id, info.Login);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
|
||||
return RedirectToLocal(returnUrl);
|
||||
}
|
||||
}
|
||||
AddErrors(result);
|
||||
}
|
||||
|
||||
ViewBag.ReturnUrl = returnUrl;
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Account/LogOff
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult LogOff()
|
||||
{
|
||||
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
|
||||
return RedirectToAction("Index", "Home");
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Account/ExternalLoginFailure
|
||||
[AllowAnonymous]
|
||||
public ActionResult ExternalLoginFailure()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (_userManager != null)
|
||||
{
|
||||
_userManager.Dispose();
|
||||
_userManager = null;
|
||||
}
|
||||
|
||||
if (_signInManager != null)
|
||||
{
|
||||
_signInManager.Dispose();
|
||||
_signInManager = null;
|
||||
}
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Helpers
|
||||
// Used for XSRF protection when adding external logins
|
||||
private const string XsrfKey = "XsrfId";
|
||||
|
||||
private IAuthenticationManager AuthenticationManager
|
||||
{
|
||||
get
|
||||
{
|
||||
return HttpContext.GetOwinContext().Authentication;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddErrors(IdentityResult result)
|
||||
{
|
||||
foreach (var error in result.Errors)
|
||||
{
|
||||
ModelState.AddModelError("", error);
|
||||
}
|
||||
}
|
||||
|
||||
private ActionResult RedirectToLocal(string returnUrl)
|
||||
{
|
||||
if (Url.IsLocalUrl(returnUrl))
|
||||
{
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
return RedirectToAction("Index", "Home");
|
||||
}
|
||||
|
||||
internal class ChallengeResult : HttpUnauthorizedResult
|
||||
{
|
||||
public ChallengeResult(string provider, string redirectUri)
|
||||
: this(provider, redirectUri, null)
|
||||
{
|
||||
}
|
||||
|
||||
public ChallengeResult(string provider, string redirectUri, string userId)
|
||||
{
|
||||
LoginProvider = provider;
|
||||
RedirectUri = redirectUri;
|
||||
UserId = userId;
|
||||
}
|
||||
|
||||
public string LoginProvider { get; set; }
|
||||
public string RedirectUri { get; set; }
|
||||
public string UserId { get; set; }
|
||||
|
||||
public override void ExecuteResult(ControllerContext context)
|
||||
{
|
||||
var properties = new AuthenticationProperties { RedirectUri = RedirectUri };
|
||||
if (UserId != null)
|
||||
{
|
||||
properties.Dictionary[XsrfKey] = UserId;
|
||||
}
|
||||
context.HttpContext.GetOwinContext().Authentication.Challenge(properties, LoginProvider);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace ContosoClinic.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult About()
|
||||
{
|
||||
ViewBag.Message = "Your application description page.";
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult Contact()
|
||||
{
|
||||
ViewBag.Message = "Your contact page.";
|
||||
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,387 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNet.Identity.Owin;
|
||||
using Microsoft.Owin.Security;
|
||||
using ContosoClinic.Models;
|
||||
|
||||
namespace ContosoClinic.Controllers
|
||||
{
|
||||
[Authorize]
|
||||
public class ManageController : Controller
|
||||
{
|
||||
private ApplicationSignInManager _signInManager;
|
||||
private ApplicationUserManager _userManager;
|
||||
|
||||
public ManageController()
|
||||
{
|
||||
}
|
||||
|
||||
public ManageController(ApplicationUserManager userManager, ApplicationSignInManager signInManager)
|
||||
{
|
||||
UserManager = userManager;
|
||||
SignInManager = signInManager;
|
||||
}
|
||||
|
||||
public ApplicationSignInManager SignInManager
|
||||
{
|
||||
get
|
||||
{
|
||||
return _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>();
|
||||
}
|
||||
private set
|
||||
{
|
||||
_signInManager = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ApplicationUserManager UserManager
|
||||
{
|
||||
get
|
||||
{
|
||||
return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
|
||||
}
|
||||
private set
|
||||
{
|
||||
_userManager = value;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Manage/Index
|
||||
public async Task<ActionResult> Index(ManageMessageId? message)
|
||||
{
|
||||
ViewBag.StatusMessage =
|
||||
message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed."
|
||||
: message == ManageMessageId.SetPasswordSuccess ? "Your password has been set."
|
||||
: message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set."
|
||||
: message == ManageMessageId.Error ? "An error has occurred."
|
||||
: message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added."
|
||||
: message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed."
|
||||
: "";
|
||||
|
||||
var userId = User.Identity.GetUserId();
|
||||
var model = new IndexViewModel
|
||||
{
|
||||
HasPassword = HasPassword(),
|
||||
PhoneNumber = await UserManager.GetPhoneNumberAsync(userId),
|
||||
TwoFactor = await UserManager.GetTwoFactorEnabledAsync(userId),
|
||||
Logins = await UserManager.GetLoginsAsync(userId),
|
||||
BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId)
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Manage/RemoveLogin
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> RemoveLogin(string loginProvider, string providerKey)
|
||||
{
|
||||
ManageMessageId? message;
|
||||
var result = await UserManager.RemoveLoginAsync(User.Identity.GetUserId(), new UserLoginInfo(loginProvider, providerKey));
|
||||
if (result.Succeeded)
|
||||
{
|
||||
var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
|
||||
if (user != null)
|
||||
{
|
||||
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
|
||||
}
|
||||
message = ManageMessageId.RemoveLoginSuccess;
|
||||
}
|
||||
else
|
||||
{
|
||||
message = ManageMessageId.Error;
|
||||
}
|
||||
return RedirectToAction("ManageLogins", new { Message = message });
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Manage/AddPhoneNumber
|
||||
public ActionResult AddPhoneNumber()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Manage/AddPhoneNumber
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> AddPhoneNumber(AddPhoneNumberViewModel model)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return View(model);
|
||||
}
|
||||
// Generate the token and send it
|
||||
var code = await UserManager.GenerateChangePhoneNumberTokenAsync(User.Identity.GetUserId(), model.Number);
|
||||
if (UserManager.SmsService != null)
|
||||
{
|
||||
var message = new IdentityMessage
|
||||
{
|
||||
Destination = model.Number,
|
||||
Body = "Your security code is: " + code
|
||||
};
|
||||
await UserManager.SmsService.SendAsync(message);
|
||||
}
|
||||
return RedirectToAction("VerifyPhoneNumber", new { PhoneNumber = model.Number });
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Manage/EnableTwoFactorAuthentication
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> EnableTwoFactorAuthentication()
|
||||
{
|
||||
await UserManager.SetTwoFactorEnabledAsync(User.Identity.GetUserId(), true);
|
||||
var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
|
||||
if (user != null)
|
||||
{
|
||||
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
|
||||
}
|
||||
return RedirectToAction("Index", "Manage");
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Manage/DisableTwoFactorAuthentication
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> DisableTwoFactorAuthentication()
|
||||
{
|
||||
await UserManager.SetTwoFactorEnabledAsync(User.Identity.GetUserId(), false);
|
||||
var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
|
||||
if (user != null)
|
||||
{
|
||||
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
|
||||
}
|
||||
return RedirectToAction("Index", "Manage");
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Manage/VerifyPhoneNumber
|
||||
public async Task<ActionResult> VerifyPhoneNumber(string phoneNumber)
|
||||
{
|
||||
var code = await UserManager.GenerateChangePhoneNumberTokenAsync(User.Identity.GetUserId(), phoneNumber);
|
||||
// Send an SMS through the SMS provider to verify the phone number
|
||||
return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber });
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Manage/VerifyPhoneNumber
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> VerifyPhoneNumber(VerifyPhoneNumberViewModel model)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return View(model);
|
||||
}
|
||||
var result = await UserManager.ChangePhoneNumberAsync(User.Identity.GetUserId(), model.PhoneNumber, model.Code);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
|
||||
if (user != null)
|
||||
{
|
||||
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
|
||||
}
|
||||
return RedirectToAction("Index", new { Message = ManageMessageId.AddPhoneSuccess });
|
||||
}
|
||||
// If we got this far, something failed, redisplay form
|
||||
ModelState.AddModelError("", "Failed to verify phone");
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Manage/RemovePhoneNumber
|
||||
public async Task<ActionResult> RemovePhoneNumber()
|
||||
{
|
||||
var result = await UserManager.SetPhoneNumberAsync(User.Identity.GetUserId(), null);
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
return RedirectToAction("Index", new { Message = ManageMessageId.Error });
|
||||
}
|
||||
var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
|
||||
if (user != null)
|
||||
{
|
||||
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
|
||||
}
|
||||
return RedirectToAction("Index", new { Message = ManageMessageId.RemovePhoneSuccess });
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Manage/ChangePassword
|
||||
public ActionResult ChangePassword()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Manage/ChangePassword
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> ChangePassword(ChangePasswordViewModel model)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return View(model);
|
||||
}
|
||||
var result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), model.OldPassword, model.NewPassword);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
|
||||
if (user != null)
|
||||
{
|
||||
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
|
||||
}
|
||||
return RedirectToAction("Index", new { Message = ManageMessageId.ChangePasswordSuccess });
|
||||
}
|
||||
AddErrors(result);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Manage/SetPassword
|
||||
public ActionResult SetPassword()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Manage/SetPassword
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<ActionResult> SetPassword(SetPasswordViewModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var result = await UserManager.AddPasswordAsync(User.Identity.GetUserId(), model.NewPassword);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
|
||||
if (user != null)
|
||||
{
|
||||
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
|
||||
}
|
||||
return RedirectToAction("Index", new { Message = ManageMessageId.SetPasswordSuccess });
|
||||
}
|
||||
AddErrors(result);
|
||||
}
|
||||
|
||||
// If we got this far, something failed, redisplay form
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Manage/ManageLogins
|
||||
public async Task<ActionResult> ManageLogins(ManageMessageId? message)
|
||||
{
|
||||
ViewBag.StatusMessage =
|
||||
message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed."
|
||||
: message == ManageMessageId.Error ? "An error has occurred."
|
||||
: "";
|
||||
var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
|
||||
if (user == null)
|
||||
{
|
||||
return View("Error");
|
||||
}
|
||||
var userLogins = await UserManager.GetLoginsAsync(User.Identity.GetUserId());
|
||||
var otherLogins = AuthenticationManager.GetExternalAuthenticationTypes().Where(auth => userLogins.All(ul => auth.AuthenticationType != ul.LoginProvider)).ToList();
|
||||
ViewBag.ShowRemoveButton = user.PasswordHash != null || userLogins.Count > 1;
|
||||
return View(new ManageLoginsViewModel
|
||||
{
|
||||
CurrentLogins = userLogins,
|
||||
OtherLogins = otherLogins
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Manage/LinkLogin
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult LinkLogin(string provider)
|
||||
{
|
||||
// Request a redirect to the external login provider to link a login for the current user
|
||||
return new AccountController.ChallengeResult(provider, Url.Action("LinkLoginCallback", "Manage"), User.Identity.GetUserId());
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Manage/LinkLoginCallback
|
||||
public async Task<ActionResult> LinkLoginCallback()
|
||||
{
|
||||
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(XsrfKey, User.Identity.GetUserId());
|
||||
if (loginInfo == null)
|
||||
{
|
||||
return RedirectToAction("ManageLogins", new { Message = ManageMessageId.Error });
|
||||
}
|
||||
var result = await UserManager.AddLoginAsync(User.Identity.GetUserId(), loginInfo.Login);
|
||||
return result.Succeeded ? RedirectToAction("ManageLogins") : RedirectToAction("ManageLogins", new { Message = ManageMessageId.Error });
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && _userManager != null)
|
||||
{
|
||||
_userManager.Dispose();
|
||||
_userManager = null;
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Helpers
|
||||
// Used for XSRF protection when adding external logins
|
||||
private const string XsrfKey = "XsrfId";
|
||||
|
||||
private IAuthenticationManager AuthenticationManager
|
||||
{
|
||||
get
|
||||
{
|
||||
return HttpContext.GetOwinContext().Authentication;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddErrors(IdentityResult result)
|
||||
{
|
||||
foreach (var error in result.Errors)
|
||||
{
|
||||
ModelState.AddModelError("", error);
|
||||
}
|
||||
}
|
||||
|
||||
private bool HasPassword()
|
||||
{
|
||||
var user = UserManager.FindById(User.Identity.GetUserId());
|
||||
if (user != null)
|
||||
{
|
||||
return user.PasswordHash != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool HasPhoneNumber()
|
||||
{
|
||||
var user = UserManager.FindById(User.Identity.GetUserId());
|
||||
if (user != null)
|
||||
{
|
||||
return user.PhoneNumber != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public enum ManageMessageId
|
||||
{
|
||||
AddPhoneSuccess,
|
||||
ChangePasswordSuccess,
|
||||
SetTwoFactorSuccess,
|
||||
SetPasswordSuccess,
|
||||
RemoveLoginSuccess,
|
||||
RemovePhoneSuccess,
|
||||
Error
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using ContosoClinic.Models;
|
||||
|
||||
namespace ContosoClinic.Controllers
|
||||
{
|
||||
public class PatientsController : Controller
|
||||
{
|
||||
private ApplicationDbContext db = new ApplicationDbContext();
|
||||
|
||||
// GET: Patients
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View(db.Patients.ToList());
|
||||
}
|
||||
|
||||
// GET: Patients/Details/5
|
||||
public ActionResult Details(int? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||
}
|
||||
Patient patient = db.Patients.Find(id);
|
||||
if (patient == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(patient);
|
||||
}
|
||||
|
||||
// GET: Patients/Create
|
||||
public ActionResult Create()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
// POST: Patients/Create
|
||||
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult Create([Bind(Include = "PatientID,SSN,FirstName,LastName,MiddleName,StreetAddress,City,ZipCode,State,BirthDate")] Patient patient)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
db.Patients.Add(patient);
|
||||
db.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
return View(patient);
|
||||
}
|
||||
|
||||
// GET: Patients/Edit/5
|
||||
public ActionResult Edit(int? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||
}
|
||||
Patient patient = db.Patients.Find(id);
|
||||
if (patient == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(patient);
|
||||
}
|
||||
|
||||
// POST: Patients/Edit/5
|
||||
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult Edit([Bind(Include = "PatientID,SSN,FirstName,LastName,MiddleName,StreetAddress,City,ZipCode,State,BirthDate")] Patient patient)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
db.Entry(patient).State = EntityState.Modified;
|
||||
db.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(patient);
|
||||
}
|
||||
|
||||
// GET: Patients/Delete/5
|
||||
public ActionResult Delete(int? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||
}
|
||||
Patient patient = db.Patients.Find(id);
|
||||
if (patient == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(patient);
|
||||
}
|
||||
|
||||
// POST: Patients/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult DeleteConfirmed(int id)
|
||||
{
|
||||
Patient patient = db.Patients.Find(id);
|
||||
db.Patients.Remove(patient);
|
||||
db.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
db.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using ContosoClinic.Models;
|
||||
|
||||
namespace ContosoClinic.Controllers
|
||||
{
|
||||
public class VisitsController : Controller
|
||||
{
|
||||
private ApplicationDbContext db = new ApplicationDbContext();
|
||||
|
||||
// GET: Visits
|
||||
public ActionResult Index()
|
||||
{
|
||||
var visits = db.Visits.Include(v => v.Patient);
|
||||
return View(visits.ToList());
|
||||
}
|
||||
|
||||
// GET: Visits/Details/5
|
||||
public ActionResult Details(int? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||
}
|
||||
Visit visit = db.Visits.Find(id);
|
||||
if (visit == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(visit);
|
||||
}
|
||||
|
||||
// GET: Visits/Create
|
||||
public ActionResult Create()
|
||||
{
|
||||
ViewBag.PatientID = new SelectList(db.Patients, "PatientID", "SSN");
|
||||
return View();
|
||||
}
|
||||
|
||||
// POST: Visits/Create
|
||||
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult Create([Bind(Include = "VisitID,PatientID,Date,Reason,Treatment,FollowUpDate")] Visit visit)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
db.Visits.Add(visit);
|
||||
db.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
ViewBag.PatientID = new SelectList(db.Patients, "PatientID", "SSN", visit.PatientID);
|
||||
return View(visit);
|
||||
}
|
||||
|
||||
// GET: Visits/Edit/5
|
||||
public ActionResult Edit(int? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||
}
|
||||
Visit visit = db.Visits.Find(id);
|
||||
if (visit == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
ViewBag.PatientID = new SelectList(db.Patients, "PatientID", "SSN", visit.PatientID);
|
||||
return View(visit);
|
||||
}
|
||||
|
||||
// POST: Visits/Edit/5
|
||||
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult Edit([Bind(Include = "VisitID,PatientID,Date,Reason,Treatment,FollowUpDate")] Visit visit)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
db.Entry(visit).State = EntityState.Modified;
|
||||
db.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
ViewBag.PatientID = new SelectList(db.Patients, "PatientID", "SSN", visit.PatientID);
|
||||
return View(visit);
|
||||
}
|
||||
|
||||
// GET: Visits/Delete/5
|
||||
public ActionResult Delete(int? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||
}
|
||||
Visit visit = db.Visits.Find(id);
|
||||
if (visit == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(visit);
|
||||
}
|
||||
|
||||
// POST: Visits/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult DeleteConfirmed(int id)
|
||||
{
|
||||
Visit visit = db.Visits.Find(id);
|
||||
db.Visits.Remove(visit);
|
||||
db.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
db.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<%@ Application Codebehind="Global.asax.cs" Inherits="ContosoClinic.MvcApplication" Language="C#" %>
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Optimization;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace ContosoClinic
|
||||
{
|
||||
public class MvcApplication : System.Web.HttpApplication
|
||||
{
|
||||
protected void Application_Start()
|
||||
{
|
||||
AreaRegistration.RegisterAllAreas();
|
||||
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||
BundleConfig.RegisterBundles(BundleTable.Bundles);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace ContosoClinic.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
|
||||
public sealed partial class Initial : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Initial));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201602170540262_Initial"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
namespace ContosoClinic.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Initial : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.Patients",
|
||||
c => new
|
||||
{
|
||||
PatientID = c.Int(nullable: false, identity: true),
|
||||
SSN = c.String(maxLength: 11, fixedLength: true, unicode: false),
|
||||
FirstName = c.String(maxLength: 50),
|
||||
LastName = c.String(maxLength: 50),
|
||||
MiddleName = c.String(maxLength: 50),
|
||||
StreetAddress = c.String(maxLength: 50),
|
||||
City = c.String(maxLength: 50),
|
||||
ZipCode = c.String(maxLength: 5, fixedLength: true, unicode: false),
|
||||
State = c.String(maxLength: 2, fixedLength: true, unicode: false),
|
||||
BirthDate = c.DateTime(nullable: false, storeType: "date"),
|
||||
})
|
||||
.PrimaryKey(t => t.PatientID);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AspNetRoles",
|
||||
c => new
|
||||
{
|
||||
Id = c.String(nullable: false, maxLength: 128),
|
||||
Name = c.String(nullable: false, maxLength: 256),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.Name, unique: true, name: "RoleNameIndex");
|
||||
|
||||
CreateTable(
|
||||
"dbo.AspNetUserRoles",
|
||||
c => new
|
||||
{
|
||||
UserId = c.String(nullable: false, maxLength: 128),
|
||||
RoleId = c.String(nullable: false, maxLength: 128),
|
||||
})
|
||||
.PrimaryKey(t => new { t.UserId, t.RoleId })
|
||||
.ForeignKey("dbo.AspNetRoles", t => t.RoleId, cascadeDelete: true)
|
||||
.ForeignKey("dbo.AspNetUsers", t => t.UserId, cascadeDelete: true)
|
||||
.Index(t => t.UserId)
|
||||
.Index(t => t.RoleId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AspNetUsers",
|
||||
c => new
|
||||
{
|
||||
Id = c.String(nullable: false, maxLength: 128),
|
||||
Email = c.String(maxLength: 256),
|
||||
EmailConfirmed = c.Boolean(nullable: false),
|
||||
PasswordHash = c.String(),
|
||||
SecurityStamp = c.String(),
|
||||
PhoneNumber = c.String(),
|
||||
PhoneNumberConfirmed = c.Boolean(nullable: false),
|
||||
TwoFactorEnabled = c.Boolean(nullable: false),
|
||||
LockoutEndDateUtc = c.DateTime(),
|
||||
LockoutEnabled = c.Boolean(nullable: false),
|
||||
AccessFailedCount = c.Int(nullable: false),
|
||||
UserName = c.String(nullable: false, maxLength: 256),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.UserName, unique: true, name: "UserNameIndex");
|
||||
|
||||
CreateTable(
|
||||
"dbo.AspNetUserClaims",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
UserId = c.String(nullable: false, maxLength: 128),
|
||||
ClaimType = c.String(),
|
||||
ClaimValue = c.String(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AspNetUsers", t => t.UserId, cascadeDelete: true)
|
||||
.Index(t => t.UserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AspNetUserLogins",
|
||||
c => new
|
||||
{
|
||||
LoginProvider = c.String(nullable: false, maxLength: 128),
|
||||
ProviderKey = c.String(nullable: false, maxLength: 128),
|
||||
UserId = c.String(nullable: false, maxLength: 128),
|
||||
})
|
||||
.PrimaryKey(t => new { t.LoginProvider, t.ProviderKey, t.UserId })
|
||||
.ForeignKey("dbo.AspNetUsers", t => t.UserId, cascadeDelete: true)
|
||||
.Index(t => t.UserId);
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropForeignKey("dbo.AspNetUserRoles", "UserId", "dbo.AspNetUsers");
|
||||
DropForeignKey("dbo.AspNetUserLogins", "UserId", "dbo.AspNetUsers");
|
||||
DropForeignKey("dbo.AspNetUserClaims", "UserId", "dbo.AspNetUsers");
|
||||
DropForeignKey("dbo.AspNetUserRoles", "RoleId", "dbo.AspNetRoles");
|
||||
DropIndex("dbo.AspNetUserLogins", new[] { "UserId" });
|
||||
DropIndex("dbo.AspNetUserClaims", new[] { "UserId" });
|
||||
DropIndex("dbo.AspNetUsers", "UserNameIndex");
|
||||
DropIndex("dbo.AspNetUserRoles", new[] { "RoleId" });
|
||||
DropIndex("dbo.AspNetUserRoles", new[] { "UserId" });
|
||||
DropIndex("dbo.AspNetRoles", "RoleNameIndex");
|
||||
DropTable("dbo.AspNetUserLogins");
|
||||
DropTable("dbo.AspNetUserClaims");
|
||||
DropTable("dbo.AspNetUsers");
|
||||
DropTable("dbo.AspNetUserRoles");
|
||||
DropTable("dbo.AspNetRoles");
|
||||
DropTable("dbo.Patients");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>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</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace ContosoClinic.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
|
||||
public sealed partial class Visits : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Visits));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201602170605457_Visits"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
namespace ContosoClinic.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Visits : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.Visits",
|
||||
c => new
|
||||
{
|
||||
VisitID = c.Int(nullable: false, identity: true),
|
||||
PatientID = c.Int(nullable: false),
|
||||
Date = c.DateTime(nullable: false, storeType: "date"),
|
||||
Reason = c.String(maxLength: 4000),
|
||||
Treatment = c.String(maxLength: 4000),
|
||||
FollowUpDate = c.DateTime(storeType: "date"),
|
||||
})
|
||||
.PrimaryKey(t => t.VisitID)
|
||||
.ForeignKey("dbo.Patients", t => t.PatientID, cascadeDelete: true)
|
||||
.Index(t => t.PatientID);
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropForeignKey("dbo.Visits", "PatientID", "dbo.Patients");
|
||||
DropIndex("dbo.Visits", new[] { "PatientID" });
|
||||
DropTable("dbo.Visits");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>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</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace ContosoClinic.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
|
||||
public sealed partial class Nullability : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Nullability));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201602170720063_Nullability"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace ContosoClinic.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Nullability : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
AlterColumn("dbo.Patients", "SSN", c => c.String(nullable: false, maxLength: 11, fixedLength: true, unicode: false));
|
||||
AlterColumn("dbo.Patients", "LastName", c => c.String(nullable: false, maxLength: 50));
|
||||
AlterColumn("dbo.Patients", "StreetAddress", c => c.String(nullable: false, maxLength: 50));
|
||||
AlterColumn("dbo.Patients", "City", c => c.String(nullable: false, maxLength: 50));
|
||||
AlterColumn("dbo.Patients", "ZipCode", c => c.String(nullable: false, maxLength: 5, fixedLength: true, unicode: false));
|
||||
AlterColumn("dbo.Patients", "State", c => c.String(nullable: false, maxLength: 2, fixedLength: true, unicode: false));
|
||||
AlterColumn("dbo.Visits", "Reason", c => c.String(nullable: false, maxLength: 4000));
|
||||
AlterColumn("dbo.Visits", "Treatment", c => c.String(nullable: false, maxLength: 4000));
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
AlterColumn("dbo.Visits", "Treatment", c => c.String(maxLength: 4000));
|
||||
AlterColumn("dbo.Visits", "Reason", c => c.String(maxLength: 4000));
|
||||
AlterColumn("dbo.Patients", "State", c => c.String(maxLength: 2, fixedLength: true, unicode: false));
|
||||
AlterColumn("dbo.Patients", "ZipCode", c => c.String(maxLength: 5, fixedLength: true, unicode: false));
|
||||
AlterColumn("dbo.Patients", "City", c => c.String(maxLength: 50));
|
||||
AlterColumn("dbo.Patients", "StreetAddress", c => c.String(maxLength: 50));
|
||||
AlterColumn("dbo.Patients", "LastName", c => c.String(maxLength: 50));
|
||||
AlterColumn("dbo.Patients", "SSN", c => c.String(maxLength: 11, fixedLength: true, unicode: false));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>H4sIAAAAAAAEAN1dWW/kuBF+D5D/IOgpCbzdPnYGE6N7F572eGPEF9z2IMiLQUt0WxgdvRLlsRHkl+3D/qT8hZASJfHW2er2Yl7aPL4qFqvIYonF+d9vv89+fg186wXGiReFc/tgsm9bMHQi1wtXcztFTz98sn/+6c9/mn1xg1fra9HuiLTDPcNkbj8jtD6eThPnGQYgmQSeE0dJ9IQmThRMgRtND/f3/z49OJhCDGFjLMua3aYh8gKY/YH/XEShA9coBf5l5EI/oeW4ZpmhWlcggMkaOHBu47YI4y98L/ScSd7etk58D2BeltB/si0QhhECCHN6fJ/AJYqjcLVc4wLg372tIW73BPwE0hEcV82bDmb/kAxmWnUsoJw0QVHQEvDgiEpnKnbvJGO7lB6W3xcsZ/RGRp3JcG7fYGAYItsSaR0v/Ji0U0t4QvvtWVztXqkSWHPIP1yf+iiN4TyEKYqBv2fdpI++5/wTvt1F32A4D1PfZ1nETOI6rgAX3cTRGsbo7RY+8Yyfn9rWlO8+FfuXveWu+QjPQ3R0aFtXmBXw6MNSHxhpLFEUw19gCGOAoIsREIzxdJ67MJOoxIRAcrm8Kohh/cPGZFuX4PUChiv0jM3swLbOvFfoFgWU/j0WKRb33EZxChX8mWmeeXGCyE8D5Q/7jSibCV2Aoei0HOGl57o+HGOIGBdCdOK6MUyS0ce5yDRsZKL/9tYL3NtEdxNkl9jgTEQPN0H0sxej51OGMPl95wUNkK7Ai7fK1ggB86uXeAjryi30s+rk2VvnO9Ikq3ool96zOApuI7/oU1Q83IF4BXH9XaSqXUZp7Aj8zKbVAm9c9jOo1ot+1mt7S35GvsuCX3Yca7lvvMOYYbpppAByC0FCXAetRf24v7+RBeQuhgAFmYaPTvss8v3o+/1aLcGmJlxaaHcbLqxUbcOFhXey4UIZCbDJlC9L7/AkWV9BNCk6TnLIsxjDfY/ibxMWcc9q3K9aAg6bLgFHB49PR58+fATu0ccf4dGHLsvBudt+JSB99G7Y4adN6GKNf3L44eMgVLVajM88sXofYuf7gTarFFmulbRZ0WQQlSZQw6t1gbr7qk04ldVb2ZQMqIslFCTGtoaC383SbaxxJ+s1nrxMtYhEWrtEQv/tOUfvZTX8EgDPH2A5bEAFT8WTFwewHOXnCCsfCFvzfAOSBK8G7j9A8mxgHf8c4qgJnTTGSooPQsF649RunqMQXqXBI9H98WgNNjV336Mz4GBv/UtIevXGu4icb1GKvoQucRfvkVPrPeoABmHnxHFgkpxhZYbuIkorX7rbgYIsUdt2RxY+8AK1PyIspg9F08onUbeQ/BJNM5VvYmL1Ilp5YTNWi6Z6VvMWtazSZm1ZJWDNOKUt9YxmDWr5zFsN5u1lMzS8u5fB7r6/12/z3nw8Y1vOYjZ9hOjG96aM0lfgp0OT6mQN2SIwvDVksLtvDRmbuPjFc4lX0uAQVDTG8I3aq89X9TYncDa2OXDDHJv4OGuAzlxOkiRyvMwK2KBuGYDjWcfum2WMxuVjKON4eBxYrz2yw2Hac/tvkjB0iGWMvkIsY4I85oEt6uV1eAp9iKB14uQfhxcgcYArzwSWicuXYFWGMTFaQE45CTZFL0Sy3nuh462Bb+Jc6NTuWyvhraQi1pzCNQzJymKait7kSyqCyOokNJsyKmXWNEWYTKccpphZpSF85HaDamJkTKG6cvytzi46KaJeSk3UQRkYa66Gekk0Ia4Ot42kiJrzkW7O6w5L1bxLUbBRdLLmlKbRS3pS2IhimiU2gnKaRdKEAW3oeBsKSk/FTRVAPCLvmoIKZ3ONglLnfRQF5SW2BQXlRfLuFDQPhjSdfyEysmvqyYdkxt/WjeLagm5y8tgx1cxPOeRjEe4BY1k9Tx9JJXxV3dLBfNJIQEIPVaKKEPAlRLwDndhWdbgSDyvSeYeHKG4zSQD0/FTTnQYdpd68J1wDIqqxCbBS9RpQ+tlbApJMugVzRdzayB31Y1rAFjFmIyzdfQRYRguFOa2usDBtlHdcRKOoO2SXQ6m0RzKsumM1g1EpsbhE8oNrMHDVvQd59HXHvqYHP2YMVGsNYjCc0xgchSX0Foru44ssmCbHkDYHEWZgdDIMAqo5NGiEVAxmcCkVNlkvJZUv3MYb7iUlwXPVSKkYzOBSojpaLySFP9bCI+slIt57GsjYinBmudGXdbNpnstCC2ZTTdLL7BKs1164YpJgaIm1pBkwPyzbJ4YEOcbU4aQtuiUlJRTFYAWFWnIlxoVZmsEpQOARkGDuwg2kZkq3RrPvFSQFz0Wex2IPLDqQ3/RbjiFhReEHUoAzPEJyWzUbLJQ3HrmnRfKRgA9i/e3fReSnQVgbxtRjZYkjLEpW0Lw/kwTCojDFzbGqPA8WqiptjsQmbrBYbHkLGfHJGZy0+KrmmHnKBQu1UHwnNSGU+RMsSFnYZnTZHWZ+VFlRcwwmv4HFYYplrNlUMAzpUCTZoHR05W26kcVTV7G3vefnkvbWrumnk2yZWsDKVZOoYMIZcs2QJ1o3xzqEImeAxSjKmqMwCQAsEFPcYh3jLvRzSxlXszN6rPNkWqoxd0Bur83m7jphkxgIK2JVTETfW17WdQv6lqZGdugGm6Yy7NB9qvQQOoEXYStW5LpQlh6l+LLF2bzma9fWpk53DG85XWJwp/1s1SJsxrbo7WkWgBa1xGAu4EpgTF2bDYy9I83vYWxNC8eHvwjNOUB8VQsu2evOHJNsRSc8jUTVLVpsotIFZ24vlWpbuPPyVWfOr5erO2AreBbrmqMqbkOzwIrq5tjV1WhxGd3h3UsbeeuxfeVx6X77lwZjM2viMNsfc9WUO/VVxS2x6GVSCYyW76Q+aWOUPfQp/yDRT580GPrVh7umyS8+xrulekzu7iW3wJvunurx2mntRnVDClKKTUrqZbBSCErOaICwyXM9QsQwb2JbhRjx5v6WIBhMSIPJ8lcfa1Z2ViwaXILQe4IJyu8b24f7B4fCez+78/bONElcXxFgVTzAw0/X6E/geETEtVkCbd/yqF69cZ5BLL150/dBm/AFxBIweQ2lAu7yfk0D2I7P0wzEsPI1mqG4Zh+bGQpTeEtGhuz3TIyE1z4zTnoBxs1+D5NkrIgpjvviyUasW72GSJdVzkMXvs7t/2S9jq3zfz2UHfes6xiv6MfWvvXfXo+jNJgsGYB/GEWp6vnzJH3fPRkOWvWsiTj2AVKQ5PDTGGlsSjFlSSU9HtyoQOsUkwya/MqK96zz5D70fk1xxR0WKNFPMUl2mLXBHPbb0ecimksVm3velbf1njPMPyLRipu8aw9uOj8t8X4NinuzQYkqGET3JxoeyWXCAZ5nKLj8SwBe/9rav1I9wdALUfHMwlB4g4hQ94xCFyztEwpkp0LCE2aN/HPlkwpdWNM+p5C5Lj0fU2i+DBU9t7jVKCJ0YyxJG3FEd2tvknLWexm6nJfeAq5H7nkHzXhnaduD7Y6KrOzBsLep2kOnYpcXzUfOlRbumHfJ/u6UDqO/cbjRDOs/ckr1rmRRV9kl202eHjNf2nC15Q+VJr0DiX2KNKHtJ0OPrWu679A7nlHaLuV5x5SNJo9tP7F5bGXTfaTecWVrlb68Y7q2rf1zy5rWeAvdejKynNwjTqsyy9iUZJx/7J/b7mOEpz4/eWjzOkV86qtL6LRcha3OO9Um2eZaJxHgq1V08nfU1MlhOmKVmmsJVk30RPVZaSJhyeQlulILM9l2Y6WuinGwtI2ZrCaX00Sb7lxG2rSNmbYmQ3Kz6dWCYXFJabUp1XIe9u4nUCvTL1XZ/DWbi+Y2mfJdgF1OmOZGUvMwQd1Bwnhj8z3lRw8iFG5h0Fw7fD/p0IOIZEjTaZH+LN8gxA4N898CYqcq8VYVBPlPAkPocK5M2eY8fIoKj0rgqGgi3tWCCLjYzzmJkfcEHISryaei7I3LLPxOPlg+Qvc8vE7ROkV4yDB49Lm4NfHMTPSzHG+e59n1mvyVDDEEzKZHPrFdh59Tz3dLvs8UoV0NBHH56IcZMpeIfKBZvZVIV1HYEIiKr/RU72Cw9jFYch0uwQvswhtWvwu4As5bFcjXgdRPBC/22akHVjEIEopR9cd/Yh12g9ef/g/lvQbeHXMAAA==</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace ContosoClinic.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
|
||||
public sealed partial class Assignments : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Assignments));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201602170857179_Assignments"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
namespace ContosoClinic.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Assignments : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.ApplicationUserPatients",
|
||||
c => new
|
||||
{
|
||||
ApplicationUser_Id = c.String(nullable: false, maxLength: 128),
|
||||
Patient_PatientID = c.Int(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => new { t.ApplicationUser_Id, t.Patient_PatientID })
|
||||
.ForeignKey("dbo.AspNetUsers", t => t.ApplicationUser_Id, cascadeDelete: true)
|
||||
.ForeignKey("dbo.Patients", t => t.Patient_PatientID, cascadeDelete: true)
|
||||
.Index(t => t.ApplicationUser_Id)
|
||||
.Index(t => t.Patient_PatientID);
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropForeignKey("dbo.ApplicationUserPatients", "Patient_PatientID", "dbo.Patients");
|
||||
DropForeignKey("dbo.ApplicationUserPatients", "ApplicationUser_Id", "dbo.AspNetUsers");
|
||||
DropIndex("dbo.ApplicationUserPatients", new[] { "Patient_PatientID" });
|
||||
DropIndex("dbo.ApplicationUserPatients", new[] { "ApplicationUser_Id" });
|
||||
DropTable("dbo.ApplicationUserPatients");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>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</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,351 @@
|
||||
namespace ContosoClinic.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Linq;
|
||||
using ContosoClinic.Models;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using System.Collections.Generic;
|
||||
|
||||
internal sealed class Configuration : DbMigrationsConfiguration<ContosoClinic.Models.ApplicationDbContext>
|
||||
{
|
||||
public Configuration()
|
||||
{
|
||||
AutomaticMigrationsEnabled = false;
|
||||
}
|
||||
|
||||
protected override void Seed(ContosoClinic.Models.ApplicationDbContext context)
|
||||
{/*
|
||||
// Create test userts
|
||||
var manager = new UserManager<ApplicationUser>(
|
||||
new UserStore<ApplicationUser>(
|
||||
new ApplicationDbContext()));
|
||||
|
||||
var password = "Password!1";
|
||||
var user1 = new ApplicationUser()
|
||||
{
|
||||
UserName = string.Format("rachel@contoso.com"),
|
||||
//Patients = (from p in context.Patients where p.LastName.StartsWith("A") select p).ToList()
|
||||
};
|
||||
|
||||
manager.Create(user1, string.Format(password));
|
||||
var user2 = new ApplicationUser()
|
||||
{
|
||||
UserName = string.Format("alice@contoso.com"),
|
||||
//Patients = (from p in context.Patients where p.LastName.StartsWith("B") select p).ToList()
|
||||
};
|
||||
manager.Create(user2, string.Format(password));
|
||||
context.SaveChanges();*/
|
||||
// Create patients
|
||||
context.Patients.AddOrUpdate(p => p.SSN,
|
||||
new Patient { SSN = "795-73-9838", FirstName = "Catherine", LastName = "Abel", MiddleName = "R.", StreetAddress = "57251 Serene Blvd", City = "Van Nuys", ZipCode = "91411", State = "CA", BirthDate = new System.DateTime(1996, 9, 10) },
|
||||
new Patient { SSN = "990-00-6818", FirstName = "Kim", LastName = "Abercrombie", MiddleName = "", StreetAddress = "Tanger Factory", City = "Branch", ZipCode = "55056", State = "MN", BirthDate = new System.DateTime(1967, 6, 5) },
|
||||
new Patient { SSN = "009-37-3952", FirstName = "Frances", LastName = "Adams", MiddleName = "B.", StreetAddress = "6900 Sisk Road", City = "Modesto", ZipCode = "95354", State = "CA", BirthDate = new System.DateTime(2005, 12, 26) },
|
||||
new Patient { SSN = "708-44-3627", FirstName = "Jay", LastName = "Adams", MiddleName = "", StreetAddress = "Blue Ridge Mall", City = "Kansas City", ZipCode = "64106", State = "MS", BirthDate = new System.DateTime(2011, 12, 28) },
|
||||
new Patient { SSN = "447-62-6279", FirstName = "Robert", LastName = "Ahlering", MiddleName = "E.", StreetAddress = "6500 East Grant Road", City = "Tucson", ZipCode = "85701", State = "AZ", BirthDate = new System.DateTime(1953, 12, 1) },
|
||||
new Patient { SSN = "872-78-4732", FirstName = "Stanley", LastName = "Alan", MiddleName = "A.", StreetAddress = "567 Sw Mcloughlin Blvd", City = "Milwaukie", ZipCode = "97222", State = "OR", BirthDate = new System.DateTime(1967, 9, 15) },
|
||||
new Patient { SSN = "898-79-8701", FirstName = "Paul", LastName = "Alcorn", MiddleName = "L.", StreetAddress = "White Mountain Mall", City = "Rock Springs", ZipCode = "82901", State = "WY", BirthDate = new System.DateTime(2010, 3, 23) },
|
||||
new Patient { SSN = "561-88-3757", FirstName = "Mary", LastName = "Alexander", MiddleName = "", StreetAddress = "2345 West Spencer Road", City = "Lynnwood", ZipCode = "98036", State = "WA", BirthDate = new System.DateTime(1985, 2, 20) },
|
||||
new Patient { SSN = "904-55-0991", FirstName = "Michelle", LastName = "Alexander", MiddleName = "", StreetAddress = "22589 West Craig Road", City = "North Las Vegas", ZipCode = "89030", State = "NV", BirthDate = new System.DateTime(2009, 3, 2) },
|
||||
new Patient { SSN = "293-95-6617", FirstName = "Marvin", LastName = "Allen", MiddleName = "N.", StreetAddress = "First Colony Mall", City = "Sugar Land", ZipCode = "77478", State = "TX", BirthDate = new System.DateTime(1962, 12, 26) },
|
||||
new Patient { SSN = "260-99-4784", FirstName = "Oscar", LastName = "Alpuerto", MiddleName = "L.", StreetAddress = "Rocky Mountain Pines Outlet", City = "Loveland", ZipCode = "80537", State = "CO", BirthDate = new System.DateTime(2000, 9, 19) },
|
||||
new Patient { SSN = "605-29-1370", FirstName = "Ramona", LastName = "Antrim", MiddleName = "J.", StreetAddress = "998 Forest Road", City = "Saginaw", ZipCode = "48601", State = "MI", BirthDate = new System.DateTime(1991, 11, 12) },
|
||||
new Patient { SSN = "731-35-9387", FirstName = "Thomas", LastName = "Armstrong", MiddleName = "B.", StreetAddress = "Fox Hills", City = "Culver City", ZipCode = "90232", State = "CA", BirthDate = new System.DateTime(1964, 11, 6) },
|
||||
new Patient { SSN = "854-76-1401", FirstName = "John", LastName = "Arthur", MiddleName = "", StreetAddress = "2345 North Freeway", City = "Houston", ZipCode = "77003", State = "TX", BirthDate = new System.DateTime(1987, 10, 12) },
|
||||
new Patient { SSN = "775-20-2697", FirstName = "Chris", LastName = "Ashton", MiddleName = "", StreetAddress = "70 N.W. Plaza", City = "Saint Ann", ZipCode = "63074", State = "MS", BirthDate = new System.DateTime(1991, 7, 22) },
|
||||
new Patient { SSN = "117-79-5230", FirstName = "Teresa", LastName = "Atkinson", MiddleName = "", StreetAddress = "The Citadel Commerce Plaza", City = "City Of Commerce", ZipCode = "90040", State = "CA", BirthDate = new System.DateTime(1969, 6, 16) },
|
||||
new Patient { SSN = "607-41-3750", FirstName = "Stephen", LastName = "Ayers", MiddleName = "M.", StreetAddress = "2533 Eureka Rd.", City = "Southgate", ZipCode = "48195", State = "MI", BirthDate = new System.DateTime(1977, 2, 5) },
|
||||
new Patient { SSN = "412-66-3694", FirstName = "James", LastName = "Bailey", MiddleName = "B.", StreetAddress = "Southgate Mall", City = "Missoula", ZipCode = "59801", State = "MT", BirthDate = new System.DateTime(1951, 9, 22) },
|
||||
new Patient { SSN = "775-63-2547", FirstName = "Douglas", LastName = "Baldwin", MiddleName = "A.", StreetAddress = "Horizon Outlet Center", City = "Holland", ZipCode = "49423", State = "MI", BirthDate = new System.DateTime(1956, 10, 21) },
|
||||
new Patient { SSN = "779-52-1722", FirstName = "Wayne", LastName = "Banack", MiddleName = "N.", StreetAddress = "48255 I-10 E. @ Eastpoint Blvd.", City = "Baytown", ZipCode = "77520", State = "TX", BirthDate = new System.DateTime(1997, 4, 4) },
|
||||
new Patient { SSN = "647-03-0271", FirstName = "Robert", LastName = "Barker", MiddleName = "L.", StreetAddress = "6789 Warren Road", City = "Westland", ZipCode = "48185", State = "MI", BirthDate = new System.DateTime(1991, 4, 26) },
|
||||
new Patient { SSN = "353-98-6954", FirstName = "John", LastName = "Beaver", MiddleName = "A.", StreetAddress = "1318 Lasalle Street", City = "Bothell", ZipCode = "98011", State = "WA", BirthDate = new System.DateTime(2010, 9, 3) },
|
||||
new Patient { SSN = "817-89-8819", FirstName = "John", LastName = "Beaver", MiddleName = "A.", StreetAddress = "99300 223rd Southeast", City = "Bothell", ZipCode = "98011", State = "WA", BirthDate = new System.DateTime(1999, 9, 10) },
|
||||
new Patient { SSN = "611-82-6762", FirstName = "Edna", LastName = "Benson", MiddleName = "J.", StreetAddress = "Po Box 8035996", City = "Dallas", ZipCode = "75201", State = "TX", BirthDate = new System.DateTime(1963, 3, 19) },
|
||||
new Patient { SSN = "665-55-5653", FirstName = "Payton", LastName = "Benson", MiddleName = "P.", StreetAddress = "997000 Telegraph Rd.", City = "Southfield", ZipCode = "48034", State = "MI", BirthDate = new System.DateTime(1952, 9, 16) },
|
||||
new Patient { SSN = "947-37-8651", FirstName = "Robert", LastName = "Bernacchi", MiddleName = "M.", StreetAddress = "25915 140th Ave Ne", City = "Bellevue", ZipCode = "98004", State = "WA", BirthDate = new System.DateTime(2000, 4, 9) },
|
||||
new Patient { SSN = "071-31-7824", FirstName = "Robert", LastName = "Bernacchi", MiddleName = "M.", StreetAddress = "2681 Eagle Peak", City = "Bellevue", ZipCode = "98004", State = "WA", BirthDate = new System.DateTime(1993, 3, 13) },
|
||||
new Patient { SSN = "610-55-3726", FirstName = "Matthias", LastName = "Berndt", MiddleName = "", StreetAddress = "Escondido", City = "Escondido", ZipCode = "92025", State = "CA", BirthDate = new System.DateTime(1974, 5, 15) },
|
||||
new Patient { SSN = "590-27-0856", FirstName = "Jimmy", LastName = "Bischoff", MiddleName = "", StreetAddress = "3065 Santa Margarita Parkway", City = "Trabuco Canyon", ZipCode = "92679", State = "CA", BirthDate = new System.DateTime(2015, 10, 26) },
|
||||
new Patient { SSN = "008-73-9012", FirstName = "Mae", LastName = "Black", MiddleName = "M.", StreetAddress = "Redford Plaza", City = "Redford", ZipCode = "48239", State = "MI", BirthDate = new System.DateTime(1997, 1, 3) },
|
||||
new Patient { SSN = "137-23-1723", FirstName = "Donald", LastName = "Blanton", MiddleName = "L.", StreetAddress = "Corporate Office", City = "El Segundo", ZipCode = "90245", State = "CA", BirthDate = new System.DateTime(2015, 5, 25) },
|
||||
new Patient { SSN = "969-53-6095", FirstName = "Michael", LastName = "Blythe", MiddleName = "Greg", StreetAddress = "9903 Highway 6 South", City = "Houston", ZipCode = "77003", State = "TX", BirthDate = new System.DateTime(1989, 3, 4) },
|
||||
new Patient { SSN = "222-42-8458", FirstName = "Gabriel", LastName = "Bockenkamp", MiddleName = "L.", StreetAddress = "67 Rainer Ave S", City = "Renton", ZipCode = "98055", State = "WA", BirthDate = new System.DateTime(1976, 6, 20) },
|
||||
new Patient { SSN = "163-08-2988", FirstName = "Luis", LastName = "Bonifaz", MiddleName = "", StreetAddress = "72502 Eastern Ave.", City = "Bell Gardens", ZipCode = "90201", State = "CA", BirthDate = new System.DateTime(2012, 5, 14) },
|
||||
new Patient { SSN = "898-11-0280", FirstName = "Cory", LastName = "Booth", MiddleName = "K.", StreetAddress = "Eastern Beltway Center", City = "Las Vegas", ZipCode = "89106", State = "NV", BirthDate = new System.DateTime(1974, 2, 5) },
|
||||
new Patient { SSN = "432-52-2738", FirstName = "Randall", LastName = "Boseman", MiddleName = "", StreetAddress = "2500 North Stemmons Freeway", City = "Dallas", ZipCode = "75201", State = "TX", BirthDate = new System.DateTime(1999, 5, 9) },
|
||||
new Patient { SSN = "018-29-9539", FirstName = "Cornelius", LastName = "Brandon", MiddleName = "L.", StreetAddress = "789 West Alameda", City = "Westminster", ZipCode = "80030", State = "CO", BirthDate = new System.DateTime(1976, 2, 6) },
|
||||
new Patient { SSN = "472-36-9060", FirstName = "Richard", LastName = "Bready", MiddleName = "", StreetAddress = "4251 First Avenue", City = "Seattle", ZipCode = "98104", State = "WA", BirthDate = new System.DateTime(1987, 11, 2) },
|
||||
new Patient { SSN = "566-87-9214", FirstName = "Ted", LastName = "Bremer", MiddleName = "", StreetAddress = "Bldg. 9n/99298", City = "Redmond", ZipCode = "98052", State = "WA", BirthDate = new System.DateTime(1996, 9, 12) },
|
||||
new Patient { SSN = "771-34-9714", FirstName = "Alan", LastName = "Brewer", MiddleName = "", StreetAddress = "4255 East Lies Road", City = "Carol Stream", ZipCode = "60188", State = "IL", BirthDate = new System.DateTime(1997, 7, 24) },
|
||||
new Patient { SSN = "413-73-7072", FirstName = "Walter", LastName = "Brian", MiddleName = "J.", StreetAddress = "25136 Jefferson Blvd.", City = "Culver City", ZipCode = "90232", State = "CA", BirthDate = new System.DateTime(1970, 7, 18) },
|
||||
new Patient { SSN = "497-65-6363", FirstName = "Christopher", LastName = "Bright", MiddleName = "M.", StreetAddress = "Washington Square", City = "Portland", ZipCode = "97205", State = "OR", BirthDate = new System.DateTime(1988, 12, 26) },
|
||||
new Patient { SSN = "450-26-2195", FirstName = "Willie", LastName = "Brooks", MiddleName = "P.", StreetAddress = "Holiday Village Mall", City = "Great Falls", ZipCode = "59401", State = "MT", BirthDate = new System.DateTime(2014, 4, 28) },
|
||||
new Patient { SSN = "052-78-7929", FirstName = "Jo", LastName = "Brown", MiddleName = "", StreetAddress = "250000 Eight Mile Road", City = "Detroit", ZipCode = "48226", State = "MI", BirthDate = new System.DateTime(1972, 8, 12) },
|
||||
new Patient { SSN = "087-92-6356", FirstName = "Robert", LastName = "Brown", MiddleName = "", StreetAddress = "250880 Baur Blvd", City = "Saint Louis", ZipCode = "63103", State = "MS", BirthDate = new System.DateTime(1980, 4, 8) },
|
||||
new Patient { SSN = "048-71-8953", FirstName = "Steven", LastName = "Brown", MiddleName = "B.", StreetAddress = "5500 Grossmont Center Drive", City = "La Mesa", ZipCode = "91941", State = "CA", BirthDate = new System.DateTime(1965, 12, 1) },
|
||||
new Patient { SSN = "488-68-6075", FirstName = "Mary", LastName = "Browning", MiddleName = "K.", StreetAddress = "Noah Lane", City = "Chicago", ZipCode = "60610", State = "IL", BirthDate = new System.DateTime(1998, 7, 11) },
|
||||
new Patient { SSN = "819-63-3780", FirstName = "Michael", LastName = "Brundage", MiddleName = "", StreetAddress = "22555 Paseo De Las Americas", City = "San Diego", ZipCode = "92102", State = "CA", BirthDate = new System.DateTime(1990, 6, 28) },
|
||||
new Patient { SSN = "599-61-7739", FirstName = "Shirley", LastName = "Bruner", MiddleName = "R.", StreetAddress = "4781 Highway 95", City = "Sandpoint", ZipCode = "83864", State = "ID", BirthDate = new System.DateTime(1975, 7, 2) },
|
||||
new Patient { SSN = "772-36-0661", FirstName = "June", LastName = "Brunner", MiddleName = "B.", StreetAddress = "678 Eastman Ave.", City = "Midland", ZipCode = "48640", State = "MI", BirthDate = new System.DateTime(1993, 7, 1) },
|
||||
new Patient { SSN = "990-78-3760", FirstName = "Megan", LastName = "Burke", MiddleName = "E.", StreetAddress = "Arcadia Crossing", City = "Phoenix", ZipCode = "85004", State = "AZ", BirthDate = new System.DateTime(2008, 6, 19) },
|
||||
new Patient { SSN = "103-38-5903", FirstName = "Karren", LastName = "Burkhardt", MiddleName = "K.", StreetAddress = "2502 Evergreen Ste E", City = "Everett", ZipCode = "98201", State = "WA", BirthDate = new System.DateTime(2001, 2, 27) },
|
||||
new Patient { SSN = "146-43-8832", FirstName = "Linda", LastName = "Burnett", MiddleName = "E.", StreetAddress = "2505 Gateway Drive", City = "North Sioux City", ZipCode = "57049", State = "SD", BirthDate = new System.DateTime(1965, 12, 11) },
|
||||
new Patient { SSN = "448-72-5948", FirstName = "Jared", LastName = "Bustamante", MiddleName = "L.", StreetAddress = "3307 Evergreen Blvd", City = "Washougal", ZipCode = "98671", State = "WA", BirthDate = new System.DateTime(1960, 9, 19) },
|
||||
new Patient { SSN = "254-13-4819", FirstName = "Barbara", LastName = "Calone", MiddleName = "J.", StreetAddress = "25306 Harvey Rd.", City = "College Station", ZipCode = "77840", State = "TX", BirthDate = new System.DateTime(1990, 8, 23) },
|
||||
new Patient { SSN = "666-45-9926", FirstName = "Lindsey", LastName = "Camacho", MiddleName = "R.", StreetAddress = "S Sound Ctr Suite 25300", City = "Lacey", ZipCode = "98503", State = "WA", BirthDate = new System.DateTime(1995, 1, 19) },
|
||||
new Patient { SSN = "260-46-2402", FirstName = "Frank", LastName = "Campbell", MiddleName = "", StreetAddress = "251340 E. South St.", City = "Cerritos", ZipCode = "90703", State = "CA", BirthDate = new System.DateTime(2006, 2, 18) },
|
||||
new Patient { SSN = "189-92-4702", FirstName = "Henry", LastName = "Campen", MiddleName = "L.", StreetAddress = "2507 Pacific Ave S", City = "Tacoma", ZipCode = "98403", State = "WA", BirthDate = new System.DateTime(1965, 8, 24) },
|
||||
new Patient { SSN = "718-12-8401", FirstName = "Chris", LastName = "Cannon", MiddleName = "", StreetAddress = "Lakewood Mall", City = "Lakewood", ZipCode = "90712", State = "CA", BirthDate = new System.DateTime(2006, 6, 9) },
|
||||
new Patient { SSN = "918-66-9747", FirstName = "Jane", LastName = "Carmichael", MiddleName = "N.", StreetAddress = "5967 W Las Positas Blvd", City = "Pleasanton", ZipCode = "94566", State = "CA", BirthDate = new System.DateTime(1977, 4, 26) },
|
||||
new Patient { SSN = "806-97-1958", FirstName = "Jovita", LastName = "Carmody", MiddleName = "A.", StreetAddress = "253950 N.E. 178th Place", City = "Woodinville", ZipCode = "98072", State = "WA", BirthDate = new System.DateTime(2012, 9, 22) },
|
||||
new Patient { SSN = "482-61-8230", FirstName = "Rob", LastName = "Caron", MiddleName = "", StreetAddress = "Ward Parkway Center", City = "Kansas City", ZipCode = "64106", State = "MS", BirthDate = new System.DateTime(1990, 5, 21) },
|
||||
new Patient { SSN = "897-39-6229", FirstName = "Andy", LastName = "Carothers", MiddleName = "", StreetAddress = "566 S. Main", City = "Cedar City", ZipCode = "84720", State = "UT", BirthDate = new System.DateTime(1969, 4, 7) },
|
||||
new Patient { SSN = "656-79-6279", FirstName = "Donna", LastName = "Carreras", MiddleName = "F.", StreetAddress = "12345 Sterling Avenue", City = "Irving", ZipCode = "75061", State = "TX", BirthDate = new System.DateTime(2008, 9, 16) },
|
||||
new Patient { SSN = "745-99-0161", FirstName = "Rosmarie", LastName = "Carroll", MiddleName = "J.", StreetAddress = "39933 Mission Oaks Blvd", City = "Camarillo", ZipCode = "93010", State = "CA", BirthDate = new System.DateTime(1994, 4, 6) },
|
||||
new Patient { SSN = "216-16-4120", FirstName = "Raul", LastName = "Casts", MiddleName = "E.", StreetAddress = "99040 California Avenue", City = "Sand City", ZipCode = "93955", State = "CA", BirthDate = new System.DateTime(1989, 7, 13) },
|
||||
new Patient { SSN = "102-56-5530", FirstName = "Matthew", LastName = "Cavallari", MiddleName = "J.", StreetAddress = "North 93270 Newport Highway", City = "Spokane", ZipCode = "99202", State = "WA", BirthDate = new System.DateTime(1952, 7, 26) },
|
||||
new Patient { SSN = "787-23-4125", FirstName = "Andrew", LastName = "Cencini", MiddleName = "", StreetAddress = "558 S 6th St", City = "Klamath Falls", ZipCode = "97601", State = "OR", BirthDate = new System.DateTime(1991, 1, 12) },
|
||||
new Patient { SSN = "424-55-1778", FirstName = "Stacey", LastName = "Cereghino", MiddleName = "M.", StreetAddress = "220 Mercy Drive", City = "Garland", ZipCode = "75040", State = "TX", BirthDate = new System.DateTime(1967, 6, 3) },
|
||||
new Patient { SSN = "572-19-0999", FirstName = "Forrest", LastName = "Chandler", MiddleName = "J.", StreetAddress = "The Quad @ WestView", City = "Whittier", ZipCode = "90605", State = "CA", BirthDate = new System.DateTime(2002, 11, 6) },
|
||||
new Patient { SSN = "745-81-6513", FirstName = "Lee", LastName = "Chapla", MiddleName = "J.", StreetAddress = "99433 S. Greenbay Rd.", City = "Racine", ZipCode = "53182", State = "WI", BirthDate = new System.DateTime(1991, 6, 12) },
|
||||
new Patient { SSN = "947-66-5585", FirstName = "Yao-Qiang", LastName = "Cheng", MiddleName = "", StreetAddress = "25 N State St", City = "Chicago", ZipCode = "60610", State = "IL", BirthDate = new System.DateTime(1954, 5, 1) },
|
||||
new Patient { SSN = "531-83-4784", FirstName = "Nicky", LastName = "Chesnut", MiddleName = "E.", StreetAddress = "9920 North Telegraph Rd.", City = "Pontiac", ZipCode = "48342", State = "MI", BirthDate = new System.DateTime(1966, 4, 22) },
|
||||
new Patient { SSN = "109-99-0299", FirstName = "Ruth", LastName = "Choin", MiddleName = "A.", StreetAddress = "7760 N. Pan Am Expwy", City = "San Antonio", ZipCode = "78204", State = "TX", BirthDate = new System.DateTime(1963, 7, 1) },
|
||||
new Patient { SSN = "483-85-6853", FirstName = "Anthony", LastName = "Chor", MiddleName = "", StreetAddress = "Riverside", City = "Sherman Oaks", ZipCode = "91403", State = "CA", BirthDate = new System.DateTime(2014, 7, 27) },
|
||||
new Patient { SSN = "567-39-1024", FirstName = "Pei", LastName = "Chow", MiddleName = "", StreetAddress = "4660 Rodeo Road", City = "Santa Fe", ZipCode = "87501", State = "NM", BirthDate = new System.DateTime(1979, 9, 11) },
|
||||
new Patient { SSN = "382-49-7387", FirstName = "Jill", LastName = "Christie", MiddleName = "J.", StreetAddress = "54254 Pacific Ave.", City = "Stockton", ZipCode = "95202", State = "CA", BirthDate = new System.DateTime(2001, 11, 20) },
|
||||
new Patient { SSN = "336-03-8102", FirstName = "Alice", LastName = "Clark", MiddleName = "", StreetAddress = "42500 W 76th St", City = "Chicago", ZipCode = "60610", State = "IL", BirthDate = new System.DateTime(1965, 12, 6) },
|
||||
new Patient { SSN = "994-22-9926", FirstName = "Connie", LastName = "Coffman", MiddleName = "L.", StreetAddress = "25269 Wood Dale Rd.", City = "Wood Dale", ZipCode = "60191", State = "IL", BirthDate = new System.DateTime(1993, 10, 2) },
|
||||
new Patient { SSN = "129-28-7723", FirstName = "John", LastName = "Colon", MiddleName = "L.", StreetAddress = "77 Beale Street", City = "San Francisco", ZipCode = "94109", State = "CA", BirthDate = new System.DateTime(1999, 6, 6) },
|
||||
new Patient { SSN = "347-44-2949", FirstName = "Scott", LastName = "Colvin", MiddleName = "A.", StreetAddress = "25550 Executive Dr", City = "Elgin", ZipCode = "60120", State = "IL", BirthDate = new System.DateTime(1976, 4, 23) },
|
||||
new Patient { SSN = "706-66-0382", FirstName = "Scott", LastName = "Cooper", MiddleName = "", StreetAddress = "Pavillion @ Redlands", City = "Redlands", ZipCode = "92373", State = "CA", BirthDate = new System.DateTime(1952, 12, 20) },
|
||||
new Patient { SSN = "500-63-2220", FirstName = "Eva", LastName = "Corets", MiddleName = "", StreetAddress = "2540 Dell Range Blvd", City = "Cheyenne", ZipCode = "82001", State = "WY", BirthDate = new System.DateTime(1991, 5, 16) },
|
||||
new Patient { SSN = "942-15-7859", FirstName = "Marlin", LastName = "Coriell", MiddleName = "M.", StreetAddress = "99800 Tittabawasee Rd.", City = "Saginaw", ZipCode = "48601", State = "MI", BirthDate = new System.DateTime(1983, 3, 16) },
|
||||
new Patient { SSN = "143-78-9971", FirstName = "Jack", LastName = "Creasey", MiddleName = "", StreetAddress = "Factory Merchants", City = "Barstow", ZipCode = "92311", State = "CA", BirthDate = new System.DateTime(2004, 5, 16) },
|
||||
new Patient { SSN = "372-18-7905", FirstName = "Grant", LastName = "Culbertson", MiddleName = "", StreetAddress = "399700 John R. Rd.", City = "Madison Heights", ZipCode = "48071", State = "MI", BirthDate = new System.DateTime(1984, 1, 28) },
|
||||
new Patient { SSN = "153-33-1155", FirstName = "Scott", LastName = "Culp", MiddleName = "", StreetAddress = "750 Lakeway Dr", City = "Bellingham", ZipCode = "98225", State = "WA", BirthDate = new System.DateTime(1987, 7, 8) },
|
||||
new Patient { SSN = "666-38-8849", FirstName = "Conor", LastName = "Cunningham", MiddleName = "", StreetAddress = "Sports Store At Park City", City = "Park City", ZipCode = "84098", State = "UT", BirthDate = new System.DateTime(1990, 8, 12) },
|
||||
new Patient { SSN = "790-69-5423", FirstName = "Megan", LastName = "Davis", MiddleName = "N.", StreetAddress = "48995 Evergreen Wy.", City = "Everett", ZipCode = "98201", State = "WA", BirthDate = new System.DateTime(1983, 10, 14) },
|
||||
new Patient { SSN = "105-16-8373", FirstName = "Alvaro", LastName = "De Matos Miranda Filho", MiddleName = "", StreetAddress = "Mountain Square", City = "Upland", ZipCode = "91786", State = "CA", BirthDate = new System.DateTime(1962, 4, 25) },
|
||||
new Patient { SSN = "989-18-3523", FirstName = "Aidan", LastName = "Delaney", MiddleName = "", StreetAddress = "Corporate Office", City = "Garland", ZipCode = "75040", State = "TX", BirthDate = new System.DateTime(1953, 3, 10) },
|
||||
new Patient { SSN = "771-07-7325", FirstName = "Stefan", LastName = "Delmarco", MiddleName = "", StreetAddress = "Incom Sports Center", City = "Ontario", ZipCode = "91764", State = "CA", BirthDate = new System.DateTime(1963, 3, 1) },
|
||||
new Patient { SSN = "545-83-9747", FirstName = "Prashanth", LastName = "Desai", MiddleName = "", StreetAddress = "Sapp Road West", City = "Round Rock", ZipCode = "78664", State = "TX", BirthDate = new System.DateTime(1974, 2, 12) },
|
||||
new Patient { SSN = "994-72-1605", FirstName = "Bev", LastName = "Desalvo", MiddleName = "L.", StreetAddress = "7009 Sw Hall Blvd.", City = "Tigard", ZipCode = "97223", State = "OR", BirthDate = new System.DateTime(1987, 6, 21) },
|
||||
new Patient { SSN = "558-23-5595", FirstName = "Brenda", LastName = "Diaz", MiddleName = "", StreetAddress = "2560 E. Newlands Dr", City = "Fernley", ZipCode = "89408", State = "NV", BirthDate = new System.DateTime(1983, 4, 2) },
|
||||
new Patient { SSN = "752-63-1338", FirstName = "Blaine", LastName = "Dockter", MiddleName = "", StreetAddress = "99000 S. Avalon Blvd. Suite 750", City = "Carson", ZipCode = "90746", State = "CA", BirthDate = new System.DateTime(1953, 11, 5) },
|
||||
new Patient { SSN = "825-10-8923", FirstName = "Cindy", LastName = "Dodd", MiddleName = "M.", StreetAddress = "994 Sw Cherry Park Rd", City = "Troutdale", ZipCode = "97060", State = "OR", BirthDate = new System.DateTime(2011, 9, 10) },
|
||||
new Patient { SSN = "368-69-8964", FirstName = "Patricia", LastName = "Doyle", MiddleName = "", StreetAddress = "225 South 314th Street", City = "Federal Way", ZipCode = "98003", State = "WA", BirthDate = new System.DateTime(1994, 3, 8) },
|
||||
new Patient { SSN = "597-44-1424", FirstName = "Gerald", LastName = "Drury", MiddleName = "M.", StreetAddress = "4635 S. Harrison Blvd.", City = "Ogden", ZipCode = "84401", State = "UT", BirthDate = new System.DateTime(1962, 5, 22) },
|
||||
new Patient { SSN = "957-28-1545", FirstName = "Bart", LastName = "Duncan", MiddleName = "", StreetAddress = "99295 S.e. Tualatin Valley_hwy.", City = "Hillsboro", ZipCode = "97123", State = "OR", BirthDate = new System.DateTime(1982, 10, 22) },
|
||||
new Patient { SSN = "187-17-8616", FirstName = "Maciej", LastName = "Dusza", MiddleName = "", StreetAddress = "2564 S. Redwood Rd.", City = "Riverton", ZipCode = "84065", State = "UT", BirthDate = new System.DateTime(1964, 3, 13) },
|
||||
new Patient { SSN = "194-76-9481", FirstName = "Carol", LastName = "Elliott", MiddleName = "B.", StreetAddress = "25220 Airline Road", City = "Corpus Christi", ZipCode = "78404", State = "TX", BirthDate = new System.DateTime(1963, 5, 28) },
|
||||
new Patient { SSN = "679-79-8165", FirstName = "Shannon", LastName = "Elliott", MiddleName = "P.", StreetAddress = "Factory Stores/tucson", City = "Tucson", ZipCode = "85701", State = "AZ", BirthDate = new System.DateTime(1989, 6, 27) },
|
||||
new Patient { SSN = "367-73-8845", FirstName = "John", LastName = "Emory", MiddleName = "", StreetAddress = "Medford", City = "Medford", ZipCode = "97504", State = "OR", BirthDate = new System.DateTime(1998, 10, 3) },
|
||||
new Patient { SSN = "814-03-3691", FirstName = "Gail", LastName = "Erickson", MiddleName = "", StreetAddress = "44025 W. Empire", City = "Denby", ZipCode = "57716", State = "SD", BirthDate = new System.DateTime(1963, 12, 13) },
|
||||
new Patient { SSN = "214-28-9968", FirstName = "Mark", LastName = "Erickson", MiddleName = "B", StreetAddress = "Factory Stores Of America", City = "Mesa", ZipCode = "85201", State = "AZ", BirthDate = new System.DateTime(1975, 3, 1) },
|
||||
new Patient { SSN = "913-55-6645", FirstName = "Ann", LastName = "Evans", MiddleName = "R.", StreetAddress = "Ring Plaza", City = "Norridge", ZipCode = "60706", State = "IL", BirthDate = new System.DateTime(1963, 3, 28) },
|
||||
new Patient { SSN = "763-33-5650", FirstName = "John", LastName = "Evans", MiddleName = "", StreetAddress = "7709 West Virginia Avenue", City = "Phoenix", ZipCode = "85004", State = "AZ", BirthDate = new System.DateTime(2009, 12, 1) },
|
||||
new Patient { SSN = "658-41-8532", FirstName = "Twanna", LastName = "Evans", MiddleName = "R.", StreetAddress = "Lewis County Mall", City = "Chehalis", ZipCode = "98532", State = "WA", BirthDate = new System.DateTime(1968, 11, 4) },
|
||||
new Patient { SSN = "943-41-6011", FirstName = "Carolyn", LastName = "Farino", MiddleName = "", StreetAddress = "3250 South Meridian", City = "Puyallup", ZipCode = "98371", State = "WA", BirthDate = new System.DateTime(1950, 2, 12) },
|
||||
new Patient { SSN = "691-30-8623", FirstName = "Geri", LastName = "Farrell", MiddleName = "P.", StreetAddress = "49925 Crestview Drive N.E.", City = "Rio Rancho", ZipCode = "87124", State = "NM", BirthDate = new System.DateTime(1962, 8, 11) },
|
||||
new Patient { SSN = "361-08-3217", FirstName = "François", LastName = "Ferrier", MiddleName = "", StreetAddress = "Eastridge Mall", City = "Casper", ZipCode = "82601", State = "WY", BirthDate = new System.DateTime(1957, 6, 14) },
|
||||
new Patient { SSN = "827-51-1487", FirstName = "Kathie", LastName = "Flood", MiddleName = "", StreetAddress = "705 SE Mall Parkway", City = "Everett", ZipCode = "98201", State = "WA", BirthDate = new System.DateTime(1978, 2, 8) },
|
||||
new Patient { SSN = "483-93-0057", FirstName = "John", LastName = "Ford", MiddleName = "", StreetAddress = "23025 S.W. Military Rd.", City = "San Antonio", ZipCode = "78204", State = "TX", BirthDate = new System.DateTime(1987, 9, 16) },
|
||||
new Patient { SSN = "738-37-1607", FirstName = "Garth", LastName = "Fort", MiddleName = "", StreetAddress = "3250 Baldwin Park Blvd", City = "Baldwin Park", ZipCode = "91706", State = "CA", BirthDate = new System.DateTime(1964, 11, 25) },
|
||||
new Patient { SSN = "822-59-9384", FirstName = "Dorothy", LastName = "Fox", MiddleName = "J.", StreetAddress = "Lakeline Mall", City = "Cedar Park", ZipCode = "78613", State = "TX", BirthDate = new System.DateTime(1966, 9, 9) },
|
||||
new Patient { SSN = "309-79-2521", FirstName = "Mihail", LastName = "Frintu", MiddleName = "", StreetAddress = "Bayshore Mall", City = "Eureka", ZipCode = "95501", State = "CA", BirthDate = new System.DateTime(2013, 6, 17) },
|
||||
new Patient { SSN = "814-32-0421", FirstName = "Paul", LastName = "Fulton", MiddleName = "J.", StreetAddress = "Horizon Outlet Center", City = "Monroe", ZipCode = "98272", State = "MI", BirthDate = new System.DateTime(1984, 6, 11) },
|
||||
new Patient { SSN = "076-35-8143", FirstName = "Michael", LastName = "Galos", MiddleName = "", StreetAddress = "West Park Plaza", City = "Irvine", ZipCode = "92614", State = "CA", BirthDate = new System.DateTime(2009, 12, 14) },
|
||||
new Patient { SSN = "620-03-4764", FirstName = "Jon", LastName = "Ganio", MiddleName = "", StreetAddress = "3900 S. 997th St.", City = "Milwaukee", ZipCode = "53202", State = "WI", BirthDate = new System.DateTime(1975, 3, 12) },
|
||||
new Patient { SSN = "769-76-3600", FirstName = "Dominic", LastName = "Gash", MiddleName = "P.", StreetAddress = "5420 West 22500 South", City = "Salt Lake City", ZipCode = "84101", State = "UT", BirthDate = new System.DateTime(1969, 3, 27) },
|
||||
new Patient { SSN = "160-92-3129", FirstName = "Janet", LastName = "Gates", MiddleName = "M.", StreetAddress = "165 North Main", City = "Austin", ZipCode = "78701", State = "TX", BirthDate = new System.DateTime(1980, 9, 2) },
|
||||
new Patient { SSN = "318-00-6667", FirstName = "Janet", LastName = "Gates", MiddleName = "M.", StreetAddress = "800 Interchange Blvd.", City = "Austin", ZipCode = "78701", State = "TX", BirthDate = new System.DateTime(1970, 2, 22) },
|
||||
new Patient { SSN = "982-77-3975", FirstName = "Orlando", LastName = "Gee", MiddleName = "N.", StreetAddress = "2251 Elliot Avenue", City = "Seattle", ZipCode = "98104", State = "WA", BirthDate = new System.DateTime(2008, 11, 11) },
|
||||
new Patient { SSN = "328-68-1544", FirstName = "Darren", LastName = "Gehring", MiddleName = "", StreetAddress = "509 Nafta Boulevard", City = "Laredo", ZipCode = "78040", State = "TX", BirthDate = new System.DateTime(1966, 12, 26) },
|
||||
new Patient { SSN = "053-51-9173", FirstName = "Jim", LastName = "Geist", MiddleName = "", StreetAddress = "35525-9th Street Sw", City = "Puyallup", ZipCode = "98371", State = "WA", BirthDate = new System.DateTime(2009, 1, 21) },
|
||||
new Patient { SSN = "840-05-6646", FirstName = "Guy", LastName = "Gilbert", MiddleName = "", StreetAddress = "Vista Marketplace", City = "Alhambra", ZipCode = "91801", State = "CA", BirthDate = new System.DateTime(1982, 11, 20) },
|
||||
new Patient { SSN = "446-11-2924", FirstName = "Janet", LastName = "Gilliat", MiddleName = "J.", StreetAddress = "9995 West Central Entrance", City = "Duluth", ZipCode = "55802", State = "MN", BirthDate = new System.DateTime(1984, 4, 14) },
|
||||
new Patient { SSN = "273-16-2522", FirstName = "Mary", LastName = "Gimmi", MiddleName = "M.", StreetAddress = "5525 South Hover Road", City = "Longmont", ZipCode = "80501", State = "CO", BirthDate = new System.DateTime(1966, 4, 15) },
|
||||
new Patient { SSN = "003-23-9305", FirstName = "Jeanie", LastName = "Glenn", MiddleName = "R.", StreetAddress = "9909 W. Ventura Boulevard", City = "Camarillo", ZipCode = "93010", State = "CA", BirthDate = new System.DateTime(1963, 4, 13) },
|
||||
new Patient { SSN = "878-44-1968", FirstName = "Scott", LastName = "Gode", MiddleName = "", StreetAddress = "2583 Se 272nd St", City = "Kent", ZipCode = "98031", State = "WA", BirthDate = new System.DateTime(1950, 11, 20) },
|
||||
new Patient { SSN = "910-05-4138", FirstName = "Mete", LastName = "Goktepe", MiddleName = "", StreetAddress = "Hanford Mall", City = "Hanford", ZipCode = "93230", State = "CA", BirthDate = new System.DateTime(1951, 11, 5) },
|
||||
new Patient { SSN = "912-33-3174", FirstName = "Abigail", LastName = "Gonzalez", MiddleName = "J.", StreetAddress = "99450 Highway 59 North", City = "Humble", ZipCode = "77338", State = "TX", BirthDate = new System.DateTime(2007, 3, 10) },
|
||||
new Patient { SSN = "058-26-3234", FirstName = "Michael", LastName = "Graff", MiddleName = "", StreetAddress = "9700 Sisk Road", City = "Modesto", ZipCode = "95354", State = "CA", BirthDate = new System.DateTime(2002, 10, 24) },
|
||||
new Patient { SSN = "687-28-3396", FirstName = "Douglas", LastName = "Groncki", MiddleName = "", StreetAddress = "70259 West Sunnyview Ave", City = "Visalia", ZipCode = "93291", State = "CA", BirthDate = new System.DateTime(1974, 5, 7) },
|
||||
new Patient { SSN = "496-75-4904", FirstName = "Brian", LastName = "Groth", MiddleName = "", StreetAddress = "Gateway", City = "Portland", ZipCode = "97205", State = "OR", BirthDate = new System.DateTime(2008, 6, 5) },
|
||||
new Patient { SSN = "071-00-8057", FirstName = "Erin", LastName = "Hagens", MiddleName = "M.", StreetAddress = "25001 Montague Expressway", City = "Milpitas", ZipCode = "95035", State = "CA", BirthDate = new System.DateTime(1969, 4, 12) },
|
||||
new Patient { SSN = "288-05-9705", FirstName = "Betty", LastName = "Haines", MiddleName = "M.", StreetAddress = "640 South 994th St. W.", City = "Billings", ZipCode = "59101", State = "MT", BirthDate = new System.DateTime(1998, 10, 4) },
|
||||
new Patient { SSN = "002-47-6040", FirstName = "Jean", LastName = "Handley", MiddleName = "P.", StreetAddress = "259826 Russell Rd. South", City = "Kent", ZipCode = "98031", State = "WA", BirthDate = new System.DateTime(1993, 8, 4) },
|
||||
new Patient { SSN = "936-84-1664", FirstName = "Kerim", LastName = "Hanif", MiddleName = "", StreetAddress = "60025 Bollinger Canyon Road", City = "San Ramon", ZipCode = "94583", State = "CA", BirthDate = new System.DateTime(1959, 12, 20) },
|
||||
new Patient { SSN = "216-03-0835", FirstName = "John", LastName = "Hanson", MiddleName = "", StreetAddress = "825 W 500 S", City = "Bountiful", ZipCode = "84010", State = "UT", BirthDate = new System.DateTime(1989, 9, 23) },
|
||||
new Patient { SSN = "525-81-0810", FirstName = "Lucy", LastName = "Harrington", MiddleName = "", StreetAddress = "482505 Warm Springs Blvd.", City = "Fremont", ZipCode = "94536", State = "CA", BirthDate = new System.DateTime(2004, 3, 25) },
|
||||
new Patient { SSN = "331-25-9319", FirstName = "Keith", LastName = "Harris", MiddleName = "", StreetAddress = "3207 S Grady Way", City = "Renton", ZipCode = "98055", State = "WA", BirthDate = new System.DateTime(2003, 12, 25) },
|
||||
new Patient { SSN = "770-01-5105", FirstName = "Keith", LastName = "Harris", MiddleName = "", StreetAddress = "7943 Walnut Ave", City = "Renton", ZipCode = "98055", State = "WA", BirthDate = new System.DateTime(1968, 7, 3) },
|
||||
new Patient { SSN = "208-84-9956", FirstName = "Roger", LastName = "Harui", MiddleName = "", StreetAddress = "9927 N. Main St.", City = "Tooele", ZipCode = "84074", State = "UT", BirthDate = new System.DateTime(2015, 5, 11) },
|
||||
new Patient { SSN = "633-34-5095", FirstName = "Ann", LastName = "Hass", MiddleName = "T.", StreetAddress = "Medford Outlet Center", City = "Medford", ZipCode = "55049", State = "MN", BirthDate = new System.DateTime(2005, 7, 28) },
|
||||
new Patient { SSN = "022-89-0200", FirstName = "Valerie", LastName = "Hendricks", MiddleName = "M.", StreetAddress = "Kansas City Factory Outlet", City = "Odessa", ZipCode = "64076", State = "MS", BirthDate = new System.DateTime(1976, 10, 23) },
|
||||
new Patient { SSN = "912-85-8027", FirstName = "Cheryl", LastName = "Herring", MiddleName = "M.", StreetAddress = "Corp Ofc Accts Payable", City = "El Segundo", ZipCode = "90245", State = "CA", BirthDate = new System.DateTime(1980, 10, 9) },
|
||||
new Patient { SSN = "307-29-4403", FirstName = "Ronald", LastName = "Heymsfield", MiddleName = "K.", StreetAddress = "250775 SW Hillsdale Hwy", City = "Beaverton", ZipCode = "97005", State = "OR", BirthDate = new System.DateTime(1983, 7, 22) },
|
||||
new Patient { SSN = "083-68-5072", FirstName = "Mike", LastName = "Hines", MiddleName = "", StreetAddress = "25250 N 90th St", City = "Scottsdale", ZipCode = "85257", State = "AZ", BirthDate = new System.DateTime(1969, 12, 3) },
|
||||
new Patient { SSN = "239-20-6174", FirstName = "Matthew", LastName = "Hink", MiddleName = "", StreetAddress = "No. 60 Bellis Fair Parkway", City = "Bellingham", ZipCode = "98225", State = "WA", BirthDate = new System.DateTime(1997, 2, 15) },
|
||||
new Patient { SSN = "162-43-8489", FirstName = "Bob", LastName = "Hodges", MiddleName = "", StreetAddress = "Ohms Road", City = "Houston", ZipCode = "77003", State = "TX", BirthDate = new System.DateTime(2010, 8, 13) },
|
||||
new Patient { SSN = "717-37-3032", FirstName = "David", LastName = "Hodgson", MiddleName = "", StreetAddress = "99700 Bell Road", City = "Auburn", ZipCode = "95603", State = "CA", BirthDate = new System.DateTime(1983, 4, 13) },
|
||||
new Patient { SSN = "280-15-5623", FirstName = "Helge", LastName = "Hoeing", MiddleName = "", StreetAddress = "Cedar Creek Stores", City = "Mosinee", ZipCode = "54455", State = "WI", BirthDate = new System.DateTime(1988, 2, 7) },
|
||||
new Patient { SSN = "353-00-9496", FirstName = "Juanita", LastName = "Holman", MiddleName = "J.", StreetAddress = "Lake Elisnor Place", City = "Lake Elsinore", ZipCode = "92530", State = "CA", BirthDate = new System.DateTime(1989, 5, 13) },
|
||||
new Patient { SSN = "162-65-6542", FirstName = "Peter", LastName = "Houston", MiddleName = "", StreetAddress = "1200 First Ave.", City = "Joliet", ZipCode = "60433", State = "IL", BirthDate = new System.DateTime(1972, 6, 10) },
|
||||
new Patient { SSN = "427-43-7296", FirstName = "George", LastName = "Huckaby", MiddleName = "M.", StreetAddress = "3390 South 23rd St.", City = "Tacoma", ZipCode = "98403", State = "WA", BirthDate = new System.DateTime(2003, 5, 13) },
|
||||
new Patient { SSN = "603-61-0319", FirstName = "Joshua", LastName = "Huff", MiddleName = "J.", StreetAddress = "Management Mall", City = "San Antonio", ZipCode = "78204", State = "TX", BirthDate = new System.DateTime(1991, 11, 7) },
|
||||
new Patient { SSN = "877-01-3415", FirstName = "Phyllis", LastName = "Huntsman", MiddleName = "R.", StreetAddress = "99 Front Street", City = "Minneapolis", ZipCode = "55402", State = "MN", BirthDate = new System.DateTime(1981, 8, 27) },
|
||||
new Patient { SSN = "391-25-8382", FirstName = "Phyllis", LastName = "Huntsman", MiddleName = "R.", StreetAddress = "City Center", City = "Minneapolis", ZipCode = "55402", State = "MN", BirthDate = new System.DateTime(1959, 6, 28) },
|
||||
new Patient { SSN = "626-56-2930", FirstName = "Lawrence", LastName = "Hurkett", MiddleName = "E.", StreetAddress = "6753 Howard Hughes Parkway", City = "Las Vegas", ZipCode = "89106", State = "NV", BirthDate = new System.DateTime(1993, 10, 13) },
|
||||
new Patient { SSN = "731-19-3470", FirstName = "Lucio", LastName = "Iallo", MiddleName = "", StreetAddress = "Simi @ The Plaza", City = "Simi Valley", ZipCode = "93065", State = "CA", BirthDate = new System.DateTime(1959, 10, 14) },
|
||||
new Patient { SSN = "171-33-3481", FirstName = "Richard", LastName = "Irwin", MiddleName = "L.", StreetAddress = "99828 Routh Street, Suite 825", City = "Dallas", ZipCode = "75201", State = "TX", BirthDate = new System.DateTime(1963, 8, 5) },
|
||||
new Patient { SSN = "828-77-1376", FirstName = "Erik", LastName = "Ismert", MiddleName = "", StreetAddress = "4927 S Meridian Ave Ste D", City = "Puyallup", ZipCode = "98371", State = "WA", BirthDate = new System.DateTime(1968, 4, 5) },
|
||||
new Patient { SSN = "611-48-4137", FirstName = "Eric", LastName = "Jacobsen", MiddleName = "A.", StreetAddress = "Topanga Plaza", City = "Canoga Park", ZipCode = "91303", State = "CA", BirthDate = new System.DateTime(1957, 7, 11) },
|
||||
new Patient { SSN = "477-14-7161", FirstName = "Jodan", LastName = "Jacobson", MiddleName = "M.", StreetAddress = "6030 Robinson Road", City = "Jefferson City", ZipCode = "65101", State = "MS", BirthDate = new System.DateTime(1996, 2, 5) },
|
||||
new Patient { SSN = "738-83-2602", FirstName = "Sean", LastName = "Jacobson", MiddleName = "P.", StreetAddress = "2551 East Warner Road", City = "Gilbert", ZipCode = "85233", State = "AZ", BirthDate = new System.DateTime(1950, 11, 26) },
|
||||
new Patient { SSN = "589-30-3617", FirstName = "Joyce", LastName = "Jarvis", MiddleName = "", StreetAddress = "955 E. County Line Rd.", City = "Englewood", ZipCode = "80110", State = "CO", BirthDate = new System.DateTime(2011, 5, 20) },
|
||||
new Patient { SSN = "538-28-5108", FirstName = "Barry", LastName = "Johnson", MiddleName = "", StreetAddress = "2000 300th Street", City = "Denver", ZipCode = "80203", State = "CO", BirthDate = new System.DateTime(1991, 2, 15) },
|
||||
new Patient { SSN = "661-09-8547", FirstName = "Barry", LastName = "Johnson", MiddleName = "", StreetAddress = "2530 South Colorado Blvd.", City = "Denver", ZipCode = "80203", State = "CO", BirthDate = new System.DateTime(2004, 2, 5) },
|
||||
new Patient { SSN = "025-55-7602", FirstName = "Brian", LastName = "Johnson", MiddleName = "", StreetAddress = "625 W Jackson Blvd. Unit 2502", City = "Chicago", ZipCode = "60610", State = "IL", BirthDate = new System.DateTime(1989, 6, 10) },
|
||||
new Patient { SSN = "422-34-6020", FirstName = "David", LastName = "Johnson", MiddleName = "", StreetAddress = "7990 Ocean Beach Hwy.", City = "Longview", ZipCode = "98632", State = "WA", BirthDate = new System.DateTime(1965, 2, 27) },
|
||||
new Patient { SSN = "500-92-8728", FirstName = "Tom", LastName = "Johnston", MiddleName = "H", StreetAddress = "Belz Factory Outlet", City = "Las Vegas", ZipCode = "89106", State = "NV", BirthDate = new System.DateTime(1961, 10, 19) },
|
||||
new Patient { SSN = "170-89-3691", FirstName = "Jean", LastName = "Jordan", MiddleName = "", StreetAddress = "440 West Huntington Dr.", City = "Monrovia", ZipCode = "91016", State = "CA", BirthDate = new System.DateTime(1969, 10, 16) },
|
||||
new Patient { SSN = "108-25-0733", FirstName = "Peggy", LastName = "Justice", MiddleName = "J.", StreetAddress = "15 East Main", City = "Port Orchard", ZipCode = "98366", State = "WA", BirthDate = new System.DateTime(1981, 11, 1) },
|
||||
new Patient { SSN = "392-44-2253", FirstName = "Sandeep", LastName = "Kaliyath", MiddleName = "", StreetAddress = "630 N. Capitol Ave.", City = "San Jose", ZipCode = "95112", State = "CA", BirthDate = new System.DateTime(1998, 11, 3) },
|
||||
new Patient { SSN = "666-10-8497", FirstName = "Sandeep", LastName = "Katyal", MiddleName = "", StreetAddress = "765 Delridge Way Sw", City = "Seattle", ZipCode = "98104", State = "WA", BirthDate = new System.DateTime(1955, 1, 8) },
|
||||
new Patient { SSN = "738-29-5963", FirstName = "John", LastName = "Kelly", MiddleName = "", StreetAddress = "Pacific West Outlet", City = "Gilroy", ZipCode = "95020", State = "CA", BirthDate = new System.DateTime(1969, 6, 25) },
|
||||
new Patient { SSN = "253-47-6467", FirstName = "Robert", LastName = "Kelly", MiddleName = "", StreetAddress = "6425 Nw Loop 410", City = "San Antonio", ZipCode = "78204", State = "TX", BirthDate = new System.DateTime(1979, 9, 17) },
|
||||
new Patient { SSN = "059-47-6363", FirstName = "Kevin", LastName = "Kennedy", MiddleName = "", StreetAddress = "2550 Ne Sandy Blvd", City = "Portland", ZipCode = "97205", State = "OR", BirthDate = new System.DateTime(2005, 12, 16) },
|
||||
new Patient { SSN = "382-51-9530", FirstName = "Mitch", LastName = "Kennedy", MiddleName = "", StreetAddress = "C/O Starpak, Inc.", City = "Greeley", ZipCode = "80631", State = "CO", BirthDate = new System.DateTime(1980, 2, 28) },
|
||||
new Patient { SSN = "480-79-4419", FirstName = "Imtiaz", LastName = "Khan", MiddleName = "", StreetAddress = "25095 W. Florissant", City = "Ferguson", ZipCode = "63135", State = "MS", BirthDate = new System.DateTime(1971, 9, 2) },
|
||||
new Patient { SSN = "097-39-6667", FirstName = "Karan", LastName = "Khanna", MiddleName = "", StreetAddress = "755 W Washington Ave Ste D", City = "Sequim", ZipCode = "98382", State = "WA", BirthDate = new System.DateTime(1993, 8, 3) },
|
||||
new Patient { SSN = "625-86-1609", FirstName = "Anton", LastName = "Kirilov", MiddleName = "", StreetAddress = "2575 Rocky Mountain Ave.", City = "Loveland", ZipCode = "80537", State = "CO", BirthDate = new System.DateTime(1951, 5, 12) },
|
||||
new Patient { SSN = "109-78-5455", FirstName = "Christian", LastName = "Kleinerman", MiddleName = "", StreetAddress = "25150 El Camino Real", City = "San Bruno", ZipCode = "94066", State = "CA", BirthDate = new System.DateTime(1969, 1, 10) },
|
||||
new Patient { SSN = "914-28-0431", FirstName = "Andrew", LastName = "Kobylinski", MiddleName = "P.", StreetAddress = "2526a Tri-Lake Blvd Ne", City = "Kirkland", ZipCode = "98033", State = "WA", BirthDate = new System.DateTime(1999, 5, 23) },
|
||||
new Patient { SSN = "428-15-1588", FirstName = "Eugene", LastName = "Kogan", MiddleName = "", StreetAddress = "6756 Mowry", City = "Newark", ZipCode = "94560", State = "CA", BirthDate = new System.DateTime(1960, 7, 22) },
|
||||
new Patient { SSN = "612-70-0567", FirstName = "Scott", LastName = "Konersmann", MiddleName = "", StreetAddress = "52500 Liberty Way", City = "Fort Worth", ZipCode = "76102", State = "TX", BirthDate = new System.DateTime(1969, 7, 15) },
|
||||
new Patient { SSN = "025-76-2628", FirstName = "Joy", LastName = "Koski", MiddleName = "R.", StreetAddress = "258101 Nw Evergreen Parkway", City = "Beaverton", ZipCode = "97005", State = "OR", BirthDate = new System.DateTime(1957, 6, 15) },
|
||||
new Patient { SSN = "920-75-2262", FirstName = "Diane", LastName = "Krane", MiddleName = "F.", StreetAddress = "46460 West Oaks Drive", City = "Novi", ZipCode = "48375", State = "MI", BirthDate = new System.DateTime(1974, 9, 5) },
|
||||
new Patient { SSN = "748-12-0172", FirstName = "Kay", LastName = "Krane", MiddleName = "E.", StreetAddress = "9228 Via Del Sol", City = "Phoenix", ZipCode = "85004", State = "AZ", BirthDate = new System.DateTime(1992, 12, 27) },
|
||||
new Patient { SSN = "230-78-1884", FirstName = "Kay", LastName = "Krane", MiddleName = "E.", StreetAddress = "Prime Outlets", City = "Phoenix", ZipCode = "85004", State = "AZ", BirthDate = new System.DateTime(2010, 9, 14) },
|
||||
new Patient { SSN = "121-03-7961", FirstName = "Margaret", LastName = "Krupka", MiddleName = "T.", StreetAddress = "Great Northwestern", City = "North Bend", ZipCode = "98045", State = "WA", BirthDate = new System.DateTime(1971, 3, 9) },
|
||||
new Patient { SSN = "993-16-0574", FirstName = "Peter", LastName = "Kurniawan", MiddleName = "", StreetAddress = "63 W Monroe", City = "Chicago", ZipCode = "60610", State = "IL", BirthDate = new System.DateTime(2015, 11, 22) },
|
||||
new Patient { SSN = "560-17-8321", FirstName = "Jeffrey", LastName = "Kurtz", MiddleName = "", StreetAddress = "Receiving", City = "Fullerton", ZipCode = "92831", State = "CA", BirthDate = new System.DateTime(1990, 1, 15) },
|
||||
new Patient { SSN = "176-23-2126", FirstName = "Eric", LastName = "Lang", MiddleName = "", StreetAddress = "25300 Biddle Road", City = "Medford", ZipCode = "97504", State = "OR", BirthDate = new System.DateTime(1988, 2, 17) },
|
||||
new Patient { SSN = "678-53-5154", FirstName = "Elsa", LastName = "Leavitt", MiddleName = "", StreetAddress = "2575 West 2700 South", City = "Salt Lake City", ZipCode = "84101", State = "UT", BirthDate = new System.DateTime(1956, 9, 15) },
|
||||
new Patient { SSN = "950-17-4726", FirstName = "Marjorie", LastName = "Lee", MiddleName = "M.", StreetAddress = "2509 W. Frankford", City = "Carrollton", ZipCode = "75006", State = "TX", BirthDate = new System.DateTime(1990, 11, 24) },
|
||||
new Patient { SSN = "649-28-8360", FirstName = "Roger", LastName = "Lengel", MiddleName = "", StreetAddress = "490 Ne 4th St", City = "Renton", ZipCode = "98055", State = "WA", BirthDate = new System.DateTime(1998, 2, 22) },
|
||||
new Patient { SSN = "507-95-7549", FirstName = "A.", LastName = "Leonetti", MiddleName = "Francesca", StreetAddress = "5700 Legacy Dr", City = "Plano", ZipCode = "75074", State = "TX", BirthDate = new System.DateTime(1979, 4, 27) },
|
||||
new Patient { SSN = "442-99-4943", FirstName = "Bonnie", LastName = "Lepro", MiddleName = "B.", StreetAddress = "25600 E St Andrews Pl", City = "Santa Ana", ZipCode = "92701", State = "CA", BirthDate = new System.DateTime(1984, 11, 19) },
|
||||
new Patient { SSN = "674-71-8512", FirstName = "Elsie", LastName = "Lewin", MiddleName = "L.", StreetAddress = "P.O. Box 6256916", City = "Dallas", ZipCode = "75201", State = "TX", BirthDate = new System.DateTime(1980, 4, 20) },
|
||||
new Patient { SSN = "418-20-4458", FirstName = "George", LastName = "Li", MiddleName = "Z.", StreetAddress = "910 Main Street.", City = "Sparks", ZipCode = "89431", State = "NV", BirthDate = new System.DateTime(2001, 6, 7) },
|
||||
new Patient { SSN = "986-20-3872", FirstName = "Joseph", LastName = "Lique", MiddleName = "M.", StreetAddress = "257700 Ne 76th Street", City = "Redmond", ZipCode = "98052", State = "WA", BirthDate = new System.DateTime(1985, 8, 14) },
|
||||
new Patient { SSN = "716-41-6291", FirstName = "Paulo", LastName = "Lisboa", MiddleName = "H.", StreetAddress = "9178 Jumping St.", City = "Dallas", ZipCode = "75201", State = "TX", BirthDate = new System.DateTime(1951, 11, 23) },
|
||||
new Patient { SSN = "475-64-2482", FirstName = "Paulo", LastName = "Lisboa", MiddleName = "H.", StreetAddress = "Po Box 8259024", City = "Dallas", ZipCode = "75201", State = "TX", BirthDate = new System.DateTime(1971, 6, 7) },
|
||||
new Patient { SSN = "471-03-3608", FirstName = "David", LastName = "Liu", MiddleName = "J.", StreetAddress = "855 East Main Avenue", City = "Zeeland", ZipCode = "49464", State = "MI", BirthDate = new System.DateTime(1979, 1, 27) },
|
||||
new Patient { SSN = "440-49-4765", FirstName = "Jinghao", LastName = "Liu", MiddleName = "", StreetAddress = "90025 Sterling St", City = "Irving", ZipCode = "75061", State = "TX", BirthDate = new System.DateTime(1996, 4, 27) },
|
||||
new Patient { SSN = "321-33-7277", FirstName = "Kevin", LastName = "Liu", MiddleName = "", StreetAddress = "9992 Whipple Rd", City = "Union City", ZipCode = "94587", State = "CA", BirthDate = new System.DateTime(1982, 6, 26) },
|
||||
new Patient { SSN = "113-69-0506", FirstName = "Sharon", LastName = "Looney", MiddleName = "J.", StreetAddress = "74400 France Avenue South", City = "Edina", ZipCode = "55436", State = "MN", BirthDate = new System.DateTime(1979, 4, 11) },
|
||||
new Patient { SSN = "311-21-1551", FirstName = "Judy", LastName = "Lundahl", MiddleName = "R.", StreetAddress = "25149 Howard Dr", City = "West Chicago", ZipCode = "60185", State = "IL", BirthDate = new System.DateTime(1970, 5, 8) },
|
||||
new Patient { SSN = "710-73-5330", FirstName = "Denise", LastName = "Maccietto", MiddleName = "R.", StreetAddress = "Port Huron", City = "Port Huron", ZipCode = "48060", State = "MI", BirthDate = new System.DateTime(1977, 8, 8) },
|
||||
new Patient { SSN = "321-14-1319", FirstName = "Scott", LastName = "MacDonald", MiddleName = "", StreetAddress = "St. Louis Marketplace", City = "Saint Louis", ZipCode = "63103", State = "MS", BirthDate = new System.DateTime(1984, 11, 12) },
|
||||
new Patient { SSN = "340-75-5874", FirstName = "Kathy", LastName = "Marcovecchio", MiddleName = "R.", StreetAddress = "9905 Three Rivers Drive", City = "Kelso", ZipCode = "98626", State = "WA", BirthDate = new System.DateTime(1994, 4, 3) },
|
||||
new Patient { SSN = "043-85-0648", FirstName = "Melissa", LastName = "Marple", MiddleName = "R.", StreetAddress = "603 Gellert Blvd", City = "Daly City", ZipCode = "94015", State = "CA", BirthDate = new System.DateTime(1956, 9, 26) },
|
||||
new Patient { SSN = "253-33-7509", FirstName = "Frank", LastName = "Mart¡nez", MiddleName = "", StreetAddress = "870 N. 54th Ave.", City = "Chandler", ZipCode = "85225", State = "AZ", BirthDate = new System.DateTime(2003, 9, 2) },
|
||||
new Patient { SSN = "335-68-4629", FirstName = "Chris", LastName = "Maxwell", MiddleName = "", StreetAddress = "3025 E Waterway Blvd", City = "Shelton", ZipCode = "98584", State = "WA", BirthDate = new System.DateTime(2013, 3, 16) },
|
||||
new Patient { SSN = "535-30-6577", FirstName = "Sandra", LastName = "Maynard", MiddleName = "B.", StreetAddress = "9952 E. Lohman Ave.", City = "Las Cruces", ZipCode = "88001", State = "NM", BirthDate = new System.DateTime(1971, 6, 20) },
|
||||
new Patient { SSN = "613-34-9127", FirstName = "Walter", LastName = "Mays", MiddleName = "J.", StreetAddress = "Po Box 252525", City = "Santa Ana", ZipCode = "92701", State = "CA", BirthDate = new System.DateTime(1974, 2, 5) },
|
||||
new Patient { SSN = "754-70-9484", FirstName = "Lola", LastName = "McCarthy", MiddleName = "M.", StreetAddress = "1050 Oak Street", City = "Seattle", ZipCode = "98104", State = "WA", BirthDate = new System.DateTime(1986, 7, 9) },
|
||||
new Patient { SSN = "758-46-9282", FirstName = "Jane", LastName = "McCarty", MiddleName = "A.", StreetAddress = "409 Santa Monica Blvd.", City = "Santa Monica", ZipCode = "90401", State = "CA", BirthDate = new System.DateTime(2007, 1, 15) },
|
||||
new Patient { SSN = "287-44-2853", FirstName = "Yvonne", LastName = "McKay", MiddleName = "", StreetAddress = "Horizon Outlet", City = "Woodbury", ZipCode = "55125", State = "MN", BirthDate = new System.DateTime(2004, 6, 25) },
|
||||
new Patient { SSN = "173-12-0893", FirstName = "Nkenge", LastName = "McLin", MiddleName = "", StreetAddress = "Frontier Mall", City = "Cheyenne", ZipCode = "82001", State = "WY", BirthDate = new System.DateTime(2002, 12, 16) },
|
||||
new Patient { SSN = "028-18-1290", FirstName = "R. Morgan", LastName = "Mendoza", MiddleName = "L.", StreetAddress = "Johnson Creek", City = "Johnson Creek", ZipCode = "53038", State = "WI", BirthDate = new System.DateTime(2005, 3, 25) },
|
||||
new Patient { SSN = "035-47-1686", FirstName = "Helen", LastName = "Meyer", MiddleName = "M.", StreetAddress = "7505 Laguna Boulevard", City = "Elk Grove", ZipCode = "95624", State = "CA", BirthDate = new System.DateTime(1986, 1, 15) },
|
||||
new Patient { SSN = "926-47-4349", FirstName = "Dylan", LastName = "Miller", MiddleName = "", StreetAddress = "Parkway Plaza", City = "El Cajon", ZipCode = "92020", State = "CA", BirthDate = new System.DateTime(1965, 5, 7) },
|
||||
new Patient { SSN = "947-84-3762", FirstName = "Frank", LastName = "Miller", MiddleName = "", StreetAddress = "123 W. Lake Ave.", City = "Peoria", ZipCode = "61606", State = "IL", BirthDate = new System.DateTime(1972, 12, 23) },
|
||||
new Patient { SSN = "598-00-4792", FirstName = "Virginia", LastName = "Miller", MiddleName = "L.", StreetAddress = "25111 228th St Sw", City = "Bothell", ZipCode = "98011", State = "WA", BirthDate = new System.DateTime(1997, 9, 8) },
|
||||
new Patient { SSN = "069-59-6908", FirstName = "Virginia", LastName = "Miller", MiddleName = "L.", StreetAddress = "8713 Yosemite Ct.", City = "Bothell", ZipCode = "98011", State = "WA", BirthDate = new System.DateTime(2015, 6, 17) },
|
||||
new Patient { SSN = "864-49-8796", FirstName = "Neva", LastName = "Mitchell", MiddleName = "M.", StreetAddress = "2528 Meridian E", City = "Puyallup", ZipCode = "98371", State = "WA", BirthDate = new System.DateTime(2010, 8, 16) },
|
||||
new Patient { SSN = "484-78-0561", FirstName = "Joseph", LastName = "Mitzner", MiddleName = "P.", StreetAddress = "123 Camelia Avenue", City = "Oxnard", ZipCode = "93030", State = "CA", BirthDate = new System.DateTime(1991, 4, 16) },
|
||||
new Patient { SSN = "684-27-6433", FirstName = "Margaret", LastName = "Smith", MiddleName = "J.", StreetAddress = "Lewiston Mall", City = "Lewiston", ZipCode = "83501", State = "ID", BirthDate = new System.DateTime(1966, 8, 2) },
|
||||
new Patient { SSN = "521-85-5433", FirstName = "Laura", LastName = "Steele", MiddleName = "C.", StreetAddress = "253731 West Bell Road", City = "Surprise", ZipCode = "85374", State = "AZ", BirthDate = new System.DateTime(1954, 9, 24) },
|
||||
new Patient { SSN = "239-08-6212", FirstName = "Alan", LastName = "Steiner", MiddleName = "", StreetAddress = "2255 254th Avenue Se", City = "Albany", ZipCode = "97321", State = "OR", BirthDate = new System.DateTime(1969, 1, 9) },
|
||||
new Patient { SSN = "655-64-2836", FirstName = "Alice", LastName = "Steiner", MiddleName = "M.", StreetAddress = "Lone Star Factory", City = "La Marque", ZipCode = "77568", State = "TX", BirthDate = new System.DateTime(1950, 1, 15) },
|
||||
new Patient { SSN = "850-56-7206", FirstName = "Derik", LastName = "Stenerson", MiddleName = "", StreetAddress = "Factory Merchants", City = "Branson", ZipCode = "65616", State = "MS", BirthDate = new System.DateTime(1984, 4, 5) },
|
||||
new Patient { SSN = "077-42-9130", FirstName = "Vassar", LastName = "Stern", MiddleName = "J.", StreetAddress = "25130 South State Street", City = "Sandy", ZipCode = "84070", State = "UT", BirthDate = new System.DateTime(2005, 6, 6) },
|
||||
new Patient { SSN = "094-90-4314", FirstName = "Wathalee", LastName = "Steuber", MiddleName = "R.", StreetAddress = "700 Se Sunnyside Road", City = "Clackamas", ZipCode = "97015", State = "OR", BirthDate = new System.DateTime(2001, 9, 24) },
|
||||
new Patient { SSN = "409-83-6433", FirstName = "Liza Marie", LastName = "Stevens", MiddleName = "N.", StreetAddress = "7750 E Marching Rd", City = "Scottsdale", ZipCode = "85257", State = "AZ", BirthDate = new System.DateTime(1999, 12, 24) },
|
||||
new Patient { SSN = "351-34-7304", FirstName = "Robert", LastName = "Stotka", MiddleName = "B.", StreetAddress = "Sports Stores @ Tuscola", City = "Tuscola", ZipCode = "61953", State = "IL", BirthDate = new System.DateTime(1974, 4, 19) },
|
||||
new Patient { SSN = "866-96-8557", FirstName = "Kayla", LastName = "Stotler", MiddleName = "M.", StreetAddress = "9980 S Alma School Road", City = "Chandler", ZipCode = "85225", State = "AZ", BirthDate = new System.DateTime(1987, 5, 6) },
|
||||
new Patient { SSN = "716-37-0786", FirstName = "Ruth", LastName = "Suffin", MiddleName = "J.", StreetAddress = "Lancaster Mall", City = "Salem", ZipCode = "97301", State = "OR", BirthDate = new System.DateTime(2001, 10, 14) },
|
||||
new Patient { SSN = "689-86-1583", FirstName = "Elizabeth", LastName = "Sullivan", MiddleName = "J.", StreetAddress = "Town East Center", City = "Mesquite", ZipCode = "75149", State = "TX", BirthDate = new System.DateTime(2002, 6, 18) },
|
||||
new Patient { SSN = "622-25-6018", FirstName = "Michael", LastName = "Sullivan", MiddleName = "", StreetAddress = "5867 Sunrise Boulevard", City = "Citrus Heights", ZipCode = "95610", State = "CA", BirthDate = new System.DateTime(1983, 8, 27) },
|
||||
new Patient { SSN = "137-21-0253", FirstName = "Brad", LastName = "Sutton", MiddleName = "", StreetAddress = "Three Rivers Mall", City = "Kelso", ZipCode = "98626", State = "WA", BirthDate = new System.DateTime(2011, 12, 15) },
|
||||
new Patient { SSN = "237-99-8262", FirstName = "Abraham", LastName = "Swearengin", MiddleName = "L.", StreetAddress = "9920 Bridgepointe Parkway", City = "San Mateo", ZipCode = "94404", State = "CA", BirthDate = new System.DateTime(1978, 4, 26) },
|
||||
new Patient { SSN = "518-41-6271", FirstName = "Julie", LastName = "Taft-Rider", MiddleName = "", StreetAddress = "6996 South Lindbergh", City = "Saint Louis", ZipCode = "63103", State = "MS", BirthDate = new System.DateTime(1992, 12, 9) },
|
||||
new Patient { SSN = "554-31-5202", FirstName = "Clarence", LastName = "Tatman", MiddleName = "R.", StreetAddress = "San Diego Factory", City = "San Ysidro", ZipCode = "92173", State = "CA", BirthDate = new System.DateTime(1975, 10, 7) },
|
||||
new Patient { SSN = "591-44-7136", FirstName = "Chad", LastName = "Tedford", MiddleName = "J.", StreetAddress = "9500b E. Central Texas Expressway", City = "Killeen", ZipCode = "76541", State = "TX", BirthDate = new System.DateTime(1994, 4, 24) },
|
||||
new Patient { SSN = "069-09-3831", FirstName = "Vanessa", LastName = "Tench", MiddleName = "J.", StreetAddress = "2500 N Serene Blvd", City = "El Segundo", ZipCode = "90245", State = "CA", BirthDate = new System.DateTime(1951, 11, 9) },
|
||||
new Patient { SSN = "523-93-8801", FirstName = "Judy", LastName = "Thames", MiddleName = "J.", StreetAddress = "25102 Springwater", City = "Wenatchee", ZipCode = "98801", State = "WA", BirthDate = new System.DateTime(1989, 3, 14) },
|
||||
new Patient { SSN = "266-03-4963", FirstName = "Daniel", LastName = "Thompson", MiddleName = "P.", StreetAddress = "755 Nw Grandstand", City = "Issaquah", ZipCode = "98027", State = "WA", BirthDate = new System.DateTime(2010, 8, 7) },
|
||||
new Patient { SSN = "496-54-0726", FirstName = "Donald", LastName = "Thompson", MiddleName = "M.", StreetAddress = "25472 Marlay Ave", City = "Fontana", ZipCode = "92335", State = "CA", BirthDate = new System.DateTime(1974, 7, 22) },
|
||||
new Patient { SSN = "984-43-6756", FirstName = "Kendra", LastName = "Thompson", MiddleName = "N.", StreetAddress = "22571 South 2500 East", City = "Idaho Falls", ZipCode = "83402", State = "ID", BirthDate = new System.DateTime(2011, 10, 8) },
|
||||
new Patient { SSN = "047-31-4129", FirstName = "Diane", LastName = "Tibbott", MiddleName = "", StreetAddress = "8525 South Parker Road", City = "Parker", ZipCode = "80138", State = "CO", BirthDate = new System.DateTime(1991, 8, 15) },
|
||||
new Patient { SSN = "217-20-9777", FirstName = "Delia", LastName = "Toone", MiddleName = "B.", StreetAddress = "755 Columbia Ctr Blvd", City = "Kennewick", ZipCode = "99337", State = "WA", BirthDate = new System.DateTime(1983, 3, 6) },
|
||||
new Patient { SSN = "420-28-0429", FirstName = "Michael John", LastName = "Troyer", MiddleName = "R.", StreetAddress = "Oxnard Outlet", City = "Oxnard", ZipCode = "93030", State = "CA", BirthDate = new System.DateTime(1992, 1, 23) },
|
||||
new Patient { SSN = "236-75-2355", FirstName = "Christie", LastName = "Trujillo", MiddleName = "J.", StreetAddress = "One Dancing, Rr No. 25", City = "Round Rock", ZipCode = "78664", State = "TX", BirthDate = new System.DateTime(1986, 11, 24) },
|
||||
new Patient { SSN = "984-20-5166", FirstName = "Sairaj", LastName = "Uddin", MiddleName = "", StreetAddress = "Natomas Marketplace", City = "Sacramento", ZipCode = "95814", State = "CA", BirthDate = new System.DateTime(1975, 11, 18) },
|
||||
new Patient { SSN = "353-75-0098", FirstName = "Sunil", LastName = "Uppal", MiddleName = "", StreetAddress = "25500 Old Spanish Trail", City = "Houston", ZipCode = "77003", State = "TX", BirthDate = new System.DateTime(1985, 6, 24) },
|
||||
new Patient { SSN = "934-96-8406", FirstName = "Jessie", LastName = "Valerio", MiddleName = "E.", StreetAddress = "Mall Of Orange", City = "Orange", ZipCode = "92867", State = "CA", BirthDate = new System.DateTime(2015, 4, 9) },
|
||||
new Patient { SSN = "773-23-3159", FirstName = "Gregory", LastName = "Vanderbout", MiddleName = "T.", StreetAddress = "950 Gateway Street", City = "Springfield", ZipCode = "97477", State = "OR", BirthDate = new System.DateTime(2013, 7, 9) },
|
||||
new Patient { SSN = "951-08-3331", FirstName = "Michael", LastName = "Vanderhyde", MiddleName = "", StreetAddress = "Lincoln Square", City = "Arlington", ZipCode = "76010", State = "TX", BirthDate = new System.DateTime(1993, 2, 22) },
|
||||
new Patient { SSN = "856-23-4990", FirstName = "Margaret", LastName = "Vanderkamp", MiddleName = "J.", StreetAddress = "62500 Neil Road", City = "Reno", ZipCode = "89502", State = "NV", BirthDate = new System.DateTime(1976, 9, 13) },
|
||||
new Patient { SSN = "359-67-5826", FirstName = "Gary", LastName = "Vargas", MiddleName = "T", StreetAddress = "Stevens Creek Shopping Center", City = "San Jose", ZipCode = "95112", State = "CA", BirthDate = new System.DateTime(1991, 3, 12) },
|
||||
new Patient { SSN = "743-66-8203", FirstName = "Nieves", LastName = "Vargas", MiddleName = "J.", StreetAddress = "Kensington Valley Shops", City = "Howell", ZipCode = "48843", State = "MI", BirthDate = new System.DateTime(1988, 11, 2) },
|
||||
new Patient { SSN = "368-97-5673", FirstName = "Ranjit", LastName = "Varkey Chudukatil", MiddleName = "Rudra", StreetAddress = "455 256th St.", City = "Moline", ZipCode = "61265", State = "IL", BirthDate = new System.DateTime(1992, 5, 9) },
|
||||
new Patient { SSN = "890-04-1424", FirstName = "Patricia", LastName = "Vasquez", MiddleName = "M.", StreetAddress = "409 S. Main Ste. 25", City = "Ellensburg", ZipCode = "98926", State = "WA", BirthDate = new System.DateTime(2013, 9, 7) },
|
||||
new Patient { SSN = "267-37-1036", FirstName = "Wanda", LastName = "Vernon", MiddleName = "F.", StreetAddress = "Ontario Mills", City = "Ontario", ZipCode = "91764", State = "CA", BirthDate = new System.DateTime(2004, 9, 28) },
|
||||
new Patient { SSN = "101-14-5907", FirstName = "Robert", LastName = "Vessa", MiddleName = "R.", StreetAddress = "72540 Blanco Rd.", City = "San Antonio", ZipCode = "78204", State = "TX", BirthDate = new System.DateTime(1955, 2, 27) },
|
||||
new Patient { SSN = "148-51-2717", FirstName = "Caroline", LastName = "Vicknair", MiddleName = "A.", StreetAddress = "660 Lindbergh", City = "Saint Louis", ZipCode = "63103", State = "MS", BirthDate = new System.DateTime(2007, 9, 10) }
|
||||
);
|
||||
|
||||
// Create visits
|
||||
context.Visits.AddOrUpdate(
|
||||
new Visit { PatientID = 1, Date = new System.DateTime(2016, 1, 10), Reason = "Headache", Treatment = "A nap" },
|
||||
new Visit { PatientID = 1, Date = new System.DateTime(2016, 1, 10), Reason = "Worse headache", Treatment = "A longer nap" }
|
||||
);
|
||||
|
||||
|
||||
// Create test userts
|
||||
var manager = new UserManager<ApplicationUser>(
|
||||
new UserStore<ApplicationUser>(
|
||||
new ApplicationDbContext()));
|
||||
|
||||
var password = "Password!1";
|
||||
var user1 = new ApplicationUser()
|
||||
{
|
||||
UserName = string.Format("rachel@contoso.com"),
|
||||
Patients = new List<Patient>()
|
||||
};
|
||||
|
||||
manager.Create(user1, string.Format(password));
|
||||
var user2 = new ApplicationUser()
|
||||
{
|
||||
UserName = string.Format("alice@contoso.com"),
|
||||
//Patients = (from p in context.Patients where p.LastName.StartsWith("B") select p).ToList()
|
||||
};
|
||||
manager.Create(user2, string.Format(password));
|
||||
context.SaveChanges();
|
||||
user1.Patients = (from p in context.Patients where p.LastName.StartsWith("B") select p).ToList();
|
||||
/*var patient = context.Patients.Find(1);
|
||||
patient.ApplicationUsers.Add(user1);*/
|
||||
|
||||
context.SaveChanges();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ContosoClinic.Models
|
||||
{
|
||||
public class ExternalLoginConfirmationViewModel
|
||||
{
|
||||
[Required]
|
||||
[Display(Name = "Email")]
|
||||
public string Email { get; set; }
|
||||
}
|
||||
|
||||
public class ExternalLoginListViewModel
|
||||
{
|
||||
public string ReturnUrl { get; set; }
|
||||
}
|
||||
|
||||
public class SendCodeViewModel
|
||||
{
|
||||
public string SelectedProvider { get; set; }
|
||||
public ICollection<System.Web.Mvc.SelectListItem> Providers { get; set; }
|
||||
public string ReturnUrl { get; set; }
|
||||
public bool RememberMe { get; set; }
|
||||
}
|
||||
|
||||
public class VerifyCodeViewModel
|
||||
{
|
||||
[Required]
|
||||
public string Provider { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Code")]
|
||||
public string Code { get; set; }
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
[Display(Name = "Remember this browser?")]
|
||||
public bool RememberBrowser { get; set; }
|
||||
|
||||
public bool RememberMe { get; set; }
|
||||
}
|
||||
|
||||
public class ForgotViewModel
|
||||
{
|
||||
[Required]
|
||||
[Display(Name = "Email")]
|
||||
public string Email { get; set; }
|
||||
}
|
||||
|
||||
public class LoginViewModel
|
||||
{
|
||||
[Required]
|
||||
[Display(Name = "Email")]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
[Display(Name = "Remember me?")]
|
||||
public bool RememberMe { get; set; }
|
||||
}
|
||||
|
||||
public class RegisterViewModel
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[Display(Name = "Email")]
|
||||
public string Email { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Confirm password")]
|
||||
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
|
||||
public string ConfirmPassword { get; set; }
|
||||
}
|
||||
|
||||
public class ResetPasswordViewModel
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[Display(Name = "Email")]
|
||||
public string Email { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Confirm password")]
|
||||
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
|
||||
public string ConfirmPassword { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
}
|
||||
|
||||
public class ForgotPasswordViewModel
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[Display(Name = "Email")]
|
||||
public string Email { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ContosoClinic.Models
|
||||
{
|
||||
public class Patient
|
||||
{
|
||||
public Patient() { }
|
||||
public int PatientID { get; set; }
|
||||
|
||||
[StringLength(11)]
|
||||
[Column(TypeName = "char")]
|
||||
[Required]
|
||||
public string SSN { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string FirstName { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
[Required]
|
||||
public string LastName { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string MiddleName { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
[Required]
|
||||
public string StreetAddress { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
[Required]
|
||||
public string City { get; set; }
|
||||
|
||||
[StringLength(5)]
|
||||
[Column(TypeName = "char")]
|
||||
[Required]
|
||||
public string ZipCode { get; set; }
|
||||
|
||||
[StringLength(2)]
|
||||
[Column(TypeName = "char")]
|
||||
[Required]
|
||||
public string State { get; set; }
|
||||
|
||||
[Column(TypeName = "date")]
|
||||
[Required]
|
||||
public System.DateTime BirthDate { get; set; }
|
||||
|
||||
public virtual ICollection<Visit> Visits { get; set; }
|
||||
public virtual ICollection<ApplicationUser> ApplicationUsers { get; set; }
|
||||
}
|
||||
|
||||
public class Visit
|
||||
{
|
||||
public int VisitID { get; set; }
|
||||
|
||||
[Required]
|
||||
public int PatientID { get; set; }
|
||||
|
||||
[Column(TypeName = "date")]
|
||||
[Required]
|
||||
public System.DateTime Date { get; set; }
|
||||
|
||||
[StringLength(4000)]
|
||||
[Required]
|
||||
public string Reason { get; set; }
|
||||
|
||||
[StringLength(4000)]
|
||||
[Required]
|
||||
public string Treatment { get; set; }
|
||||
[Column(TypeName = "date")]
|
||||
public Nullable<System.DateTime> FollowUpDate { get; set; }
|
||||
|
||||
public virtual Patient Patient { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System.Data.Entity;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ContosoClinic.Models
|
||||
{
|
||||
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
|
||||
public class ApplicationUser : IdentityUser
|
||||
{
|
||||
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
|
||||
{
|
||||
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
|
||||
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
|
||||
// Add custom user claims here
|
||||
return userIdentity;
|
||||
}
|
||||
public virtual ICollection<Patient> Patients { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
||||
{
|
||||
public ApplicationDbContext()
|
||||
: base("DefaultConnection", throwIfV1Schema: false)
|
||||
{
|
||||
}
|
||||
|
||||
public static ApplicationDbContext Create()
|
||||
{
|
||||
return new ApplicationDbContext();
|
||||
}
|
||||
|
||||
public System.Data.Entity.DbSet<ContosoClinic.Models.Patient> Patients { get; set; }
|
||||
|
||||
public System.Data.Entity.DbSet<ContosoClinic.Models.Visit> Visits { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.Owin.Security;
|
||||
|
||||
namespace ContosoClinic.Models
|
||||
{
|
||||
public class IndexViewModel
|
||||
{
|
||||
public bool HasPassword { get; set; }
|
||||
public IList<UserLoginInfo> Logins { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public bool TwoFactor { get; set; }
|
||||
public bool BrowserRemembered { get; set; }
|
||||
}
|
||||
|
||||
public class ManageLoginsViewModel
|
||||
{
|
||||
public IList<UserLoginInfo> CurrentLogins { get; set; }
|
||||
public IList<AuthenticationDescription> OtherLogins { get; set; }
|
||||
}
|
||||
|
||||
public class FactorViewModel
|
||||
{
|
||||
public string Purpose { get; set; }
|
||||
}
|
||||
|
||||
public class SetPasswordViewModel
|
||||
{
|
||||
[Required]
|
||||
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "New password")]
|
||||
public string NewPassword { get; set; }
|
||||
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Confirm new password")]
|
||||
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
|
||||
public string ConfirmPassword { get; set; }
|
||||
}
|
||||
|
||||
public class ChangePasswordViewModel
|
||||
{
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Current password")]
|
||||
public string OldPassword { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "New password")]
|
||||
public string NewPassword { get; set; }
|
||||
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Confirm new password")]
|
||||
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
|
||||
public string ConfirmPassword { get; set; }
|
||||
}
|
||||
|
||||
public class AddPhoneNumberViewModel
|
||||
{
|
||||
[Required]
|
||||
[Phone]
|
||||
[Display(Name = "Phone Number")]
|
||||
public string Number { get; set; }
|
||||
}
|
||||
|
||||
public class VerifyPhoneNumberViewModel
|
||||
{
|
||||
[Required]
|
||||
[Display(Name = "Code")]
|
||||
public string Code { get; set; }
|
||||
|
||||
[Required]
|
||||
[Phone]
|
||||
[Display(Name = "Phone Number")]
|
||||
public string PhoneNumber { get; set; }
|
||||
}
|
||||
|
||||
public class ConfigureTwoFactorViewModel
|
||||
{
|
||||
public string SelectedProvider { get; set; }
|
||||
public ICollection<System.Web.Mvc.SelectListItem> Providers { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Data.Common;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Infrastructure.Interception;
|
||||
using Microsoft.AspNet.Identity;
|
||||
|
||||
namespace ContactManager.Models
|
||||
{
|
||||
public class SessionContextInterceptor : IDbConnectionInterceptor
|
||||
{
|
||||
public void Opened(DbConnection connection, DbConnectionInterceptionContext interceptionContext)
|
||||
{
|
||||
// Set SESSION_CONTEXT to current UserId whenever EF opens a connection
|
||||
try
|
||||
{
|
||||
var userId = System.Web.HttpContext.Current.User.Identity.GetUserId();
|
||||
if (userId != null)
|
||||
{
|
||||
DbCommand cmd = connection.CreateCommand();
|
||||
cmd.CommandText = "EXEC sp_set_session_context @key=N'UserId', @value=@UserId";
|
||||
DbParameter param = cmd.CreateParameter();
|
||||
param.ParameterName = "@UserId";
|
||||
param.Value = userId;
|
||||
cmd.Parameters.Add(param);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (System.NullReferenceException)
|
||||
{
|
||||
// If no user is logged in, leave SESSION_CONTEXT null (all rows will be filtered)
|
||||
}
|
||||
}
|
||||
|
||||
public void Opening(DbConnection connection, DbConnectionInterceptionContext interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void BeganTransaction(DbConnection connection, BeginTransactionInterceptionContext interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void BeginningTransaction(DbConnection connection, BeginTransactionInterceptionContext interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void Closed(DbConnection connection, DbConnectionInterceptionContext interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void Closing(DbConnection connection, DbConnectionInterceptionContext interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void ConnectionStringGetting(DbConnection connection, DbConnectionInterceptionContext<string> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void ConnectionStringGot(DbConnection connection, DbConnectionInterceptionContext<string> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void ConnectionStringSet(DbConnection connection, DbConnectionPropertyInterceptionContext<string> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void ConnectionStringSetting(DbConnection connection, DbConnectionPropertyInterceptionContext<string> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void ConnectionTimeoutGetting(DbConnection connection, DbConnectionInterceptionContext<int> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void ConnectionTimeoutGot(DbConnection connection, DbConnectionInterceptionContext<int> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void DataSourceGetting(DbConnection connection, DbConnectionInterceptionContext<string> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void DataSourceGot(DbConnection connection, DbConnectionInterceptionContext<string> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void DatabaseGetting(DbConnection connection, DbConnectionInterceptionContext<string> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void DatabaseGot(DbConnection connection, DbConnectionInterceptionContext<string> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void Disposed(DbConnection connection, DbConnectionInterceptionContext interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void Disposing(DbConnection connection, DbConnectionInterceptionContext interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void EnlistedTransaction(DbConnection connection, EnlistTransactionInterceptionContext interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void EnlistingTransaction(DbConnection connection, EnlistTransactionInterceptionContext interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void ServerVersionGetting(DbConnection connection, DbConnectionInterceptionContext<string> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void ServerVersionGot(DbConnection connection, DbConnectionInterceptionContext<string> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void StateGetting(DbConnection connection, DbConnectionInterceptionContext<System.Data.ConnectionState> interceptionContext)
|
||||
{
|
||||
}
|
||||
|
||||
public void StateGot(DbConnection connection, DbConnectionInterceptionContext<System.Data.ConnectionState> interceptionContext)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class SessionContextConfiguration : DbConfiguration
|
||||
{
|
||||
public SessionContextConfiguration()
|
||||
{
|
||||
AddInterceptor(new SessionContextInterceptor());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ContosoClinic")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ContosoClinic")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("95662cf0-2d48-4a49-8433-34919b38cab7")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<publishUrl>C:\!SQLSecurityDemo\ContosoClinic</publishUrl>
|
||||
<DeleteExistingFiles>False</DeleteExistingFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,316 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||
<_PublishTargetUrl>C:\!SQLSecurityDemo\ContosoClinic</_PublishTargetUrl>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<File Include="bin/Antlr3.Runtime.dll">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="bin/ContosoClinic.dll">
|
||||
<publishTime>02/18/2016 14:48:11</publishTime>
|
||||
</File>
|
||||
<File Include="bin/EntityFramework.dll">
|
||||
<publishTime>02/16/2016 21:10:24</publishTime>
|
||||
</File>
|
||||
<File Include="bin/EntityFramework.SqlServer.dll">
|
||||
<publishTime>02/16/2016 21:10:24</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.AspNet.Identity.Core.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.AspNet.Identity.EntityFramework.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.AspNet.Identity.Owin.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.Owin.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.Owin.Host.SystemWeb.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.Owin.Security.Cookies.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.Owin.Security.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.Owin.Security.Facebook.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.Owin.Security.Google.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.Owin.Security.MicrosoftAccount.dll">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.Owin.Security.OAuth.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.Owin.Security.Twitter.dll">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Microsoft.Web.Infrastructure.dll">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Newtonsoft.Json.dll">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Owin.dll">
|
||||
<publishTime>02/16/2016 21:10:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/csc.exe">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/Microsoft.Build.Tasks.CodeAnalysis.dll">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/Microsoft.CodeAnalysis.CSharp.dll">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/Microsoft.CodeAnalysis.dll">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/Microsoft.CodeAnalysis.VisualBasic.dll">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/Microsoft.CSharp.Core.targets">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/Microsoft.VisualBasic.Core.targets">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/System.Collections.Immutable.dll">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/System.Reflection.Metadata.dll">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/vbc.exe">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/VBCSCompiler.exe">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/roslyn/VBCSCompiler.exe.config">
|
||||
<publishTime>02/16/2016 21:10:27</publishTime>
|
||||
</File>
|
||||
<File Include="bin/System.Web.Helpers.dll">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="bin/System.Web.Mvc.dll">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="bin/System.Web.Optimization.dll">
|
||||
<publishTime>02/16/2016 21:10:20</publishTime>
|
||||
</File>
|
||||
<File Include="bin/System.Web.Razor.dll">
|
||||
<publishTime>02/16/2016 21:10:20</publishTime>
|
||||
</File>
|
||||
<File Include="bin/System.Web.WebPages.Deployment.dll">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="bin/System.Web.WebPages.dll">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="bin/System.Web.WebPages.Razor.dll">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="bin/WebGrease.dll">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="Content/bootstrap.css">
|
||||
<publishTime>02/16/2016 21:10:18</publishTime>
|
||||
</File>
|
||||
<File Include="Content/bootstrap.min.css">
|
||||
<publishTime>02/16/2016 21:10:18</publishTime>
|
||||
</File>
|
||||
<File Include="Content/Site.css">
|
||||
<publishTime>02/16/2016 21:10:14</publishTime>
|
||||
</File>
|
||||
<File Include="favicon.ico">
|
||||
<publishTime>02/16/2016 21:10:14</publishTime>
|
||||
</File>
|
||||
<File Include="fonts/glyphicons-halflings-regular.eot">
|
||||
<publishTime>02/16/2016 21:10:18</publishTime>
|
||||
</File>
|
||||
<File Include="fonts/glyphicons-halflings-regular.svg">
|
||||
<publishTime>02/16/2016 21:10:18</publishTime>
|
||||
</File>
|
||||
<File Include="fonts/glyphicons-halflings-regular.ttf">
|
||||
<publishTime>02/16/2016 21:10:18</publishTime>
|
||||
</File>
|
||||
<File Include="fonts/glyphicons-halflings-regular.woff">
|
||||
<publishTime>02/16/2016 21:10:18</publishTime>
|
||||
</File>
|
||||
<File Include="Global.asax">
|
||||
<publishTime>02/16/2016 21:10:14</publishTime>
|
||||
</File>
|
||||
<File Include="packages.config">
|
||||
<publishTime>02/16/2016 21:10:28</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/bootstrap.js">
|
||||
<publishTime>02/16/2016 21:10:18</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/bootstrap.min.js">
|
||||
<publishTime>02/16/2016 21:10:18</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/jquery-1.10.2.js">
|
||||
<publishTime>02/16/2016 21:10:19</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/jquery-1.10.2.min.js">
|
||||
<publishTime>02/16/2016 21:10:19</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/jquery-1.10.2.min.map">
|
||||
<publishTime>02/16/2016 21:10:19</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/jquery.validate.js">
|
||||
<publishTime>02/16/2016 21:10:22</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/jquery.validate.min.js">
|
||||
<publishTime>02/16/2016 21:10:22</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/jquery.validate.unobtrusive.js">
|
||||
<publishTime>02/16/2016 21:10:22</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/jquery.validate.unobtrusive.min.js">
|
||||
<publishTime>02/16/2016 21:10:22</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/modernizr-2.6.2.js">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/respond.js">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/respond.min.js">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/_references.js">
|
||||
<publishTime>02/16/2016 21:10:21</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/ConfirmEmail.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/ExternalLoginConfirmation.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/ExternalLoginFailure.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/ForgotPassword.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/ForgotPasswordConfirmation.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/Login.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/Register.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/ResetPassword.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/ResetPasswordConfirmation.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/SendCode.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/VerifyCode.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Account/_ExternalLoginsListPartial.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Home/About.cshtml">
|
||||
<publishTime>02/16/2016 21:10:14</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Home/Contact.cshtml">
|
||||
<publishTime>02/16/2016 21:10:14</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Home/Index.cshtml">
|
||||
<publishTime>02/16/2016 21:21:36</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Manage/AddPhoneNumber.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Manage/ChangePassword.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Manage/Index.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Manage/ManageLogins.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Manage/SetPassword.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Manage/VerifyPhoneNumber.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Patients/Create.cshtml">
|
||||
<publishTime>02/16/2016 21:31:12</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Patients/Delete.cshtml">
|
||||
<publishTime>02/16/2016 21:31:13</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Patients/Details.cshtml">
|
||||
<publishTime>02/16/2016 21:31:13</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Patients/Edit.cshtml">
|
||||
<publishTime>02/16/2016 21:31:14</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Patients/Index.cshtml">
|
||||
<publishTime>02/16/2016 21:31:14</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Shared/Error.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Shared/Lockout.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Shared/_Layout.cshtml">
|
||||
<publishTime>02/16/2016 21:12:25</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Shared/_LoginPartial.cshtml">
|
||||
<publishTime>02/16/2016 21:10:23</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Visits/Create.cshtml">
|
||||
<publishTime>02/16/2016 22:02:01</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Visits/Delete.cshtml">
|
||||
<publishTime>02/16/2016 22:02:02</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Visits/Details.cshtml">
|
||||
<publishTime>02/16/2016 22:02:02</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Visits/Edit.cshtml">
|
||||
<publishTime>02/16/2016 22:02:03</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Visits/Index.cshtml">
|
||||
<publishTime>02/16/2016 22:02:03</publishTime>
|
||||
</File>
|
||||
<File Include="Views/Web.config">
|
||||
<publishTime>02/16/2016 21:10:14</publishTime>
|
||||
</File>
|
||||
<File Include="Views/_ViewStart.cshtml">
|
||||
<publishTime>02/16/2016 21:10:14</publishTime>
|
||||
</File>
|
||||
<File Include="Web.config">
|
||||
<publishTime>02/18/2016 14:48:12</publishTime>
|
||||
</File>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,429 @@
|
||||
/* NUGET: BEGIN LICENSE TEXT
|
||||
*
|
||||
* Microsoft grants you the right to use these script files for the sole
|
||||
* purpose of either: (i) interacting through your browser with the Microsoft
|
||||
* website or online service, subject to the applicable licensing or use
|
||||
* terms; or (ii) using the files as included with a Microsoft product subject
|
||||
* to that product's license terms. Microsoft reserves all other rights to the
|
||||
* files not expressly granted by Microsoft, whether by implication, estoppel
|
||||
* or otherwise. Insofar as a script file is dual licensed under GPL,
|
||||
* Microsoft neither took the code under GPL nor distributes it thereunder but
|
||||
* under the terms set out in this paragraph. All notices and licenses
|
||||
* below are for informational purposes only.
|
||||
*
|
||||
* NUGET: END LICENSE TEXT */
|
||||
/*!
|
||||
** Unobtrusive validation support library for jQuery and jQuery Validate
|
||||
** Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
|
||||
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
|
||||
/*global document: false, jQuery: false */
|
||||
|
||||
(function ($) {
|
||||
var $jQval = $.validator,
|
||||
adapters,
|
||||
data_validation = "unobtrusiveValidation";
|
||||
|
||||
function setValidationValues(options, ruleName, value) {
|
||||
options.rules[ruleName] = value;
|
||||
if (options.message) {
|
||||
options.messages[ruleName] = options.message;
|
||||
}
|
||||
}
|
||||
|
||||
function splitAndTrim(value) {
|
||||
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
|
||||
}
|
||||
|
||||
function escapeAttributeValue(value) {
|
||||
// As mentioned on http://api.jquery.com/category/selectors/
|
||||
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
|
||||
}
|
||||
|
||||
function getModelPrefix(fieldName) {
|
||||
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1);
|
||||
}
|
||||
|
||||
function appendModelPrefix(value, prefix) {
|
||||
if (value.indexOf("*.") === 0) {
|
||||
value = value.replace("*.", prefix);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function onError(error, inputElement) { // 'this' is the form element
|
||||
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"),
|
||||
replaceAttrValue = container.attr("data-valmsg-replace"),
|
||||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;
|
||||
|
||||
container.removeClass("field-validation-valid").addClass("field-validation-error");
|
||||
error.data("unobtrusiveContainer", container);
|
||||
|
||||
if (replace) {
|
||||
container.empty();
|
||||
error.removeClass("input-validation-error").appendTo(container);
|
||||
}
|
||||
else {
|
||||
error.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onErrors(event, validator) { // 'this' is the form element
|
||||
var container = $(this).find("[data-valmsg-summary=true]"),
|
||||
list = container.find("ul");
|
||||
|
||||
if (list && list.length && validator.errorList.length) {
|
||||
list.empty();
|
||||
container.addClass("validation-summary-errors").removeClass("validation-summary-valid");
|
||||
|
||||
$.each(validator.errorList, function () {
|
||||
$("<li />").html(this.message).appendTo(list);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onSuccess(error) { // 'this' is the form element
|
||||
var container = error.data("unobtrusiveContainer"),
|
||||
replaceAttrValue = container.attr("data-valmsg-replace"),
|
||||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
|
||||
|
||||
if (container) {
|
||||
container.addClass("field-validation-valid").removeClass("field-validation-error");
|
||||
error.removeData("unobtrusiveContainer");
|
||||
|
||||
if (replace) {
|
||||
container.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onReset(event) { // 'this' is the form element
|
||||
var $form = $(this),
|
||||
key = '__jquery_unobtrusive_validation_form_reset';
|
||||
if ($form.data(key)) {
|
||||
return;
|
||||
}
|
||||
// Set a flag that indicates we're currently resetting the form.
|
||||
$form.data(key, true);
|
||||
try {
|
||||
$form.data("validator").resetForm();
|
||||
} finally {
|
||||
$form.removeData(key);
|
||||
}
|
||||
|
||||
$form.find(".validation-summary-errors")
|
||||
.addClass("validation-summary-valid")
|
||||
.removeClass("validation-summary-errors");
|
||||
$form.find(".field-validation-error")
|
||||
.addClass("field-validation-valid")
|
||||
.removeClass("field-validation-error")
|
||||
.removeData("unobtrusiveContainer")
|
||||
.find(">*") // If we were using valmsg-replace, get the underlying error
|
||||
.removeData("unobtrusiveContainer");
|
||||
}
|
||||
|
||||
function validationInfo(form) {
|
||||
var $form = $(form),
|
||||
result = $form.data(data_validation),
|
||||
onResetProxy = $.proxy(onReset, form),
|
||||
defaultOptions = $jQval.unobtrusive.options || {},
|
||||
execInContext = function (name, args) {
|
||||
var func = defaultOptions[name];
|
||||
func && $.isFunction(func) && func.apply(form, args);
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
result = {
|
||||
options: { // options structure passed to jQuery Validate's validate() method
|
||||
errorClass: defaultOptions.errorClass || "input-validation-error",
|
||||
errorElement: defaultOptions.errorElement || "span",
|
||||
errorPlacement: function () {
|
||||
onError.apply(form, arguments);
|
||||
execInContext("errorPlacement", arguments);
|
||||
},
|
||||
invalidHandler: function () {
|
||||
onErrors.apply(form, arguments);
|
||||
execInContext("invalidHandler", arguments);
|
||||
},
|
||||
messages: {},
|
||||
rules: {},
|
||||
success: function () {
|
||||
onSuccess.apply(form, arguments);
|
||||
execInContext("success", arguments);
|
||||
}
|
||||
},
|
||||
attachValidation: function () {
|
||||
$form
|
||||
.off("reset." + data_validation, onResetProxy)
|
||||
.on("reset." + data_validation, onResetProxy)
|
||||
.validate(this.options);
|
||||
},
|
||||
validate: function () { // a validation function that is called by unobtrusive Ajax
|
||||
$form.validate();
|
||||
return $form.valid();
|
||||
}
|
||||
};
|
||||
$form.data(data_validation, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
$jQval.unobtrusive = {
|
||||
adapters: [],
|
||||
|
||||
parseElement: function (element, skipAttach) {
|
||||
/// <summary>
|
||||
/// Parses a single HTML element for unobtrusive validation attributes.
|
||||
/// </summary>
|
||||
/// <param name="element" domElement="true">The HTML element to be parsed.</param>
|
||||
/// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the
|
||||
/// validation to the form. If parsing just this single element, you should specify true.
|
||||
/// If parsing several elements, you should specify false, and manually attach the validation
|
||||
/// to the form when you are finished. The default is false.</param>
|
||||
var $element = $(element),
|
||||
form = $element.parents("form")[0],
|
||||
valInfo, rules, messages;
|
||||
|
||||
if (!form) { // Cannot do client-side validation without a form
|
||||
return;
|
||||
}
|
||||
|
||||
valInfo = validationInfo(form);
|
||||
valInfo.options.rules[element.name] = rules = {};
|
||||
valInfo.options.messages[element.name] = messages = {};
|
||||
|
||||
$.each(this.adapters, function () {
|
||||
var prefix = "data-val-" + this.name,
|
||||
message = $element.attr(prefix),
|
||||
paramValues = {};
|
||||
|
||||
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
|
||||
prefix += "-";
|
||||
|
||||
$.each(this.params, function () {
|
||||
paramValues[this] = $element.attr(prefix + this);
|
||||
});
|
||||
|
||||
this.adapt({
|
||||
element: element,
|
||||
form: form,
|
||||
message: message,
|
||||
params: paramValues,
|
||||
rules: rules,
|
||||
messages: messages
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$.extend(rules, { "__dummy__": true });
|
||||
|
||||
if (!skipAttach) {
|
||||
valInfo.attachValidation();
|
||||
}
|
||||
},
|
||||
|
||||
parse: function (selector) {
|
||||
/// <summary>
|
||||
/// Parses all the HTML elements in the specified selector. It looks for input elements decorated
|
||||
/// with the [data-val=true] attribute value and enables validation according to the data-val-*
|
||||
/// attribute values.
|
||||
/// </summary>
|
||||
/// <param name="selector" type="String">Any valid jQuery selector.</param>
|
||||
|
||||
// $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one
|
||||
// element with data-val=true
|
||||
var $selector = $(selector),
|
||||
$forms = $selector.parents()
|
||||
.addBack()
|
||||
.filter("form")
|
||||
.add($selector.find("form"))
|
||||
.has("[data-val=true]");
|
||||
|
||||
$selector.find("[data-val=true]").each(function () {
|
||||
$jQval.unobtrusive.parseElement(this, true);
|
||||
});
|
||||
|
||||
$forms.each(function () {
|
||||
var info = validationInfo(this);
|
||||
if (info) {
|
||||
info.attachValidation();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
adapters = $jQval.unobtrusive.adapters;
|
||||
|
||||
adapters.add = function (adapterName, params, fn) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will
|
||||
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
|
||||
/// mmmm is the parameter name).</param>
|
||||
/// <param name="fn" type="Function">The function to call, which adapts the values from the HTML
|
||||
/// attributes into jQuery Validate rules and/or messages.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
if (!fn) { // Called with no params, just a function
|
||||
fn = params;
|
||||
params = [];
|
||||
}
|
||||
this.push({ name: adapterName, params: params, adapt: fn });
|
||||
return this;
|
||||
};
|
||||
|
||||
adapters.addBool = function (adapterName, ruleName) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation rule has no parameter values.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
|
||||
/// of adapterName will be used instead.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, function (options) {
|
||||
setValidationValues(options, ruleName || adapterName, true);
|
||||
});
|
||||
};
|
||||
|
||||
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and
|
||||
/// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
||||
/// have a minimum value.</param>
|
||||
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
||||
/// have a maximum value.</param>
|
||||
/// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you
|
||||
/// have both a minimum and maximum value.</param>
|
||||
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
||||
/// contains the minimum value. The default is "min".</param>
|
||||
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
||||
/// contains the maximum value. The default is "max".</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) {
|
||||
var min = options.params.min,
|
||||
max = options.params.max;
|
||||
|
||||
if (min && max) {
|
||||
setValidationValues(options, minMaxRuleName, [min, max]);
|
||||
}
|
||||
else if (min) {
|
||||
setValidationValues(options, minRuleName, min);
|
||||
}
|
||||
else if (max) {
|
||||
setValidationValues(options, maxRuleName, max);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
adapters.addSingleVal = function (adapterName, attribute, ruleName) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation rule has a single value.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>
|
||||
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
|
||||
/// The default is "val".</param>
|
||||
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
|
||||
/// of adapterName will be used instead.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, [attribute || "val"], function (options) {
|
||||
setValidationValues(options, ruleName || adapterName, options.params[attribute]);
|
||||
});
|
||||
};
|
||||
|
||||
$jQval.addMethod("__dummy__", function (value, element, params) {
|
||||
return true;
|
||||
});
|
||||
|
||||
$jQval.addMethod("regex", function (value, element, params) {
|
||||
var match;
|
||||
if (this.optional(element)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
match = new RegExp(params).exec(value);
|
||||
return (match && (match.index === 0) && (match[0].length === value.length));
|
||||
});
|
||||
|
||||
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) {
|
||||
var match;
|
||||
if (nonalphamin) {
|
||||
match = value.match(/\W/g);
|
||||
match = match && match.length >= nonalphamin;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
|
||||
if ($jQval.methods.extension) {
|
||||
adapters.addSingleVal("accept", "mimtype");
|
||||
adapters.addSingleVal("extension", "extension");
|
||||
} else {
|
||||
// for backward compatibility, when the 'extension' validation method does not exist, such as with versions
|
||||
// of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for
|
||||
// validating the extension, and ignore mime-type validations as they are not supported.
|
||||
adapters.addSingleVal("extension", "extension", "accept");
|
||||
}
|
||||
|
||||
adapters.addSingleVal("regex", "pattern");
|
||||
adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
|
||||
adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
|
||||
adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength");
|
||||
adapters.add("equalto", ["other"], function (options) {
|
||||
var prefix = getModelPrefix(options.element.name),
|
||||
other = options.params.other,
|
||||
fullOtherName = appendModelPrefix(other, prefix),
|
||||
element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0];
|
||||
|
||||
setValidationValues(options, "equalTo", element);
|
||||
});
|
||||
adapters.add("required", function (options) {
|
||||
// jQuery Validate equates "required" with "mandatory" for checkbox elements
|
||||
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") {
|
||||
setValidationValues(options, "required", true);
|
||||
}
|
||||
});
|
||||
adapters.add("remote", ["url", "type", "additionalfields"], function (options) {
|
||||
var value = {
|
||||
url: options.params.url,
|
||||
type: options.params.type || "GET",
|
||||
data: {}
|
||||
},
|
||||
prefix = getModelPrefix(options.element.name);
|
||||
|
||||
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) {
|
||||
var paramName = appendModelPrefix(fieldName, prefix);
|
||||
value.data[paramName] = function () {
|
||||
var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']");
|
||||
// For checkboxes and radio buttons, only pick up values from checked fields.
|
||||
if (field.is(":checkbox")) {
|
||||
return field.filter(":checked").val() || field.filter(":hidden").val() || '';
|
||||
}
|
||||
else if (field.is(":radio")) {
|
||||
return field.filter(":checked").val() || '';
|
||||
}
|
||||
return field.val();
|
||||
};
|
||||
});
|
||||
|
||||
setValidationValues(options, "remote", value);
|
||||
});
|
||||
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) {
|
||||
if (options.params.min) {
|
||||
setValidationValues(options, "minlength", options.params.min);
|
||||
}
|
||||
if (options.params.nonalphamin) {
|
||||
setValidationValues(options, "nonalphamin", options.params.nonalphamin);
|
||||
}
|
||||
if (options.params.regex) {
|
||||
setValidationValues(options, "regex", options.params.regex);
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$jQval.unobtrusive.parse(document);
|
||||
});
|
||||
}(jQuery));
|
||||
@@ -0,0 +1,340 @@
|
||||
/* NUGET: BEGIN LICENSE TEXT
|
||||
*
|
||||
* Microsoft grants you the right to use these script files for the sole
|
||||
* purpose of either: (i) interacting through your browser with the Microsoft
|
||||
* website or online service, subject to the applicable licensing or use
|
||||
* terms; or (ii) using the files as included with a Microsoft product subject
|
||||
* to that product's license terms. Microsoft reserves all other rights to the
|
||||
* files not expressly granted by Microsoft, whether by implication, estoppel
|
||||
* or otherwise. Insofar as a script file is dual licensed under GPL,
|
||||
* Microsoft neither took the code under GPL nor distributes it thereunder but
|
||||
* under the terms set out in this paragraph. All notices and licenses
|
||||
* below are for informational purposes only.
|
||||
*
|
||||
* NUGET: END LICENSE TEXT */
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
||||
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
|
||||
window.matchMedia = window.matchMedia || (function(doc, undefined){
|
||||
|
||||
var bool,
|
||||
docElem = doc.documentElement,
|
||||
refNode = docElem.firstElementChild || docElem.firstChild,
|
||||
// fakeBody required for <FF4 when executed in <head>
|
||||
fakeBody = doc.createElement('body'),
|
||||
div = doc.createElement('div');
|
||||
|
||||
div.id = 'mq-test-1';
|
||||
div.style.cssText = "position:absolute;top:-100em";
|
||||
fakeBody.style.background = "none";
|
||||
fakeBody.appendChild(div);
|
||||
|
||||
return function(q){
|
||||
|
||||
div.innerHTML = '­<style media="'+q+'"> #mq-test-1 { width: 42px; }</style>';
|
||||
|
||||
docElem.insertBefore(fakeBody, refNode);
|
||||
bool = div.offsetWidth == 42;
|
||||
docElem.removeChild(fakeBody);
|
||||
|
||||
return { matches: bool, media: q };
|
||||
};
|
||||
|
||||
})(document);
|
||||
|
||||
|
||||
|
||||
|
||||
/*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
|
||||
(function( win ){
|
||||
//exposed namespace
|
||||
win.respond = {};
|
||||
|
||||
//define update even in native-mq-supporting browsers, to avoid errors
|
||||
respond.update = function(){};
|
||||
|
||||
//expose media query support flag for external use
|
||||
respond.mediaQueriesSupported = win.matchMedia && win.matchMedia( "only all" ).matches;
|
||||
|
||||
//if media queries are supported, exit here
|
||||
if( respond.mediaQueriesSupported ){ return; }
|
||||
|
||||
//define vars
|
||||
var doc = win.document,
|
||||
docElem = doc.documentElement,
|
||||
mediastyles = [],
|
||||
rules = [],
|
||||
appendedEls = [],
|
||||
parsedSheets = {},
|
||||
resizeThrottle = 30,
|
||||
head = doc.getElementsByTagName( "head" )[0] || docElem,
|
||||
base = doc.getElementsByTagName( "base" )[0],
|
||||
links = head.getElementsByTagName( "link" ),
|
||||
requestQueue = [],
|
||||
|
||||
//loop stylesheets, send text content to translate
|
||||
ripCSS = function(){
|
||||
var sheets = links,
|
||||
sl = sheets.length,
|
||||
i = 0,
|
||||
//vars for loop:
|
||||
sheet, href, media, isCSS;
|
||||
|
||||
for( ; i < sl; i++ ){
|
||||
sheet = sheets[ i ],
|
||||
href = sheet.href,
|
||||
media = sheet.media,
|
||||
isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
|
||||
|
||||
//only links plz and prevent re-parsing
|
||||
if( !!href && isCSS && !parsedSheets[ href ] ){
|
||||
// selectivizr exposes css through the rawCssText expando
|
||||
if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
|
||||
translate( sheet.styleSheet.rawCssText, href, media );
|
||||
parsedSheets[ href ] = true;
|
||||
} else {
|
||||
if( (!/^([a-zA-Z:]*\/\/)/.test( href ) && !base)
|
||||
|| href.replace( RegExp.$1, "" ).split( "/" )[0] === win.location.host ){
|
||||
requestQueue.push( {
|
||||
href: href,
|
||||
media: media
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
makeRequests();
|
||||
},
|
||||
|
||||
//recurse through request queue, get css text
|
||||
makeRequests = function(){
|
||||
if( requestQueue.length ){
|
||||
var thisRequest = requestQueue.shift();
|
||||
|
||||
ajax( thisRequest.href, function( styles ){
|
||||
translate( styles, thisRequest.href, thisRequest.media );
|
||||
parsedSheets[ thisRequest.href ] = true;
|
||||
makeRequests();
|
||||
} );
|
||||
}
|
||||
},
|
||||
|
||||
//find media blocks in css text, convert to style blocks
|
||||
translate = function( styles, href, media ){
|
||||
var qs = styles.match( /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi ),
|
||||
ql = qs && qs.length || 0,
|
||||
//try to get CSS path
|
||||
href = href.substring( 0, href.lastIndexOf( "/" )),
|
||||
repUrls = function( css ){
|
||||
return css.replace( /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + href + "$2$3" );
|
||||
},
|
||||
useMedia = !ql && media,
|
||||
//vars used in loop
|
||||
i = 0,
|
||||
j, fullq, thisq, eachq, eql;
|
||||
|
||||
//if path exists, tack on trailing slash
|
||||
if( href.length ){ href += "/"; }
|
||||
|
||||
//if no internal queries exist, but media attr does, use that
|
||||
//note: this currently lacks support for situations where a media attr is specified on a link AND
|
||||
//its associated stylesheet has internal CSS media queries.
|
||||
//In those cases, the media attribute will currently be ignored.
|
||||
if( useMedia ){
|
||||
ql = 1;
|
||||
}
|
||||
|
||||
|
||||
for( ; i < ql; i++ ){
|
||||
j = 0;
|
||||
|
||||
//media attr
|
||||
if( useMedia ){
|
||||
fullq = media;
|
||||
rules.push( repUrls( styles ) );
|
||||
}
|
||||
//parse for styles
|
||||
else{
|
||||
fullq = qs[ i ].match( /@media *([^\{]+)\{([\S\s]+?)$/ ) && RegExp.$1;
|
||||
rules.push( RegExp.$2 && repUrls( RegExp.$2 ) );
|
||||
}
|
||||
|
||||
eachq = fullq.split( "," );
|
||||
eql = eachq.length;
|
||||
|
||||
for( ; j < eql; j++ ){
|
||||
thisq = eachq[ j ];
|
||||
mediastyles.push( {
|
||||
media : thisq.split( "(" )[ 0 ].match( /(only\s+)?([a-zA-Z]+)\s?/ ) && RegExp.$2 || "all",
|
||||
rules : rules.length - 1,
|
||||
hasquery: thisq.indexOf("(") > -1,
|
||||
minw : thisq.match( /\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ),
|
||||
maxw : thisq.match( /\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" )
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
applyMedia();
|
||||
},
|
||||
|
||||
lastCall,
|
||||
|
||||
resizeDefer,
|
||||
|
||||
// returns the value of 1em in pixels
|
||||
getEmValue = function() {
|
||||
var ret,
|
||||
div = doc.createElement('div'),
|
||||
body = doc.body,
|
||||
fakeUsed = false;
|
||||
|
||||
div.style.cssText = "position:absolute;font-size:1em;width:1em";
|
||||
|
||||
if( !body ){
|
||||
body = fakeUsed = doc.createElement( "body" );
|
||||
body.style.background = "none";
|
||||
}
|
||||
|
||||
body.appendChild( div );
|
||||
|
||||
docElem.insertBefore( body, docElem.firstChild );
|
||||
|
||||
ret = div.offsetWidth;
|
||||
|
||||
if( fakeUsed ){
|
||||
docElem.removeChild( body );
|
||||
}
|
||||
else {
|
||||
body.removeChild( div );
|
||||
}
|
||||
|
||||
//also update eminpx before returning
|
||||
ret = eminpx = parseFloat(ret);
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
//cached container for 1em value, populated the first time it's needed
|
||||
eminpx,
|
||||
|
||||
//enable/disable styles
|
||||
applyMedia = function( fromResize ){
|
||||
var name = "clientWidth",
|
||||
docElemProp = docElem[ name ],
|
||||
currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[ name ] || docElemProp,
|
||||
styleBlocks = {},
|
||||
lastLink = links[ links.length-1 ],
|
||||
now = (new Date()).getTime();
|
||||
|
||||
//throttle resize calls
|
||||
if( fromResize && lastCall && now - lastCall < resizeThrottle ){
|
||||
clearTimeout( resizeDefer );
|
||||
resizeDefer = setTimeout( applyMedia, resizeThrottle );
|
||||
return;
|
||||
}
|
||||
else {
|
||||
lastCall = now;
|
||||
}
|
||||
|
||||
for( var i in mediastyles ){
|
||||
var thisstyle = mediastyles[ i ],
|
||||
min = thisstyle.minw,
|
||||
max = thisstyle.maxw,
|
||||
minnull = min === null,
|
||||
maxnull = max === null,
|
||||
em = "em";
|
||||
|
||||
if( !!min ){
|
||||
min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
|
||||
}
|
||||
if( !!max ){
|
||||
max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
|
||||
}
|
||||
|
||||
// if there's no media query at all (the () part), or min or max is not null, and if either is present, they're true
|
||||
if( !thisstyle.hasquery || ( !minnull || !maxnull ) && ( minnull || currWidth >= min ) && ( maxnull || currWidth <= max ) ){
|
||||
if( !styleBlocks[ thisstyle.media ] ){
|
||||
styleBlocks[ thisstyle.media ] = [];
|
||||
}
|
||||
styleBlocks[ thisstyle.media ].push( rules[ thisstyle.rules ] );
|
||||
}
|
||||
}
|
||||
|
||||
//remove any existing respond style element(s)
|
||||
for( var i in appendedEls ){
|
||||
if( appendedEls[ i ] && appendedEls[ i ].parentNode === head ){
|
||||
head.removeChild( appendedEls[ i ] );
|
||||
}
|
||||
}
|
||||
|
||||
//inject active styles, grouped by media type
|
||||
for( var i in styleBlocks ){
|
||||
var ss = doc.createElement( "style" ),
|
||||
css = styleBlocks[ i ].join( "\n" );
|
||||
|
||||
ss.type = "text/css";
|
||||
ss.media = i;
|
||||
|
||||
//originally, ss was appended to a documentFragment and sheets were appended in bulk.
|
||||
//this caused crashes in IE in a number of circumstances, such as when the HTML element had a bg image set, so appending beforehand seems best. Thanks to @dvelyk for the initial research on this one!
|
||||
head.insertBefore( ss, lastLink.nextSibling );
|
||||
|
||||
if ( ss.styleSheet ){
|
||||
ss.styleSheet.cssText = css;
|
||||
}
|
||||
else {
|
||||
ss.appendChild( doc.createTextNode( css ) );
|
||||
}
|
||||
|
||||
//push to appendedEls to track for later removal
|
||||
appendedEls.push( ss );
|
||||
}
|
||||
},
|
||||
//tweaked Ajax functions from Quirksmode
|
||||
ajax = function( url, callback ) {
|
||||
var req = xmlHttp();
|
||||
if (!req){
|
||||
return;
|
||||
}
|
||||
req.open( "GET", url, true );
|
||||
req.onreadystatechange = function () {
|
||||
if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){
|
||||
return;
|
||||
}
|
||||
callback( req.responseText );
|
||||
}
|
||||
if ( req.readyState == 4 ){
|
||||
return;
|
||||
}
|
||||
req.send( null );
|
||||
},
|
||||
//define ajax obj
|
||||
xmlHttp = (function() {
|
||||
var xmlhttpmethod = false;
|
||||
try {
|
||||
xmlhttpmethod = new XMLHttpRequest();
|
||||
}
|
||||
catch( e ){
|
||||
xmlhttpmethod = new ActiveXObject( "Microsoft.XMLHTTP" );
|
||||
}
|
||||
return function(){
|
||||
return xmlhttpmethod;
|
||||
};
|
||||
})();
|
||||
|
||||
//translate CSS
|
||||
ripCSS();
|
||||
|
||||
//expose update for re-running respond later on
|
||||
respond.update = ripCSS;
|
||||
|
||||
//adjust on resize
|
||||
function callMedia(){
|
||||
applyMedia( true );
|
||||
}
|
||||
if( win.addEventListener ){
|
||||
win.addEventListener( "resize", callMedia, false );
|
||||
}
|
||||
else if( win.attachEvent ){
|
||||
win.attachEvent( "onresize", callMedia );
|
||||
}
|
||||
})(this);
|
||||
@@ -0,0 +1,20 @@
|
||||
/* NUGET: BEGIN LICENSE TEXT
|
||||
*
|
||||
* Microsoft grants you the right to use these script files for the sole
|
||||
* purpose of either: (i) interacting through your browser with the Microsoft
|
||||
* website or online service, subject to the applicable licensing or use
|
||||
* terms; or (ii) using the files as included with a Microsoft product subject
|
||||
* to that product's license terms. Microsoft reserves all other rights to the
|
||||
* files not expressly granted by Microsoft, whether by implication, estoppel
|
||||
* or otherwise. Insofar as a script file is dual licensed under GPL,
|
||||
* Microsoft neither took the code under GPL nor distributes it thereunder but
|
||||
* under the terms set out in this paragraph. All notices and licenses
|
||||
* below are for informational purposes only.
|
||||
*
|
||||
* NUGET: END LICENSE TEXT */
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
||||
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
|
||||
window.matchMedia=window.matchMedia||(function(e,f){var c,a=e.documentElement,b=a.firstElementChild||a.firstChild,d=e.createElement("body"),g=e.createElement("div");g.id="mq-test-1";g.style.cssText="position:absolute;top:-100em";d.style.background="none";d.appendChild(g);return function(h){g.innerHTML='­<style media="'+h+'"> #mq-test-1 { width: 42px; }</style>';a.insertBefore(d,b);c=g.offsetWidth==42;a.removeChild(d);return{matches:c,media:h}}})(document);
|
||||
|
||||
/*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
|
||||
(function(e){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=e.matchMedia&&e.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return}var w=e.document,s=w.documentElement,i=[],k=[],q=[],o={},h=30,f=w.getElementsByTagName("head")[0]||s,g=w.getElementsByTagName("base")[0],b=f.getElementsByTagName("link"),d=[],a=function(){var D=b,y=D.length,B=0,A,z,C,x;for(;B<y;B++){A=D[B],z=A.href,C=A.media,x=A.rel&&A.rel.toLowerCase()==="stylesheet";if(!!z&&x&&!o[z]){if(A.styleSheet&&A.styleSheet.rawCssText){m(A.styleSheet.rawCssText,z,C);o[z]=true}else{if((!/^([a-zA-Z:]*\/\/)/.test(z)&&!g)||z.replace(RegExp.$1,"").split("/")[0]===e.location.host){d.push({href:z,media:C})}}}}u()},u=function(){if(d.length){var x=d.shift();n(x.href,function(y){m(y,x.href,x.media);o[x.href]=true;u()})}},m=function(I,x,z){var G=I.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),J=G&&G.length||0,x=x.substring(0,x.lastIndexOf("/")),y=function(K){return K.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+x+"$2$3")},A=!J&&z,D=0,C,E,F,B,H;if(x.length){x+="/"}if(A){J=1}for(;D<J;D++){C=0;if(A){E=z;k.push(y(I))}else{E=G[D].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;k.push(RegExp.$2&&y(RegExp.$2))}B=E.split(",");H=B.length;for(;C<H;C++){F=B[C];i.push({media:F.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:k.length-1,hasquery:F.indexOf("(")>-1,minw:F.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:F.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}j()},l,r,v=function(){var z,A=w.createElement("div"),x=w.body,y=false;A.style.cssText="position:absolute;font-size:1em;width:1em";if(!x){x=y=w.createElement("body");x.style.background="none"}x.appendChild(A);s.insertBefore(x,s.firstChild);z=A.offsetWidth;if(y){s.removeChild(x)}else{x.removeChild(A)}z=p=parseFloat(z);return z},p,j=function(I){var x="clientWidth",B=s[x],H=w.compatMode==="CSS1Compat"&&B||w.body[x]||B,D={},G=b[b.length-1],z=(new Date()).getTime();if(I&&l&&z-l<h){clearTimeout(r);r=setTimeout(j,h);return}else{l=z}for(var E in i){var K=i[E],C=K.minw,J=K.maxw,A=C===null,L=J===null,y="em";if(!!C){C=parseFloat(C)*(C.indexOf(y)>-1?(p||v()):1)}if(!!J){J=parseFloat(J)*(J.indexOf(y)>-1?(p||v()):1)}if(!K.hasquery||(!A||!L)&&(A||H>=C)&&(L||H<=J)){if(!D[K.media]){D[K.media]=[]}D[K.media].push(k[K.rules])}}for(var E in q){if(q[E]&&q[E].parentNode===f){f.removeChild(q[E])}}for(var E in D){var M=w.createElement("style"),F=D[E].join("\n");M.type="text/css";M.media=E;f.insertBefore(M,G.nextSibling);if(M.styleSheet){M.styleSheet.cssText=F}else{M.appendChild(w.createTextNode(F))}q.push(M)}},n=function(x,z){var y=c();if(!y){return}y.open("GET",x,true);y.onreadystatechange=function(){if(y.readyState!=4||y.status!=200&&y.status!=304){return}z(y.responseText)};if(y.readyState==4){return}y.send(null)},c=(function(){var x=false;try{x=new XMLHttpRequest()}catch(y){x=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return x}})();a();respond.update=a;function t(){j(true)}if(e.addEventListener){e.addEventListener("resize",t,false)}else{if(e.attachEvent){e.attachEvent("onresize",t)}}})(this);
|
||||
@@ -0,0 +1,14 @@
|
||||
using Microsoft.Owin;
|
||||
using Owin;
|
||||
|
||||
[assembly: OwinStartupAttribute(typeof(ContosoClinic.Startup))]
|
||||
namespace ContosoClinic
|
||||
{
|
||||
public partial class Startup
|
||||
{
|
||||
public void Configuration(IAppBuilder app)
|
||||
{
|
||||
ConfigureAuth(app);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
@{
|
||||
ViewBag.Title = "Confirm Email";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title.</h2>
|
||||
<div>
|
||||
<p>
|
||||
Thank you for confirming your email. Please @Html.ActionLink("Click here to Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,36 @@
|
||||
@model ContosoClinic.Models.ExternalLoginConfirmationViewModel
|
||||
@{
|
||||
ViewBag.Title = "Register";
|
||||
}
|
||||
<h2>@ViewBag.Title.</h2>
|
||||
<h3>Associate your @ViewBag.LoginProvider account.</h3>
|
||||
|
||||
@using (Html.BeginForm("ExternalLoginConfirmation", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
<h4>Association Form</h4>
|
||||
<hr />
|
||||
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
|
||||
<p class="text-info">
|
||||
You've successfully authenticated with <strong>@ViewBag.LoginProvider</strong>.
|
||||
Please enter a user name for this site below and click the Register button to finish
|
||||
logging in.
|
||||
</p>
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })
|
||||
<div class="col-md-10">
|
||||
@Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
|
||||
@Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" class="btn btn-default" value="Register" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@section Scripts {
|
||||
@Scripts.Render("~/bundles/jqueryval")
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
@{
|
||||
ViewBag.Title = "Login Failure";
|
||||
}
|
||||
|
||||
<hgroup>
|
||||
<h2>@ViewBag.Title.</h2>
|
||||
<h3 class="text-danger">Unsuccessful login with service.</h3>
|
||||
</hgroup>
|
||||
@@ -0,0 +1,29 @@
|
||||
@model ContosoClinic.Models.ForgotPasswordViewModel
|
||||
@{
|
||||
ViewBag.Title = "Forgot your password?";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title.</h2>
|
||||
|
||||
@using (Html.BeginForm("ForgotPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<h4>Enter your email.</h4>
|
||||
<hr />
|
||||
@Html.ValidationSummary("", new { @class = "text-danger" })
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })
|
||||
<div class="col-md-10">
|
||||
@Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" class="btn btn-default" value="Email Link" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@section Scripts {
|
||||
@Scripts.Render("~/bundles/jqueryval")
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
@{
|
||||
ViewBag.Title = "Forgot Password Confirmation";
|
||||
}
|
||||
|
||||
<hgroup class="title">
|
||||
<h1>@ViewBag.Title.</h1>
|
||||
</hgroup>
|
||||
<div>
|
||||
<p>
|
||||
Please check your email to reset your password.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
@using ContosoClinic.Models
|
||||
@model LoginViewModel
|
||||
@{
|
||||
ViewBag.Title = "Log in";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title.</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<section id="loginForm">
|
||||
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<h4>Use a local account to log in.</h4>
|
||||
<hr />
|
||||
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })
|
||||
<div class="col-md-10">
|
||||
@Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
|
||||
@Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" })
|
||||
<div class="col-md-10">
|
||||
@Html.PasswordFor(m => m.Password, new { @class = "form-control" })
|
||||
@Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<div class="checkbox">
|
||||
@Html.CheckBoxFor(m => m.RememberMe)
|
||||
@Html.LabelFor(m => m.RememberMe)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Log in" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
@Html.ActionLink("Register as a new user", "Register")
|
||||
</p>
|
||||
@* Enable this once you have account confirmation enabled for password reset functionality
|
||||
<p>
|
||||
@Html.ActionLink("Forgot your password?", "ForgotPassword")
|
||||
</p>*@
|
||||
}
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<section id="socialLoginForm">
|
||||
@Html.Partial("_ExternalLoginsListPartial", new ExternalLoginListViewModel { ReturnUrl = ViewBag.ReturnUrl })
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@Scripts.Render("~/bundles/jqueryval")
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
@model ContosoClinic.Models.RegisterViewModel
|
||||
@{
|
||||
ViewBag.Title = "Register";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title.</h2>
|
||||
|
||||
@using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<h4>Create a new account.</h4>
|
||||
<hr />
|
||||
@Html.ValidationSummary("", new { @class = "text-danger" })
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })
|
||||
<div class="col-md-10">
|
||||
@Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" })
|
||||
<div class="col-md-10">
|
||||
@Html.PasswordFor(m => m.Password, new { @class = "form-control" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" })
|
||||
<div class="col-md-10">
|
||||
@Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" class="btn btn-default" value="Register" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@section Scripts {
|
||||
@Scripts.Render("~/bundles/jqueryval")
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
@model ContosoClinic.Models.ResetPasswordViewModel
|
||||
@{
|
||||
ViewBag.Title = "Reset password";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title.</h2>
|
||||
|
||||
@using (Html.BeginForm("ResetPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<h4>Reset your password.</h4>
|
||||
<hr />
|
||||
@Html.ValidationSummary("", new { @class = "text-danger" })
|
||||
@Html.HiddenFor(model => model.Code)
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })
|
||||
<div class="col-md-10">
|
||||
@Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" })
|
||||
<div class="col-md-10">
|
||||
@Html.PasswordFor(m => m.Password, new { @class = "form-control" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" })
|
||||
<div class="col-md-10">
|
||||
@Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" class="btn btn-default" value="Reset" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@section Scripts {
|
||||
@Scripts.Render("~/bundles/jqueryval")
|
||||
}
|
||||