
/****** :  View [dbo].[V_area]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_area]
AS
SELECT     TOP 100 PERCENT a.id, a.name, a.provinceID, a.cityID, a.regionID, a.zoneID, a.classID, a.userID, a.address, a.note, a.isDelete, a.state, a.Label, 
                      a.parentID, a.postTime, a.PhotoId, b.name AS provinceName, c.name AS cityName, d.name AS regionName, e.name AS zoneName, 
                      f.name AS className, m.mapCity, m.mapX, m.mapY, ISNULL(d.name, '') + ' ' + ISNULL(a.name, '') AS FullAddress
FROM         dbo.tbl_area AS a LEFT OUTER JOIN
                      dbo.tbl_areaMapInfo AS m ON a.id = m.areaID LEFT OUTER JOIN
                      dbo.tbl_province AS b ON b.id = a.provinceID LEFT OUTER JOIN
                      dbo.tbl_city AS c ON c.id = a.cityID LEFT OUTER JOIN
                      dbo.tbl_region AS d ON d.id = a.regionID LEFT OUTER JOIN
                      dbo.tbl_zone AS e ON e.id = a.zoneID LEFT OUTER JOIN
                      dbo.tbl_buildingClass AS f ON f.id = a.classID
WHERE     (a.isDelete = 0)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[29] 2[23] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4[30] 2[27] 3) )"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 3
   End
   Begin DiagramPane = 
      PaneHidden = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "a"
            Begin Extent = 
               Top = 74
               Left = 41
               Bottom = 262
               Right = 157
            End
            DisplayFlags = 280
            TopColumn = 3
         End
         Begin Table = "m"
            Begin Extent = 
               Top = 6
               Left = 217
               Bottom = 84
               Right = 347
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "b"
            Begin Extent = 
               Top = 79
               Left = 499
               Bottom = 157
               Right = 629
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "c"
            Begin Extent = 
               Top = 162
               Left = 503
               Bottom = 255
               Right = 635
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "d"
            Begin Extent = 
               Top = 277
               Left = 509
               Bottom = 442
               Right = 641
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "e"
            Begin Extent = 
               Top = 339
               Left = 342
               Bottom = 447
               Right = 474
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "f"
            Begin Extent = 
               Top = 356
               Left = 176
               Bottom = 449
               Right = 306
            End
            DisplayFlags = 280
            TopColum' ,N'user', N'dbo', N'VIEW', N'V_area'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'n = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 22
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 930
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 1410
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'V_area'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'V_area'

GO
/****** :  View [dbo].[v_Location_Area]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_Location_Area]
AS
SELECT     Area.id, Area.name, Area.PhotoId, Area.provinceID, Area.cityID, Area.regionID, Area.zoneID, Area.address, Area.state, Area.isDelete, Area.spy, Area.qpy,
                       Province.name AS ProvinceName, City.name AS CityName, Region.name AS RegionName, Zone.name AS ZoneName
FROM         dbo.tbl_area AS Area INNER JOIN
                      dbo.tbl_province AS Province ON Province.id = Area.provinceID INNER JOIN
                      dbo.tbl_city AS City ON City.id = Area.cityID INNER JOIN
                      dbo.tbl_region AS Region ON Region.id = Area.regionID INNER JOIN
                      dbo.tbl_zone AS Zone ON Zone.id = Area.zoneID
WHERE     (Area.id = Area.parentID)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Area"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 121
               Right = 171
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Province"
            Begin Extent = 
               Top = 6
               Left = 209
               Bottom = 91
               Right = 340
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "City"
            Begin Extent = 
               Top = 6
               Left = 378
               Bottom = 106
               Right = 511
            End
            DisplayFlags = 280
            TopColumn = 0
         End()
         Begin Table = "Region"
            Begin Extent = 
               Top = 6
               Left = 549
               Bottom = 121
               Right = 682
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Zone"
            Begin Extent = 
               Top = 6
               Left = 720
               Bottom = 121
               Right = 853
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 20
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      ' ,N'user', N'dbo', N'VIEW', N'v_Location_Area'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_Location_Area'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'v_Location_Area'

GO
/****** :  View [dbo].[v_Member_RestCollect]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_Member_RestCollect]
AS
SELECT     Data.id AS Id, Data.name AS Name, Data.phone AS Phone, Data.principal AS Principal, Data.address AS Address, Data.deliverInfo AS DeliverInfo, 
                      Data.LinkInfo AS linkInfo, Data.userID AS UserId, Users.email AS UserEmail, Users.nickName AS UserNickName, Data.feedback AS Feedback, 
                      Data.state AS State
FROM         dbo.tbl_restInfoCollect AS Data INNER JOIN
                      dbo.tbl_user AS Users ON Data.userID = Users.id

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Data"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 121
               Right = 171
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Users"
            Begin Extent = 
               Top = 6
               Left = 209
               Bottom = 121
               Right = 359
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_Member_RestCollect'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 1 ,N'user', N'dbo', N'VIEW', N'v_Member_RestCollect'

GO
/****** :  View [dbo].[v_News]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_News]
AS
SELECT     News.id, News.title, News.label, News.titleColor, News.URL, News.postTime, News.userID, News.classID, News.subClassID, News.[content], 
                      News.nPosition, News.isPost, ISNULL(Users.nickName, '') AS UserNickName, Class.name AS ClassName, ISNULL(SubClass.name, '') 
                      AS SubClassName, News.styleName
FROM         dbo.tbl_news AS News LEFT OUTER JOIN
                      dbo.tbl_user AS Users ON Users.id = News.userID LEFT OUTER JOIN
                      dbo.tbl_newsClass AS Class ON Class.id = News.classID LEFT OUTER JOIN
                      dbo.tbl_newsSubClass AS SubClass ON SubClass.id = News.subClassID
WHERE     (News.isDelete = 0)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[31] 4[31] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "News"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 121
               Right = 172
            End
            DisplayFlags = 280
            TopColumn = 10
         End
         Begin Table = "Users"
            Begin Extent = 
               Top = 6
               Left = 210
               Bottom = 121
               Right = 360
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Class"
            Begin Extent = 
               Top = 6
               Left = 398
               Bottom = 106
               Right = 529
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "SubClass"
            Begin Extent = 
               Top = 6
               Left = 567
               Bottom = 121
               Right = 698
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 16
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1' ,N'user', N'dbo', N'VIEW', N'v_News'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_News'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'v_News'

GO
/****** :  View [dbo].[v_NewsComment]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_NewsComment]
AS
SELECT     Data.id, Data.title, Data.URL, Data.postTime, Data.userName, Data.userID, Data.contentID, Data.[content], ISNULL(Users.nickName, '') 
                      AS UserNickName, ISNULL(Users.photo, 0) AS UserPhotoId, Users.email, News.title AS NewsTitle, News.classID
FROM         dbo.tbl_newsComment AS Data INNER JOIN
                      dbo.tbl_news AS News ON Data.contentID = News.id LEFT OUTER JOIN
                      dbo.tbl_user AS Users ON Users.id = Data.userID
WHERE     (Data.isDelete = 0)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1[50] 2[25] 3) )"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 2
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Data"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 121
               Right = 169
            End
            DisplayFlags = 280
            TopColumn = 5
         End
         Begin Table = "News"
            Begin Extent = 
               Top = 37
               Left = 513
               Bottom = 187
               Right = 647
            End
            DisplayFlags = 280
            TopColumn = 7
         End
         Begin Table = "Users"
            Begin Extent = 
               Top = 6
               Left = 207
               Bottom = 222
               Right = 357
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      PaneHidden = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_NewsComment'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 1 ,N'user', N'dbo', N'VIEW', N'v_NewsComment'

GO
/****** :  View [dbo].[v_Order_GeneralList]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

Create VIEW [dbo].[v_Order_GeneralList]
AS
SELECT     T1.id, T1.userID, T1.restID, T1.orderContent, T1.total, T1.Integral,T1.OrderMode, T1.DeliveryMoney, T1.name, T1.phone, T1.date_time, T1.IP, T1.deliverDate, T1.state, 
                      T1.note, T1.areaID, T1.OrderType, T1.OperatorRole, T1.OperatorUserId, T1.CancelType, T1.CancelNote, T1.UpdateTime, Rest.name AS RestName, 
                      ISNULL(Users.UserRate, 0) AS UserRate, ISNULL(Users.nickName, '') AS UserNickName, Rest.phone AS RestPhone, dbo.tbl_restIntro.mobile, 
                      ISNULL(Region.name + ' ' + Area.name + ' ' + T1.address, '') AS address, ISNULL(T1.address, '') AS RoomName, ISNULL(Province.id, 0) AS ProvinceId, 
                      ISNULL(City.id, 0) AS CityId, ISNULL(Region.id, 0) AS RegionId, ISNULL(Zone.id, 0) AS ZoneId, ISNULL(Province.name, '') AS ProvinceName, 
                      ISNULL(City.name, '') AS Cityname, ISNULL(Region.name, '') AS RegionName, ISNULL(Zone.name, '') AS ZoneName, ISNULL(Area.name, '') 
                      AS AreaName, ISNULL(Area.spy, '') AS spy, ISNULL(Area.qpy, '') AS qpy, ISNULL(OrderNumber.sourceID, 0) AS sourceID, ISNULL(Users.email, '') 
                      AS UserEmail, Area.parentID AS ParentAreaID, Area.isDelete AS AreaIsDelete, ISNULL(OCT.Name, '') AS CancelTypeName, T1.OperatorUserIp, 
                      (CASE WHEN T1.OperatorRole = 1 OR
                      T1.OperatorRole = 2 THEN isnull
                          ((SELECT     nickName
                              FROM         tbl_user
                              WHERE     id = T1.OperatorUserId), '') WHEN T1.OperatorRole = 3 THEN isnull
                          ((SELECT     nickName
                              FROM         tbl_systemUser
                              WHERE     id = T1.OperatorUserId), '') ELSE '' END) AS OperatorRoleNickName, ISNULL(Users.IsCs, 0) AS IsCs
FROM         (SELECT     id, userID, restID, orderContent, total, DeliveryMoney, name, phone, areaID, address, date_time, IP, CAST(CONVERT(VARCHAR(10), 
                                              deliverDate, 101) + ' ' + CONVERT(VARCHAR(8), deliverTime, 108) AS DATETIME) AS deliverDate, state, note, 1 AS OrderType, OperatorRole, 
                                              OperatorUserId, OperatorUserIp, CancelType, CancelNote, UpdateTime, Integral,OrderMode
                       FROM          dbo.tbl_order AS OrderA
                       UNION ALL
                       SELECT     id, userID, restID, orderContent, total, DeliveryMoney, name, phone, areaID, address, date_time, IP, CAST(CONVERT(VARCHAR(10), 
                                             deliverDate, 101) + ' ' + CONVERT(VARCHAR(8), deliverTime, 108) AS DATETIME) AS deliverDate, state, note, 2 AS OrderType, OperatorRole, 
                                             OperatorUserId, OperatorUserIp, CancelType, CancelNote, UpdateTime, Integral,OrderMode
                       FROM         dbo.tbl_suiteMenuOrder AS OrderB) AS T1 INNER JOIN
                      dbo.tbl_restaurant AS Rest ON Rest.id = T1.restID LEFT OUTER JOIN
                      dbo.tbl_restIntro ON Rest.id = dbo.tbl_restIntro.restID LEFT OUTER JOIN
                      dbo.tbl_area AS Area ON Area.id = T1.areaID LEFT OUTER JOIN
                      dbo.tbl_province AS Province ON Province.id = Area.provinceID LEFT OUTER JOIN
                      dbo.tbl_city AS City ON City.id = Area.cityID LEFT OUTER JOIN
                      dbo.tbl_region AS Region ON Region.id = Area.regionID LEFT OUTER JOIN
                      dbo.tbl_zone AS Zone ON Zone.id = Area.zoneID LEFT OUTER JOIN
                      dbo.tbl_orderNumber AS OrderNumber ON OrderNumber.id = T1.id LEFT OUTER JOIN
                      dbo.tbl_user AS Users ON Users.id = T1.userID LEFT OUTER JOIN
                      dbo.tbl_OrderCancelType AS OCT ON OCT.Id = T1.CancelType
GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO



EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[23] 4[38] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1[40] 2[56] 3) )"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4[30] 2[40] 3) )"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2[49] 3) )"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 2
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -164
         Left = 0
      End
      Begin Tables = 
         Begin Table = "T1"
            Begin Extent = 
               Top = 396
               Left = 38
               Bottom = 504
               Right = 194
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Rest"
            Begin Extent = 
               Top = 8
               Left = 52
               Bottom = 292
               Right = 331
            End
            DisplayFlags = 280
            TopColumn = 8
         End
         Begin Table = "tbl_restIntro"
            Begin Extent = 
               Top = 26
               Left = 611
               Bottom = 246
               Right = 761
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Area"
            Begin Extent = 
               Top = 6
               Left = 799
               Bottom = 121
               Right = 932
            End
            DisplayFlags = 280
            TopColumn = 9
         End
         Begin Table = "Province"
            Begin Extent = 
               Top = 246
               Left = 539
               Bottom = 331
               Right = 670
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "City"
            Begin Extent = 
               Top = 294
               Left = 38
               Bottom = 394
               Right = 171
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Region"
            Begin Extent = 
               Top = 294
               Left = 209
               Bottom = 409
               Right = 342
            End
            DisplayFlags = 280
       ' ,N'user', N'dbo', N'VIEW', N'v_Order_GeneralList'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'     TopColumn = 0
         End
         Begin Table = "Zone"
            Begin Extent = 
               Top = 294
               Left = 380
               Bottom = 409
               Right = 513
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "OrderNumber"
            Begin Extent = 
               Top = 126
               Left = 799
               Bottom = 226
               Right = 930
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Users"
            Begin Extent = 
               Top = 228
               Left = 799
               Bottom = 343
               Right = 949
            End
            DisplayFlags = 280
            TopColumn = 18
         End
         Begin Table = "OCT"
            Begin Extent = 
               Top = 58
               Left = 369
               Bottom = 136
               Right = 499
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 35
         Width = 284
         Width = 1500
         Width = 1500
         Width = 2265
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 3330
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      PaneHidden = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_Order_GeneralList'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'v_Order_GeneralList'

GO



SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

Create VIEW [dbo].[v_Order_RunningList]
AS
SELECT     T1.id, T1.userID, T1.restID, T1.orderContent, T1.total, T1.DeliveryMoney, T1.name, T1.phone, T1.date_time, T1.IP, T1.deliverDate, T1.state, T1.note, 
                      T1.areaID, T1.OrderType, T1.OperatorRole, T1.OperatorUserId, T1.CancelType, T1.CancelNote, T1.UpdateTime, Rest.name AS RestName, 
                      ISNULL(Users.UserRate, 0) AS UserRate, ISNULL(Users.nickName, '') AS UserNickName, Rest.phone AS RestPhone, dbo.tbl_restIntro.mobile, 
                      ISNULL(Region.name + ' ' + Area.name + ' ' + T1.address, '') AS address, ISNULL(T1.address, '') AS RoomName, ISNULL(Province.id, 0) AS ProvinceId, 
                      ISNULL(City.id, 0) AS CityId, ISNULL(Region.id, 0) AS RegionId, ISNULL(Zone.id, 0) AS ZoneId, ISNULL(Province.name, '') AS ProvinceName, 
                      ISNULL(City.name, '') AS Cityname, ISNULL(Region.name, '') AS RegionName, ISNULL(Zone.name, '') AS ZoneName, ISNULL(Area.name, '') 
                      AS AreaName, ISNULL(Area.spy, '') AS spy, ISNULL(Area.qpy, '') AS qpy, ISNULL(OrderNumber.sourceID, 0) AS sourceID, ISNULL(Users.email, '') 
                      AS UserEmail, Area.parentID AS ParentAreaID, Area.isDelete AS AreaIsDelete, ISNULL(OCT.Name, '') AS CancelTypeName, T1.OperatorUserIp, 
                      (CASE WHEN T1.OperatorRole = 1 OR
                      T1.OperatorRole = 2 THEN isnull
                          ((SELECT     nickName
                              FROM         tbl_user
                              WHERE     id = T1.OperatorUserId), '') WHEN T1.OperatorRole = 3 THEN isnull
                          ((SELECT     nickName
                              FROM         tbl_systemUser
                              WHERE     id = T1.OperatorUserId), '') ELSE '' END) AS OperatorRoleNickName, ISNULL(Users.IsCs, 0) AS IsCs,T1.Integral,T1.OrderMode
FROM         (SELECT     id, userID, restID, orderContent, total, DeliveryMoney, name, phone, areaID, address, date_time, IP, CAST(CONVERT(VARCHAR(10), 
                                              deliverDate, 101) + ' ' + CONVERT(VARCHAR(8), deliverTime, 108) AS DATETIME) AS deliverDate, state, note, OrderType, OperatorRole, 
                                              OperatorUserId, OperatorUserIp, CancelType, CancelNote, UpdateTime,Integral,OrderMode
                       FROM          dbo.tbl_runningorder AS OrderA                       
					) AS T1 INNER JOIN
                      dbo.tbl_restaurant AS Rest ON Rest.id = T1.restID LEFT OUTER JOIN
                      dbo.tbl_restIntro ON Rest.id = dbo.tbl_restIntro.restID LEFT OUTER JOIN
                      dbo.tbl_area AS Area ON Area.id = T1.areaID LEFT OUTER JOIN
                      dbo.tbl_province AS Province ON Province.id = Area.provinceID LEFT OUTER JOIN
                      dbo.tbl_city AS City ON City.id = Area.cityID LEFT OUTER JOIN
                      dbo.tbl_region AS Region ON Region.id = Area.regionID LEFT OUTER JOIN
                      dbo.tbl_zone AS Zone ON Zone.id = Area.zoneID LEFT OUTER JOIN
                      dbo.tbl_orderNumber AS OrderNumber ON OrderNumber.id = T1.id LEFT OUTER JOIN
                      dbo.tbl_user AS Users ON Users.id = T1.userID LEFT OUTER JOIN
                      dbo.tbl_OrderCancelType AS OCT ON OCT.Id = T1.CancelType
GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO



EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[23] 4[38] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1[40] 2[56] 3) )"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4[30] 2[40] 3) )"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2[49] 3) )"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 2
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -164
         Left = 0
      End
      Begin Tables = 
         Begin Table = "T1"
            Begin Extent = 
               Top = 396
               Left = 38
               Bottom = 504
               Right = 194
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Rest"
            Begin Extent = 
               Top = 8
               Left = 52
               Bottom = 292
               Right = 331
            End
            DisplayFlags = 280
            TopColumn = 8
         End
         Begin Table = "tbl_restIntro"
            Begin Extent = 
               Top = 26
               Left = 611
               Bottom = 246
               Right = 761
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Area"
            Begin Extent = 
               Top = 6
               Left = 799
               Bottom = 121
               Right = 932
            End
            DisplayFlags = 280
            TopColumn = 9
         End
         Begin Table = "Province"
            Begin Extent = 
               Top = 246
               Left = 539
               Bottom = 331
               Right = 670
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "City"
            Begin Extent = 
               Top = 294
               Left = 38
               Bottom = 394
               Right = 171
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Region"
            Begin Extent = 
               Top = 294
               Left = 209
               Bottom = 409
               Right = 342
            End
            DisplayFlags = 280
       ' ,N'user', N'dbo', N'VIEW', N'v_Order_RunningList'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'     TopColumn = 0
         End
         Begin Table = "Zone"
            Begin Extent = 
               Top = 294
               Left = 380
               Bottom = 409
               Right = 513
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "OrderNumber"
            Begin Extent = 
               Top = 126
               Left = 799
               Bottom = 226
               Right = 930
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Users"
            Begin Extent = 
               Top = 228
               Left = 799
               Bottom = 343
               Right = 949
            End
            DisplayFlags = 280
            TopColumn = 18
         End
         Begin Table = "OCT"
            Begin Extent = 
               Top = 58
               Left = 369
               Bottom = 136
               Right = 499
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 35
         Width = 284
         Width = 1500
         Width = 1500
         Width = 2265
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 3330
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      PaneHidden = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_Order_RunningList'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'v_Order_RunningList'

GO
/****** :  View [dbo].[V_QYJL]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_QYJL]
AS
SELECT     dbo.tbl_systemPower.Code, dbo.tbl_systemUser.id, dbo.tbl_systemUser.name, dbo.tbl_systemUser.password, dbo.tbl_systemUser.role, 
                      dbo.tbl_systemUser.trueName, dbo.tbl_systemUser.nickName, dbo.tbl_systemUser.deptName, dbo.tbl_systemUser.nposition, 
                      dbo.tbl_systemUser.contact, dbo.tbl_systemUser.addTime, dbo.tbl_systemUser.note, dbo.tbl_systemUser.state
FROM         dbo.tbl_systemPower RIGHT OUTER JOIN
                      dbo.tbl_systemUser ON dbo.tbl_systemPower.id = dbo.tbl_systemUser.role
WHERE     (dbo.tbl_systemUser.state = 0)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[34] 4[42] 2[19] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4[66] 2[5] 3) )"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tbl_systemPower"
            Begin Extent = 
               Top = 36
               Left = 582
               Bottom = 151
               Right = 792
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tbl_systemUser"
            Begin Extent = 
               Top = 22
               Left = 85
               Bottom = 161
               Right = 344
            End
            DisplayFlags = 280
            TopColumn = 6
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1860
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'V_QYJL'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 1 ,N'user', N'dbo', N'VIEW', N'V_QYJL'

GO
/****** :  View [dbo].[v_Rest_OrderNavigationList]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[v_Rest_OrderNavigationList]
AS
SELECT     Rest.id AS RestId, Rest.name, Rest.logoPhotoID, Rest.provinceID, Rest.cityID, Rest.regionID, Rest.zoneID, Intro.deliverMoney, Intro.expenditure, 
                      Rest.SClassID, Rest.responseTime, Rest.rank, Rest.address, Rest.note, Rest.phone, ISNULL(Class.name, '') AS ClassName, ISNULL
                          ((SELECT     AVG(SPoint) AS SPoint
                              FROM         dbo.tbl_ShopComments
                              WHERE     (shopID = Rest.id)), 0) AS SPoint, ISNULL
                          ((SELECT     AVG(FPoint) AS FPoint
                              FROM         dbo.tbl_ShopComments AS tbl_ShopComments_1
                              WHERE     (shopID = Rest.id)), 0) AS FPoint, ISNULL(Map.mapX, 0) AS Mapx, ISNULL(Map.mapY, 0) AS MapY
		,Rest.spy ,Rest.qpy
FROM         dbo.tbl_restaurant AS Rest LEFT OUTER JOIN
                      dbo.tbl_restIntro AS Intro ON Intro.restID = Rest.id LEFT OUTER JOIN
                      dbo.tbl_restClass AS Class ON Class.id = Rest.classID LEFT OUTER JOIN
                      dbo.tbl_restMapInfo AS Map ON Rest.id = Map.restID
WHERE     (Rest.isDelete = 0) AND (Rest.state = 1)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[29] 4[15] 2[26] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1[50] 2[25] 3) )"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4[30] 2[40] 3) )"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2[26] 3) )"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -96
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Rest"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 198
               Right = 186
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Intro"
            Begin Extent = 
               Top = 6
               Left = 223
               Bottom = 121
               Right = 374
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Map"
            Begin Extent = 
               Top = 6
               Left = 412
               Bottom = 121
               Right = 543
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Class"
            Begin Extent = 
               Top = 102
               Left = 581
               Bottom = 202
               Right = 712
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 19
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
      ' ,N'user', N'dbo', N'VIEW', N'v_Rest_OrderNavigationList'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'   Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_Rest_OrderNavigationList'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'v_Rest_OrderNavigationList'

GO
/****** :  View [dbo].[v_Restaurant]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_Restaurant]
AS
SELECT     TOP 100 PERCENT dbo.tbl_restaurant.id, dbo.tbl_restaurant.name, dbo.tbl_restaurant.clickAmount, dbo.tbl_restaurant.addrPhoto, 
                      dbo.tbl_restaurant.logoPhotoID, dbo.tbl_restaurant.logo, dbo.tbl_restaurant.labelString, dbo.tbl_restaurant.classID, dbo.tbl_restaurant.SClassID, 
                      dbo.tbl_restaurant.provinceID, dbo.tbl_restaurant.cityID, dbo.tbl_restaurant.regionID, dbo.tbl_restaurant.zoneID, dbo.tbl_restaurant.areaID, 
                      dbo.tbl_restaurant.linkman, dbo.tbl_restaurant.phone, dbo.tbl_restaurant.address, dbo.tbl_restaurant.userID, dbo.tbl_restaurant.MuserID, 
                      dbo.tbl_restaurant.isDeliver, dbo.tbl_restaurant.responseTime, dbo.tbl_restaurant.addTime, dbo.tbl_restaurant.note, dbo.tbl_restaurant.isDelete, 
                      dbo.tbl_restaurant.state, dbo.tbl_restaurant.pointAverage, dbo.tbl_restaurant.menuType, dbo.tbl_restaurant.rank, dbo.tbl_area.name AS areaName, 
                      dbo.tbl_city.name AS cityName, dbo.tbl_zone.name AS zoneName, dbo.tbl_province.name AS provinceName, dbo.tbl_region.name AS regionName, 
                      dbo.tbl_user.Name AS userName, dbo.tbl_restIntro.mobile, dbo.tbl_restIntro.colorMobile, dbo.tbl_restIntro.fax, dbo.tbl_restIntro.email, 
                      dbo.tbl_restIntro.msnQQ, dbo.tbl_restIntro.expenditure, dbo.tbl_restIntro.discount, dbo.tbl_restIntro.discountNote, dbo.tbl_restIntro.policy, 
                      dbo.tbl_restIntro.deliverMoney, dbo.tbl_restIntro.deliverNote, dbo.tbl_restIntro.chainMsg, dbo.tbl_restIntro.mapUrl, dbo.tbl_restIntro.URL, 
                      dbo.tbl_restIntro.PAmount, dbo.tbl_restIntro.BAmount, dbo.tbl_restIntro.stallAmount, dbo.tbl_restIntro.traffic, dbo.tbl_restIntro.deliverArea, 
                      dbo.tbl_restIntro.settlement, dbo.tbl_restIntro.orderNote, dbo.tbl_restIntro.policy AS Expr1, dbo.tbl_restIntro.isPost, dbo.tbl_restIntro.[content], 
                      dbo.tbl_restIntro.nPosition, dbo.tbl_restIntro.postTime, dbo.tbl_restIntro.updateCyc, dbo.tbl_restIntro.senderAmount
FROM         dbo.tbl_restaurant LEFT OUTER JOIN
                      dbo.tbl_restIntro ON dbo.tbl_restaurant.id = dbo.tbl_restIntro.restID LEFT OUTER JOIN
                      dbo.tbl_user ON dbo.tbl_restaurant.userID = dbo.tbl_user.id LEFT OUTER JOIN
                      dbo.tbl_zone ON dbo.tbl_restaurant.zoneID = dbo.tbl_zone.id LEFT OUTER JOIN
                      dbo.tbl_region ON dbo.tbl_restaurant.regionID = dbo.tbl_region.id LEFT OUTER JOIN
                      dbo.tbl_province ON dbo.tbl_restaurant.provinceID = dbo.tbl_province.id LEFT OUTER JOIN
                      dbo.tbl_city ON dbo.tbl_restaurant.cityID = dbo.tbl_city.id LEFT OUTER JOIN
                      dbo.tbl_area ON dbo.tbl_restaurant.areaID = dbo.tbl_area.id
WHERE     (dbo.tbl_restaurant.isDelete = 0)
ORDER BY dbo.tbl_restaurant.SClassID DESC, dbo.tbl_restaurant.id DESC

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tbl_restaurant"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 121
               Right = 185
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tbl_restIntro"
            Begin Extent = 
               Top = 6
               Left = 223
               Bottom = 121
               Right = 374
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tbl_user"
            Begin Extent = 
               Top = 6
               Left = 412
               Bottom = 121
               Right = 562
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tbl_zone"
            Begin Extent = 
               Top = 6
               Left = 600
               Bottom = 121
               Right = 733
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tbl_region"
            Begin Extent = 
               Top = 126
               Left = 38
               Bottom = 241
               Right = 171
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tbl_province"
            Begin Extent = 
               Top = 126
               Left = 209
               Bottom = 211
               Right = 340
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tbl_city"
            Begin Extent = 
               Top = 126
               Left = 378
               Bottom = 226
               Right = 511
            End
          ' ,N'user', N'dbo', N'VIEW', N'v_Restaurant'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'  DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tbl_area"
            Begin Extent = 
               Top = 126
               Left = 549
               Bottom = 241
               Right = 682
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_Restaurant'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'v_Restaurant'

GO
/****** :  View [dbo].[v_RestCommend]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_RestCommend]
AS
SELECT     Data.id, Data.restID, Data.addUserID, Data.color, Data.zoneID AS ParentZoneId, Data.Position, Rest.name AS RestName, Rest.logoPhotoID, 
                      Rest.provinceID, Rest.cityID, Rest.regionID, Rest.zoneID, Rest.address, Rest.responseTime, Rest.SClassID, Rest.note, Rest.rank, Intro.deliverMoney, 
                      Intro.deliverArea, Class.name AS ClassName, Data.subZoneID, Rest.Rate, signUp.date_time AS signUpDate
FROM         dbo.tbl_RestCommend AS Data INNER JOIN
                      dbo.tbl_restaurant AS Rest ON Rest.id = Data.restID LEFT OUTER JOIN
                      dbo.tbl_restIntro AS Intro ON Intro.restID = Data.restID LEFT OUTER JOIN
                      dbo.tbl_restClass AS Class ON Class.id = Rest.classID LEFT OUTER JOIN
                      dbo.tbl_restSignUp AS signUp ON signUp.restID = Data.restID
WHERE     (Rest.state = 1) AND (Rest.isDelete = 0)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[25] 4[38] 2[13] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1[35] 2[18] 3) )"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 2
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -192
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Data"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 121
               Right = 170
            End
            DisplayFlags = 280
            TopColumn = 4
         End
         Begin Table = "Rest"
            Begin Extent = 
               Top = 6
               Left = 208
               Bottom = 121
               Right = 355
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Intro"
            Begin Extent = 
               Top = 6
               Left = 393
               Bottom = 121
               Right = 544
            End
            DisplayFlags = 280
            TopColumn = 29
         End
         Begin Table = "Class"
            Begin Extent = 
               Top = 6
               Left = 582
               Bottom = 99
               Right = 712
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "signUp"
            Begin Extent = 
               Top = 126
               Left = 38
               Bottom = 234
               Right = 200
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 19
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
    ' ,N'user', N'dbo', N'VIEW', N'v_RestCommend'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'     Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      PaneHidden = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_RestCommend'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'v_RestCommend'

GO
/****** :  View [dbo].[v_Search_Rest]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_Search_Rest]
AS
SELECT     Rest.id, Rest.name, Rest.logoPhotoID, Intro.deliverMoney, Rest.address, Rest.note, Rest.responseTime, Rest.rank, Rest.Rate, 
                      Class.name AS ClassName, SingUp.date_time AS SignUpDate
FROM         dbo.tbl_restaurant AS Rest INNER JOIN
                      dbo.tbl_restIntro AS Intro ON Intro.restID = Rest.id INNER JOIN
                      dbo.tbl_restClass AS Class ON Class.id = Rest.classID LEFT OUTER JOIN
                      dbo.tbl_restSignUp AS SingUp ON Rest.id = SingUp.restID
WHERE     (Rest.isDelete = 0) AND (Rest.state = 1) AND (Rest.SClassID > 0)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Rest"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 121
               Right = 208
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Intro"
            Begin Extent = 
               Top = 6
               Left = 246
               Bottom = 121
               Right = 397
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Class"
            Begin Extent = 
               Top = 6
               Left = 435
               Bottom = 106
               Right = 566
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "SingUp"
            Begin Extent = 
               Top = 6
               Left = 604
               Bottom = 121
               Right = 767
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_Search_Rest'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'' ,N'user', N'dbo', N'VIEW', N'v_Search_Rest'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'v_Search_Rest'

GO
/****** :  View [dbo].[v_Search_StandardArea]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_Search_StandardArea]
AS
SELECT     Area.id, Area.name, Area.PhotoId, Area.provinceID, Area.cityID, Area.regionID, Area.zoneID, Area.classID, Area.userID, Area.address, Area.note, 
                      Area.state, Area.spy, Area.qpy, Area.label, Province.name AS provinceName, City.name AS cityName, Region.name AS regionName, Zone.name AS zoneName, 
                      ISNULL(Class.name, '') AS className
FROM         dbo.tbl_area AS Area INNER JOIN
                      dbo.tbl_province AS Province ON Province.id = Area.provinceID INNER JOIN
                      dbo.tbl_city AS City ON City.id = Area.cityID INNER JOIN
                      dbo.tbl_region AS Region ON Region.id = Area.regionID INNER JOIN
                      dbo.tbl_zone AS Zone ON Zone.id = Area.zoneID LEFT OUTER JOIN
                      dbo.tbl_buildingClass AS Class ON Class.id = Area.classID
WHERE     (Area.isDelete = 0) AND (Area.id = Area.parentID) AND (Area.state = 1)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -192
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Area"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 121
               Right = 171
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Province"
            Begin Extent = 
               Top = 6
               Left = 378
               Bottom = 91
               Right = 509
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "City"
            Begin Extent = 
               Top = 6
               Left = 547
               Bottom = 106
               Right = 680
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Region"
            Begin Extent = 
               Top = 6
               Left = 718
               Bottom = 121
               Right = 851
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Zone"
            Begin Extent = 
               Top = 96
               Left = 378
               Bottom = 211
               Right = 511
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Class"
            Begin Extent = 
               Top = 108
               Left = 549
               Bottom = 208
               Right = 680
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 21
         Width = 284
         Width = 1500
         Width = 1500
         Width = ' ,N'user', N'dbo', N'VIEW', N'v_Search_StandardArea'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_Search_StandardArea'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'v_Search_StandardArea'

GO
/****** :  View [dbo].[v_Shop_DeliverArea]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_Shop_DeliverArea]
AS
SELECT     Data.id, Data.RestID AS ShopId, Area.id AS AreaId, Area.name AS AreaName, Area.regionID, Area.RegionName, Area.address, Area.spy, Area.qpy, 
                      Data.ResponseTime, Data.DeliveryMoney
FROM         dbo.tbl_shop2Area AS Data INNER JOIN
                      dbo.v_Location_Area AS Area ON Area.id = Data.areaID
WHERE     (Area.isDelete = 0) AND (Area.state = 1)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[42] 4[21] 2[18] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Data"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 106
               Right = 169
            End
            DisplayFlags = 280
            TopColumn = 2
         End
         Begin Table = "Area"
            Begin Extent = 
               Top = 6
               Left = 207
               Bottom = 121
               Right = 356
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_Shop_DeliverArea'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 1 ,N'user', N'dbo', N'VIEW', N'v_Shop_DeliverArea'

GO
/****** :  View [dbo].[v_Shop2Area]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_Shop2Area]
AS
SELECT     ShopArea.RestID AS RestId, ShopArea.areaID AS AreaId, Area.name AS AreaName, Area.provinceID AS ProvinceId, Area.cityID AS CityId, 
                      Area.regionID AS RegionId, Area.zoneID AS ZoneId
FROM         dbo.tbl_shop2Area AS ShopArea INNER JOIN
                      dbo.tbl_area AS Area ON Area.id = ShopArea.areaID
WHERE     (Area.isDelete = 0)

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "ShopArea"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 106
               Right = 169
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Area"
            Begin Extent = 
               Top = 6
               Left = 207
               Bottom = 121
               Right = 340
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_Shop2Area'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 1 ,N'user', N'dbo', N'VIEW', N'v_Shop2Area'

GO
/****** :  View [dbo].[v_shopComments]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_shopComments]
AS
SELECT     TOP 100 PERCENT dbo.tbl_ShopComments.id, dbo.tbl_ShopComments.title, dbo.tbl_ShopComments.shopID, dbo.tbl_ShopComments.KPoint, 
                      dbo.tbl_ShopComments.HPoint, dbo.tbl_ShopComments.SPoint, dbo.tbl_ShopComments.FPoint, dbo.tbl_ShopComments.FMenu, 
                      dbo.tbl_ShopComments.personAvg, dbo.tbl_ShopComments.classLabel, dbo.tbl_ShopComments.carStation, dbo.tbl_ShopComments.[content], 
                      dbo.tbl_ShopComments.reply, dbo.tbl_ShopComments.userID, dbo.tbl_ShopComments.postTime, dbo.tbl_ShopComments.IP, 
                      dbo.tbl_ShopComments.isDelete, dbo.tbl_ShopComments.Auditing, dbo.tbl_user.Name AS userName, dbo.tbl_user.email, dbo.tbl_user.nickName, 
                      dbo.tbl_user.sex, dbo.tbl_restaurant.name AS RestName, dbo.tbl_ShopComments.replySource, dbo.tbl_ShopComments.replyUserId, 
                      dbo.tbl_ShopComments.replyTime
FROM         dbo.tbl_ShopComments LEFT OUTER JOIN
                      dbo.tbl_user ON dbo.tbl_ShopComments.userID = dbo.tbl_user.id LEFT OUTER JOIN
                      dbo.tbl_restaurant ON dbo.tbl_restaurant.id = dbo.tbl_ShopComments.shopID
WHERE     (dbo.tbl_ShopComments.isDelete = 0)
ORDER BY dbo.tbl_ShopComments.postTime DESC

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[15] 4[31] 2[46] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tbl_ShopComments"
            Begin Extent = 
               Top = 60
               Left = 25
               Bottom = 169
               Right = 240
            End
            DisplayFlags = 280
            TopColumn = 11
         End
         Begin Table = "tbl_user"
            Begin Extent = 
               Top = 67
               Left = 338
               Bottom = 178
               Right = 571
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tbl_restaurant"
            Begin Extent = 
               Top = 174
               Left = 38
               Bottom = 289
               Right = 185
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 2085
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_shopComments'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 1 ,N'user', N'dbo', N'VIEW', N'v_shopComments'

GO
/****** :  View [dbo].[v_SuiteMenuContent]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_SuiteMenuContent]
AS
SELECT     TOP 100 PERCENT dbo.tbl_suiteMenuContent.id, dbo.tbl_suiteMenuContent.restID, dbo.tbl_suiteMenuContent.configID, 
                      dbo.tbl_suiteMenuContent.elementID, dbo.tbl_suiteMenuContent.classID, dbo.tbl_suiteMenuElement.name AS elementName, 
                      dbo.tbl_suiteMenuElement.classID AS elementClassID
FROM         dbo.tbl_suiteMenuContent LEFT OUTER JOIN
                      dbo.tbl_suiteMenuElement ON dbo.tbl_suiteMenuContent.elementID = dbo.tbl_suiteMenuElement.id
WHERE     (dbo.tbl_suiteMenuElement.isDelete = 0)
ORDER BY dbo.tbl_suiteMenuContent.id

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1[38] 4[30] 3) )"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tbl_suiteMenuContent"
            Begin Extent = 
               Top = 38
               Left = 33
               Bottom = 227
               Right = 245
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tbl_suiteMenuElement"
            Begin Extent = 
               Top = 78
               Left = 419
               Bottom = 268
               Right = 659
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 2040
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_SuiteMenuContent'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 1 ,N'user', N'dbo', N'VIEW', N'v_SuiteMenuContent'

GO
/****** :  View [dbo].[v_userAddress]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_userAddress]
AS
SELECT     Data.id, Data.userID, Data.ContactPerson, Data.ContactPhone, Data.ContactMobile, Data.PostTime, Data.addressClass, Data.address, Data.note, 
                      Data.regionID, Data.zoneID, Data.areaID, ISNULL(Province.name, '') AS ProvinceName, ISNULL(City.name, '') AS CityName, ISNULL(Region.name, '') 
                      AS RegionName, ISNULL(Zone.name, '') AS ZoneName, ISNULL(Area.name, '') AS AreaName, ISNULL(Province.id, 0) AS ProvinceId, ISNULL(City.id, 0) 
                      AS CityId, ISNULL(Map.mapX, 0) AS MapX, ISNULL(Map.mapY, 0) AS MapY, ISNULL(Region.name, '') + ' ' + ISNULL(Zone.name, '') 
                      + ' ' + ISNULL(Area.name, '') + ' ' + Data.address AS FullAddress
FROM         dbo.tbl_userAddress AS Data LEFT OUTER JOIN
                      dbo.tbl_region AS Region ON Data.regionID = Region.id LEFT OUTER JOIN
                      dbo.tbl_zone AS Zone ON Data.zoneID = Zone.id LEFT OUTER JOIN
                      dbo.tbl_area AS Area ON Data.areaID = Area.id LEFT OUTER JOIN
                      dbo.tbl_province AS Province ON Province.id = Region.provinceID LEFT OUTER JOIN
                      dbo.tbl_city AS City ON City.id = Region.cityID LEFT OUTER JOIN
                      dbo.tbl_areaMapInfo AS Map ON Data.areaID = Map.areaID

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1[50] 2[25] 3) )"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4[35] 2[39] 3) )"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 3
   End
   Begin DiagramPane = 
      PaneHidden = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Data"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 121
               Right = 182
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Region"
            Begin Extent = 
               Top = 6
               Left = 408
               Bottom = 121
               Right = 541
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Zone"
            Begin Extent = 
               Top = 6
               Left = 579
               Bottom = 121
               Right = 712
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Area"
            Begin Extent = 
               Top = 6
               Left = 750
               Bottom = 121
               Right = 883
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Province"
            Begin Extent = 
               Top = 126
               Left = 207
               Bottom = 211
               Right = 338
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "City"
            Begin Extent = 
               Top = 126
               Left = 376
               Bottom = 226
               Right = 509
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "Map"
            Begin Extent = 
               Top = 6
               Left = 220
               Bottom = 121
               Right = 351
            End
            DisplayFlags = 280
' ,N'user', N'dbo', N'VIEW', N'v_userAddress'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPane2', N'            TopColumn = 0
         End
      End
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 19
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 1635
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' ,N'user', N'dbo', N'VIEW', N'v_userAddress'

GO
EXEC dbo.sp_addextendedproperty N'MS_DiagramPaneCount', 2 ,N'user', N'dbo', N'VIEW', N'v_userAddress'


GO
/****** :  View [dbo].[v_userAddress]    ű: 02/01/2010 14:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create view [dbo].[v_getdate] as
select getdate() [outgetdate]







go


