<style type="text/css">
.collapse
{
background-position: left -172px;
height: 14px;
width: 13px;
background-repeat: no-repeat;
background-image: url('DXR1.png');
cursor: pointer;
}
.expand
{
background-position: -14px -187px;
height: 14px;
width: 13px;
background-repeat: no-repeat;
background-image: url('DXR.png');
cursor: pointer;
}
table
{
border: solid 0px black;
}
table td
{
border-right: solid 0px black;
border-bottom: solid 0px black;
}
table th
{
border-bottom: solid opx black;
}
.SUBDIV table
{
border: 0px;
border-left: 0px solid black;
}
</style>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
// THIS IS FOR HIDE ALL DETAILS ROW
$(".SUBDIV table tr:not(:first-child)").not("tr tr").hide();
$(".SUBDIV .btncolexp").click(function () {
$(this).closest('tr').next('tr').toggle();
//this is for change img of btncolexp button
if ($(this).attr('class').toString() == "btncolexp collapse") {
$(this).addClass('expand');
$(this).removeClass('collapse');
}
else {
$(this).removeClass('expand');
$(this).addClass('collapse');
}
});
});
</script>
<div>
<asp:ListView ID="ListView1" runat="server" OnItemDataBound="ListView1_ItemDataBound">
<LayoutTemplate>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr id="Tr2" style="background-color: #DCDCDC; color: #000000;">
<th style="width: 2%">
</th>
<th id="Th2" style="width: 20%">
Manager Name
</th>
<th id="Th3" style="width: 20%">
A
</th>
<th id="Th4" style="width: 20%">
B
</th>
<th id="Th5" style="width: 20%">
C
</th>
<th id="Th6" style="width: 20%">
D
</th>
</tr>
</table>
<div runat="server" id="itemPlaceHolder">
</div>
</LayoutTemplate>
<ItemTemplate>
<div id="Div1" class="SUBDIV" runat="server">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr style="background-color: #F3FCEC; color: #000000;">
<td style="width: 2%">
<div class="btncolexp collapse">
</div>
</td>
<td style="width: 20%">
<asp:HiddenField ID="HdnManagerId" runat="server" Value='<%#Eval("MID") %>' />
<asp:Label ID="PriceDescLabel" runat="server" Text='<%# Eval("ManagerName") %>' />
</td>
<td style="width: 20%">
<asp:Label ID="ALabel" runat="server" Text='<%# Eval("A") %>' />
</td>
<td style="width: 20%">
<asp:Label ID="BLabel" runat="server" Text='<%# Eval("B") %>' />
</td>
<td style="width: 20%">
<asp:Label ID="CLabel" runat="server" Text='<%# Eval("C") %>' />
</td>
<td style="width: 20%">
<asp:Label ID="DLabel" runat="server" Text='<%# Eval("D") %>' />
</td>
</tr>
<tr>
<td colspan="6" style="width:100%;">
<asp:ListView ID="ListView2" runat="server">
<LayoutTemplate>
<table id="Table1" runat="server" style="width:100.7%; margin: -3px -3px -3px -3px;">
<tr id="Tr1" runat="server">
<td id="Td1" runat="server">
<table id="itemPlaceholderContainer" runat="server" style="width: 100%;
background-color: #A3F5F3; border-collapse: collapse; border-color: #999999;
border-style: none; border-width: 1px; font-family: Verdana, Arial, Helvetica, sans-serif;">
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr style="background-color: #A3F5F3; color: #000000;">
<td style="width: 2%">
</td>
<td style="width: 20%">
<asp:Label ID="PriceDescLabel" runat="server" Text='<%# Eval("PriceDesc") %>' />
</td>
<td style="width: 20%">
<asp:Label ID="ALabel" runat="server" Text='<%# Eval("A") %>' />
</td>
<td style="width: 20%">
<asp:Label ID="BLabel" runat="server" Text='<%# Eval("B") %>' />
</td>
<td style="width: 20%">
<asp:Label ID="CLabel" runat="server" Text='<%# Eval("C") %>' />
</td>
<td style="width: 20%">
<asp:Label ID="DLabel" runat="server" Text='<%# Eval("D") %>' />
</td>
</tr>
</ItemTemplate>
</asp:ListView>
</td>
</tr>
</table>
</div>
</ItemTemplate>
</asp:ListView>
</div>
---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace HierachicalListViewDemo
{
public partial class WebForm1 : System.Web.UI.Page
{
string connection = ConfigurationManager.ConnectionStrings["TestConnectionString"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
PopulateFirstListData();
}
}
private void PopulateFirstListData()
{
SqlConnection con = new SqlConnection(connection);
SqlDataAdapter da = new SqlDataAdapter("SELECT MAX(ManagerName) as ManagerName, MAX(PriceDesc) as PriceDesc, Sum(A) as A, SUM(B) as B,SUM(C) as C,SUM(D) as D, MID FROM dbo.ExceptionList excp left join dbo.Manager Mgr on excp.ManagerId = Mgr.MID Group by MID", con);
DataSet ds = new DataSet();
da.Fill(ds);
ListView1.DataSource = ds;
ListView1.DataBind();
}
private DataSet PopulateSecondListData(int ManagerId)
{
SqlConnection con = new SqlConnection(connection);
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM dbo.ExceptionList where ManagerId=" + ManagerId, con);
DataSet ds = new DataSet();
da.Fill(ds);
return ds;
}
protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
HiddenField hdnManagerId = (HiddenField)e.Item.FindControl("HdnManagerId");
ListView listview2 = (ListView)e.Item.FindControl("ListView2");
DataSet list2ds = PopulateSecondListData(Convert.ToInt32(hdnManagerId.Value));
listview2.DataSource = list2ds;
listview2.DataBind();
}
}
}
}
--------------------------------------------------------
<add name="TestConnectionString" connectionString="Data Source=.;Initial Catalog=test;Integrated Security=True" providerName="System.Data.SqlClient" />
--------------------------------------------------------
Tables
-------------------------------
CREATE TABLE [dbo].[Region](
[RID] [int] IDENTITY(1,1) NOT NULL,
[RegionName] [varchar](50) NOT NULL,
CONSTRAINT [PK_Region] PRIMARY KEY CLUSTERED
(
[RID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Region] ON
INSERT [dbo].[Region] ([RID], [RegionName]) VALUES (1, N'North')
INSERT [dbo].[Region] ([RID], [RegionName]) VALUES (2, N'South')
INSERT [dbo].[Region] ([RID], [RegionName]) VALUES (3, N'East')
INSERT [dbo].[Region] ([RID], [RegionName]) VALUES (4, N'West')
SET IDENTITY_INSERT [dbo].[Region] OFF
/****** Object: Table [dbo].[Manager] Script Date: 09/28/2014 23:58:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Manager](
[MID] [int] IDENTITY(1,1) NOT NULL,
[ManagerName] [varchar](50) NOT NULL,
[RegionId] [int] NOT NULL,
CONSTRAINT [PK_Manager] PRIMARY KEY CLUSTERED
(
[MID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Manager] ON
INSERT [dbo].[Manager] ([MID], [ManagerName], [RegionId]) VALUES (1, N'Raju', 1)
INSERT [dbo].[Manager] ([MID], [ManagerName], [RegionId]) VALUES (2, N'Raja', 2)
INSERT [dbo].[Manager] ([MID], [ManagerName], [RegionId]) VALUES (3, N'Sai', 3)
INSERT [dbo].[Manager] ([MID], [ManagerName], [RegionId]) VALUES (4, N'Pravin', 4)
INSERT [dbo].[Manager] ([MID], [ManagerName], [RegionId]) VALUES (5, N'Mahesh', 1)
INSERT [dbo].[Manager] ([MID], [ManagerName], [RegionId]) VALUES (6, N'Lakshmi', 2)
INSERT [dbo].[Manager] ([MID], [ManagerName], [RegionId]) VALUES (7, N'Gandharv', 3)
INSERT [dbo].[Manager] ([MID], [ManagerName], [RegionId]) VALUES (8, N'Avinash', 4)
INSERT [dbo].[Manager] ([MID], [ManagerName], [RegionId]) VALUES (9, N'Govind', 1)
INSERT [dbo].[Manager] ([MID], [ManagerName], [RegionId]) VALUES (10, N'Harish', 2)
SET IDENTITY_INSERT [dbo].[Manager] OFF
/****** Object: Table [dbo].[ExceptionList] Script Date: 09/28/2014 23:58:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ExceptionList](
[PriceId] [int] IDENTITY(1,1) NOT NULL,
[PriceDesc] [varchar](500) NOT NULL,
[A] [int] NULL,
[B] [int] NULL,
[C] [int] NULL,
[D] [int] NULL,
[RegionId] [int] NOT NULL,
[ManagerId] [int] NOT NULL,
CONSTRAINT [PK_ExceptionList] PRIMARY KEY CLUSTERED
(
[PriceId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[ExceptionList] ON
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (1, N'Testing_1', 6, 8, 5, NULL, 1, 1)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (2, N'Testing_2', 7, NULL, 8, NULL, 2, 2)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (3, N'Testing_3', NULL, NULL, 7, 8, 3, 3)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (4, N'Testing_4', NULL, 7, 7, NULL, 4, 4)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (5, N'Testing_5', 7, 7, 7, NULL, 1, 5)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (6, N'Testing_6', NULL, 7, NULL, 4, 2, 6)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (7, N'Testing_7', 8, NULL, 7, NULL, 3, 7)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (8, N'Testing_8', NULL, 7, NULL, 2, 4, 8)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (9, N'Testing_9', 9, NULL, 7, NULL, 1, 9)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (10, N'Testing_10', NULL, NULL, NULL, 3, 2, 10)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (11, N'Testing_11', NULL, NULL, 7, NULL, 3, 1)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (12, N'Testing_12', 12, 7, NULL, 3, 4, 2)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (13, N'Testing_13', NULL, NULL, NULL, NULL, 3, 3)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (14, N'Testing_14', 22, 7, 7, 6, 2, 4)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (15, N'Testing_15', 6, 8, 5, NULL, 1, 1)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (16, N'Testing_16', 7, NULL, 8, NULL, 2, 2)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (17, N'Testing_32', NULL, NULL, 7, 8, 3, 3)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (18, N'Testing_41', NULL, 7, 7, NULL, 4, 4)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (19, N'Testing_51', 7, 7, 7, NULL, 1, 5)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (20, N'Testing_61', NULL, 7, NULL, 4, 2, 6)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (21, N'Testing_71', 8, NULL, 7, NULL, 3, 7)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (22, N'Testing_81', NULL, 7, NULL, 2, 4, 8)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (23, N'Testing_91', 9, NULL, 7, NULL, 1, 9)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (24, N'Testing_101', NULL, NULL, NULL, 3, 2, 10)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (25, N'Testing_111', NULL, NULL, 7, NULL, 3, 1)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (26, N'Testing_121', 12, 7, NULL, 3, 4, 2)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (27, N'Testing_131', NULL, NULL, NULL, NULL, 3, 3)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (28, N'Testing_141', 22, 7, 7, 6, 2, 4)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (29, N'Testing_12', 6, 8, 5, NULL, 1, 1)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (30, N'Testing_22', 7, NULL, 8, NULL, 2, 2)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (31, N'Testing_32', NULL, NULL, 7, 8, 3, 3)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (32, N'Testing_42', NULL, 7, 7, NULL, 4, 4)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (33, N'Testing_52', 7, 7, 7, NULL, 1, 5)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (34, N'Testing_62', NULL, 7, NULL, 4, 2, 6)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (35, N'Testing_72', 8, NULL, 7, NULL, 3, 7)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (36, N'Testing_82', NULL, 7, NULL, 2, 4, 8)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (37, N'Testing_92', 9, NULL, 7, NULL, 1, 9)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (38, N'Testing_102', NULL, NULL, NULL, 3, 2, 10)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (39, N'Testing_112', NULL, NULL, 7, NULL, 3, 1)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (40, N'Testing_122', 12, 7, NULL, 3, 4, 2)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (41, N'Testing_132', NULL, NULL, NULL, NULL, 3, 3)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (42, N'Testing_142', 22, 7, 7, 6, 2, 4)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (43, N'Testing_152', 6, 8, 5, NULL, 1, 1)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (44, N'Testing_162', 7, NULL, 8, NULL, 2, 2)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (45, N'Testing_322', NULL, NULL, 7, 8, 3, 3)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (46, N'Testing_412', NULL, 7, 7, NULL, 4, 4)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (47, N'Testing_512', 7, 7, 7, NULL, 1, 5)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (48, N'Testing_612', NULL, 7, NULL, 4, 2, 6)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (49, N'Testing_712', 8, NULL, 7, NULL, 3, 7)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (50, N'Testing_812', NULL, 7, NULL, 2, 4, 8)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (51, N'Testing_912', 9, NULL, 7, NULL, 1, 9)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (52, N'Testing_1012', NULL, NULL, NULL, 3, 2, 10)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (53, N'Testing_1112', NULL, NULL, 7, NULL, 3, 1)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (54, N'Testing_1212', 12, 7, NULL, 3, 4, 2)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (55, N'Testing_1312', NULL, NULL, NULL, NULL, 3, 3)
INSERT [dbo].[ExceptionList] ([PriceId], [PriceDesc], [A], [B], [C], [D], [RegionId], [ManagerId]) VALUES (56, N'Testing_142', 22, 7, 7, 6, 2, 4)
SET IDENTITY_INSERT [dbo].[ExceptionList] OFF
/****** Object: ForeignKey [FK_ExceptionList_Manager] Script Date: 09/28/2014 23:58:23 ******/
ALTER TABLE [dbo].[ExceptionList] WITH CHECK ADD CONSTRAINT [FK_ExceptionList_Manager] FOREIGN KEY([ManagerId])
REFERENCES [dbo].[Manager] ([MID])
GO
ALTER TABLE [dbo].[ExceptionList] CHECK CONSTRAINT [FK_ExceptionList_Manager]
GO
/****** Object: ForeignKey [FK_ExceptionList_Region] Script Date: 09/28/2014 23:58:23 ******/
ALTER TABLE [dbo].[ExceptionList] WITH CHECK ADD CONSTRAINT [FK_ExceptionList_Region] FOREIGN KEY([RegionId])
REFERENCES [dbo].[Region] ([RID])
GO
ALTER TABLE [dbo].[ExceptionList] CHECK CONSTRAINT [FK_ExceptionList_Region]
GO
/****** Object: ForeignKey [FK_Manager_Region] Script Date: 09/28/2014 23:58:23 ******/
ALTER TABLE [dbo].[Manager] WITH CHECK ADD CONSTRAINT [FK_Manager_Region] FOREIGN KEY([RegionId])
REFERENCES [dbo].[Region] ([RID])
GO
ALTER TABLE [dbo].[Manager] CHECK CONSTRAINT [FK_Manager_Region]
GO
