Explorar o código

страница концерта, нового дня репетиий и что-т еще, на последней добавленной странице ошибки.. я уже не соображаю

Smerdova Liza hai 7 meses
pai
achega
8a9c25807f

+ 4 - 3
PDK_Concert/ConcertProgram.cs

@@ -14,9 +14,10 @@ namespace PDK_Concert
     
     public partial class ConcertProgram
     {
-        public int IDConcert { get; set; }
-        public int IDNumber { get; set; }
-        public int IndexNumber { get; set; }
+        public int IDConcertProgram { get; set; }
+        public Nullable<int> IDConcert { get; set; }
+        public Nullable<int> IDNumber { get; set; }
+        public Nullable<int> IndexNumber { get; set; }
     
         public virtual Concert Concert { get; set; }
         public virtual Numbers Numbers { get; set; }

+ 2 - 2
PDK_Concert/ModelBD.Context.cs

@@ -26,13 +26,13 @@ namespace PDK_Concert
         }
     
         public virtual DbSet<Concert> Concert { get; set; }
+        public virtual DbSet<ConcertProgram> ConcertProgram { get; set; }
         public virtual DbSet<Logined> Logined { get; set; }
         public virtual DbSet<Numbers> Numbers { get; set; }
         public virtual DbSet<Post> Post { get; set; }
         public virtual DbSet<Power> Power { get; set; }
         public virtual DbSet<RehearsalDate> RehearsalDate { get; set; }
-        public virtual DbSet<Users> Users { get; set; }
-        public virtual DbSet<ConcertProgram> ConcertProgram { get; set; }
         public virtual DbSet<RehearsalSchedule> RehearsalSchedule { get; set; }
+        public virtual DbSet<Users> Users { get; set; }
     }
 }

+ 73 - 91
PDK_Concert/ModelBD.edmx

@@ -14,17 +14,14 @@
           <Property Name="Titlee" Type="nvarchar(max)" Nullable="false" />
           <Property Name="NumderOfRooms" Type="int" Nullable="false" />
         </EntityType>
-        <!--Ошибки, обнаруженные при создании:
-предупреждение 6002: В таблице или представлении "sm_RDK.dbo.ConcertProgram" не определен первичный ключ. Ключ был выведен, а определение таблицы или представления было создано в режиме только для чтения.-->
         <EntityType Name="ConcertProgram">
           <Key>
-            <PropertyRef Name="IDConcert" />
-            <PropertyRef Name="IDNumber" />
-            <PropertyRef Name="IndexNumber" />
+            <PropertyRef Name="IDConcertProgram" />
           </Key>
-          <Property Name="IDConcert" Type="int" Nullable="false" />
-          <Property Name="IDNumber" Type="int" Nullable="false" />
-          <Property Name="IndexNumber" Type="int" Nullable="false" />
+          <Property Name="IDConcertProgram" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="IDConcert" Type="int" />
+          <Property Name="IDNumber" Type="int" />
+          <Property Name="IndexNumber" Type="int" />
         </EntityType>
         <EntityType Name="Logined">
           <Key>
@@ -64,14 +61,11 @@
           <Property Name="IDData" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
           <Property Name="RehearsalDate" Type="date" Nullable="false" />
         </EntityType>
-        <!--Ошибки, обнаруженные при создании:
-предупреждение 6002: В таблице или представлении "sm_RDK.dbo.RehearsalSchedule" не определен первичный ключ. Ключ был выведен, а определение таблицы или представления было создано в режиме только для чтения.-->
         <EntityType Name="RehearsalSchedule">
           <Key>
-            <PropertyRef Name="IDSchedule" />
-            <PropertyRef Name="IDUser" />
-            <PropertyRef Name="RehearsalTime" />
+            <PropertyRef Name="ID" />
           </Key>
+          <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
           <Property Name="IDSchedule" Type="int" Nullable="false" />
           <Property Name="IDUser" Type="int" Nullable="false" />
           <Property Name="RehearsalTime" Type="nvarchar" MaxLength="5" Nullable="false" />
@@ -89,7 +83,7 @@
           <Property Name="IDPost" Type="int" Nullable="false" />
         </EntityType>
         <Association Name="FK_ConcertProgram_Concert">
-          <End Role="Concert" Type="Self.Concert" Multiplicity="1" />
+          <End Role="Concert" Type="Self.Concert" Multiplicity="0..1" />
           <End Role="ConcertProgram" Type="Self.ConcertProgram" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="Concert">
@@ -101,7 +95,7 @@
           </ReferentialConstraint>
         </Association>
         <Association Name="FK_ConcertProgram_Numbers">
-          <End Role="Numbers" Type="Self.Numbers" Multiplicity="1" />
+          <End Role="Numbers" Type="Self.Numbers" Multiplicity="0..1" />
           <End Role="ConcertProgram" Type="Self.ConcertProgram" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="Numbers">
@@ -186,26 +180,14 @@
         </Association>
         <EntityContainer Name="Хранилище sm_RDKModelContainer">
           <EntitySet Name="Concert" EntityType="Self.Concert" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="ConcertProgram" EntityType="Self.ConcertProgram" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Logined" EntityType="Self.Logined" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Numbers" EntityType="Self.Numbers" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Post" EntityType="Self.Post" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Power" EntityType="Self.Power" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="RehearsalDate" EntityType="Self.RehearsalDate" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="RehearsalSchedule" EntityType="Self.RehearsalSchedule" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Users" EntityType="Self.Users" Schema="dbo" store:Type="Tables" />
-          <EntitySet Name="ConcertProgram" EntityType="Self.ConcertProgram" store:Type="Tables" store:Schema="dbo">
-            <DefiningQuery>SELECT 
-    [ConcertProgram].[IDConcert] AS [IDConcert], 
-    [ConcertProgram].[IDNumber] AS [IDNumber], 
-    [ConcertProgram].[IndexNumber] AS [IndexNumber]
-    FROM [dbo].[ConcertProgram] AS [ConcertProgram]</DefiningQuery>
-          </EntitySet>
-          <EntitySet Name="RehearsalSchedule" EntityType="Self.RehearsalSchedule" store:Type="Tables" store:Schema="dbo">
-            <DefiningQuery>SELECT 
-    [RehearsalSchedule].[IDSchedule] AS [IDSchedule], 
-    [RehearsalSchedule].[IDUser] AS [IDUser], 
-    [RehearsalSchedule].[RehearsalTime] AS [RehearsalTime]
-    FROM [dbo].[RehearsalSchedule] AS [RehearsalSchedule]</DefiningQuery>
-          </EntitySet>
           <AssociationSet Name="FK_ConcertProgram_Concert" Association="Self.FK_ConcertProgram_Concert">
             <End Role="Concert" EntitySet="Concert" />
             <End Role="ConcertProgram" EntitySet="ConcertProgram" />
@@ -245,26 +227,26 @@
       <Schema Namespace="sm_RDKModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
         <EntityContainer Name="sm_RDKEntities" annotation:LazyLoadingEnabled="true">
           <EntitySet Name="Concert" EntityType="sm_RDKModel.Concert" />
+          <EntitySet Name="ConcertProgram" EntityType="sm_RDKModel.ConcertProgram" />
           <EntitySet Name="Logined" EntityType="sm_RDKModel.Logined" />
           <EntitySet Name="Numbers" EntityType="sm_RDKModel.Numbers" />
           <EntitySet Name="Post" EntityType="sm_RDKModel.Post" />
           <EntitySet Name="Power" EntityType="sm_RDKModel.Power" />
           <EntitySet Name="RehearsalDate" EntityType="sm_RDKModel.RehearsalDate" />
-          <EntitySet Name="Users" EntityType="sm_RDKModel.Users" />
-          <EntitySet Name="ConcertProgram" EntityType="sm_RDKModel.ConcertProgram" />
           <EntitySet Name="RehearsalSchedule" EntityType="sm_RDKModel.RehearsalSchedule" />
+          <EntitySet Name="Users" EntityType="sm_RDKModel.Users" />
           <AssociationSet Name="FK_ConcertProgram_Concert" Association="sm_RDKModel.FK_ConcertProgram_Concert">
             <End Role="Concert" EntitySet="Concert" />
             <End Role="ConcertProgram" EntitySet="ConcertProgram" />
           </AssociationSet>
-          <AssociationSet Name="FK_Users_Logined" Association="sm_RDKModel.FK_Users_Logined">
-            <End Role="Logined" EntitySet="Logined" />
-            <End Role="Users" EntitySet="Users" />
-          </AssociationSet>
           <AssociationSet Name="FK_ConcertProgram_Numbers" Association="sm_RDKModel.FK_ConcertProgram_Numbers">
             <End Role="Numbers" EntitySet="Numbers" />
             <End Role="ConcertProgram" EntitySet="ConcertProgram" />
           </AssociationSet>
+          <AssociationSet Name="FK_Users_Logined" Association="sm_RDKModel.FK_Users_Logined">
+            <End Role="Logined" EntitySet="Logined" />
+            <End Role="Users" EntitySet="Users" />
+          </AssociationSet>
           <AssociationSet Name="FK_Numbers_Users" Association="sm_RDKModel.FK_Numbers_Users">
             <End Role="Users" EntitySet="Users" />
             <End Role="Numbers" EntitySet="Numbers" />
@@ -296,6 +278,17 @@
           <Property Name="NumderOfRooms" Type="Int32" Nullable="false" />
           <NavigationProperty Name="ConcertProgram" Relationship="sm_RDKModel.FK_ConcertProgram_Concert" FromRole="Concert" ToRole="ConcertProgram" />
         </EntityType>
+        <EntityType Name="ConcertProgram">
+          <Key>
+            <PropertyRef Name="IDConcertProgram" />
+          </Key>
+          <Property Name="IDConcertProgram" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="IDConcert" Type="Int32" />
+          <Property Name="IDNumber" Type="Int32" />
+          <Property Name="IndexNumber" Type="Int32" />
+          <NavigationProperty Name="Concert" Relationship="sm_RDKModel.FK_ConcertProgram_Concert" FromRole="ConcertProgram" ToRole="Concert" />
+          <NavigationProperty Name="Numbers" Relationship="sm_RDKModel.FK_ConcertProgram_Numbers" FromRole="ConcertProgram" ToRole="Numbers" />
+        </EntityType>
         <EntityType Name="Logined">
           <Key>
             <PropertyRef Name="ID" />
@@ -340,6 +333,17 @@
           <Property Name="RehearsalDate1" Type="DateTime" Nullable="false" Precision="0" />
           <NavigationProperty Name="RehearsalSchedule" Relationship="sm_RDKModel.FK_RehearsalSchedule_RehearsalDate" FromRole="RehearsalDate" ToRole="RehearsalSchedule" />
         </EntityType>
+        <EntityType Name="RehearsalSchedule">
+          <Key>
+            <PropertyRef Name="ID" />
+          </Key>
+          <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="IDSchedule" Type="Int32" Nullable="false" />
+          <Property Name="IDUser" Type="Int32" Nullable="false" />
+          <Property Name="RehearsalTime" Type="String" Nullable="false" MaxLength="5" FixedLength="false" Unicode="true" />
+          <NavigationProperty Name="RehearsalDate" Relationship="sm_RDKModel.FK_RehearsalSchedule_RehearsalDate" FromRole="RehearsalSchedule" ToRole="RehearsalDate" />
+          <NavigationProperty Name="Users" Relationship="sm_RDKModel.FK_RehearsalSchedule_Users" FromRole="RehearsalSchedule" ToRole="Users" />
+        </EntityType>
         <EntityType Name="Users">
           <Key>
             <PropertyRef Name="IDUser" />
@@ -357,32 +361,8 @@
           <NavigationProperty Name="Power" Relationship="sm_RDKModel.FK_Users_Power" FromRole="Users" ToRole="Power" />
           <NavigationProperty Name="RehearsalSchedule" Relationship="sm_RDKModel.FK_RehearsalSchedule_Users" FromRole="Users" ToRole="RehearsalSchedule" />
         </EntityType>
-        <EntityType Name="ConcertProgram">
-          <Key>
-            <PropertyRef Name="IDConcert" />
-            <PropertyRef Name="IDNumber" />
-            <PropertyRef Name="IndexNumber" />
-          </Key>
-          <Property Name="IDConcert" Type="Int32" Nullable="false" />
-          <Property Name="IDNumber" Type="Int32" Nullable="false" />
-          <Property Name="IndexNumber" Type="Int32" Nullable="false" />
-          <NavigationProperty Name="Concert" Relationship="sm_RDKModel.FK_ConcertProgram_Concert" FromRole="ConcertProgram" ToRole="Concert" />
-          <NavigationProperty Name="Numbers" Relationship="sm_RDKModel.FK_ConcertProgram_Numbers" FromRole="ConcertProgram" ToRole="Numbers" />
-        </EntityType>
-        <EntityType Name="RehearsalSchedule">
-          <Key>
-            <PropertyRef Name="IDSchedule" />
-            <PropertyRef Name="IDUser" />
-            <PropertyRef Name="RehearsalTime" />
-          </Key>
-          <Property Name="IDSchedule" Type="Int32" Nullable="false" />
-          <Property Name="IDUser" Type="Int32" Nullable="false" />
-          <Property Name="RehearsalTime" Type="String" Nullable="false" MaxLength="5" FixedLength="false" Unicode="true" />
-          <NavigationProperty Name="RehearsalDate" Relationship="sm_RDKModel.FK_RehearsalSchedule_RehearsalDate" FromRole="RehearsalSchedule" ToRole="RehearsalDate" />
-          <NavigationProperty Name="Users" Relationship="sm_RDKModel.FK_RehearsalSchedule_Users" FromRole="RehearsalSchedule" ToRole="Users" />
-        </EntityType>
         <Association Name="FK_ConcertProgram_Concert">
-          <End Type="sm_RDKModel.Concert" Role="Concert" Multiplicity="1" />
+          <End Type="sm_RDKModel.Concert" Role="Concert" Multiplicity="0..1" />
           <End Type="sm_RDKModel.ConcertProgram" Role="ConcertProgram" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="Concert">
@@ -393,6 +373,18 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_ConcertProgram_Numbers">
+          <End Type="sm_RDKModel.Numbers" Role="Numbers" Multiplicity="0..1" />
+          <End Type="sm_RDKModel.ConcertProgram" Role="ConcertProgram" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Numbers">
+              <PropertyRef Name="IDNumber" />
+            </Principal>
+            <Dependent Role="ConcertProgram">
+              <PropertyRef Name="IDNumber" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <Association Name="FK_Users_Logined">
           <End Type="sm_RDKModel.Logined" Role="Logined" Multiplicity="1" />
           <End Type="sm_RDKModel.Users" Role="Users" Multiplicity="0..1" />
@@ -405,18 +397,6 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <Association Name="FK_ConcertProgram_Numbers">
-          <End Type="sm_RDKModel.Numbers" Role="Numbers" Multiplicity="1" />
-          <End Type="sm_RDKModel.ConcertProgram" Role="ConcertProgram" Multiplicity="*" />
-          <ReferentialConstraint>
-            <Principal Role="Numbers">
-              <PropertyRef Name="IDNumber" />
-            </Principal>
-            <Dependent Role="ConcertProgram">
-              <PropertyRef Name="IDNumber" />
-            </Dependent>
-          </ReferentialConstraint>
-        </Association>
         <Association Name="FK_Numbers_Users">
           <End Type="sm_RDKModel.Users" Role="Users" Multiplicity="1" />
           <End Type="sm_RDKModel.Numbers" Role="Numbers" Multiplicity="*" />
@@ -477,7 +457,7 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-      </Schema>
+        </Schema>
     </edmx:ConceptualModels>
     <!-- C-S mapping content -->
     <edmx:Mappings>
@@ -493,6 +473,16 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
+          <EntitySetMapping Name="ConcertProgram">
+            <EntityTypeMapping TypeName="sm_RDKModel.ConcertProgram">
+              <MappingFragment StoreEntitySet="ConcertProgram">
+                <ScalarProperty Name="IndexNumber" ColumnName="IndexNumber" />
+                <ScalarProperty Name="IDNumber" ColumnName="IDNumber" />
+                <ScalarProperty Name="IDConcert" ColumnName="IDConcert" />
+                <ScalarProperty Name="IDConcertProgram" ColumnName="IDConcertProgram" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
           <EntitySetMapping Name="Logined">
             <EntityTypeMapping TypeName="sm_RDKModel.Logined">
               <MappingFragment StoreEntitySet="Logined">
@@ -536,6 +526,16 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
+          <EntitySetMapping Name="RehearsalSchedule">
+            <EntityTypeMapping TypeName="sm_RDKModel.RehearsalSchedule">
+              <MappingFragment StoreEntitySet="RehearsalSchedule">
+                <ScalarProperty Name="RehearsalTime" ColumnName="RehearsalTime" />
+                <ScalarProperty Name="IDUser" ColumnName="IDUser" />
+                <ScalarProperty Name="IDSchedule" ColumnName="IDSchedule" />
+                <ScalarProperty Name="ID" ColumnName="ID" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
           <EntitySetMapping Name="Users">
             <EntityTypeMapping TypeName="sm_RDKModel.Users">
               <MappingFragment StoreEntitySet="Users">
@@ -549,24 +549,6 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="ConcertProgram">
-            <EntityTypeMapping TypeName="sm_RDKModel.ConcertProgram">
-              <MappingFragment StoreEntitySet="ConcertProgram">
-                <ScalarProperty Name="IndexNumber" ColumnName="IndexNumber" />
-                <ScalarProperty Name="IDNumber" ColumnName="IDNumber" />
-                <ScalarProperty Name="IDConcert" ColumnName="IDConcert" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="RehearsalSchedule">
-            <EntityTypeMapping TypeName="sm_RDKModel.RehearsalSchedule">
-              <MappingFragment StoreEntitySet="RehearsalSchedule">
-                <ScalarProperty Name="RehearsalTime" ColumnName="RehearsalTime" />
-                <ScalarProperty Name="IDUser" ColumnName="IDUser" />
-                <ScalarProperty Name="IDSchedule" ColumnName="IDSchedule" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
         </EntityContainerMapping>
       </Mapping>
     </edmx:Mappings>

+ 9 - 9
PDK_Concert/ModelBD.edmx.diagram

@@ -5,18 +5,18 @@
     <!-- Diagram content (shape and connector positions) -->
     <edmx:Diagrams>
       <Diagram DiagramId="7cff3210b2dc40c680f2c4fd473a00ee" Name="Diagram1">
-        <EntityTypeShape EntityType="sm_RDKModel.Concert" Width="1.5" PointX="5.25" PointY="9.5" />
-        <EntityTypeShape EntityType="sm_RDKModel.Logined" Width="1.5" PointX="0.75" PointY="0.75" />
-        <EntityTypeShape EntityType="sm_RDKModel.Numbers" Width="1.5" PointX="5.25" PointY="6.5" />
-        <EntityTypeShape EntityType="sm_RDKModel.Post" Width="1.5" PointX="0.75" PointY="7.25" />
-        <EntityTypeShape EntityType="sm_RDKModel.Power" Width="1.5" PointX="0.75" PointY="4" />
-        <EntityTypeShape EntityType="sm_RDKModel.RehearsalDate" Width="1.5" PointX="3" PointY="8" />
-        <EntityTypeShape EntityType="sm_RDKModel.Users" Width="1.5" PointX="3" PointY="3.125" />
+        <EntityTypeShape EntityType="sm_RDKModel.Concert" Width="1.5" PointX="5.25" PointY="9.625" />
         <EntityTypeShape EntityType="sm_RDKModel.ConcertProgram" Width="1.5" PointX="7.5" PointY="6.5" />
-        <EntityTypeShape EntityType="sm_RDKModel.RehearsalSchedule" Width="1.5" PointX="5.25" PointY="2.875" />
+        <EntityTypeShape EntityType="sm_RDKModel.Logined" Width="1.5" PointX="0.75" PointY="3.875" />
+        <EntityTypeShape EntityType="sm_RDKModel.Numbers" Width="1.5" PointX="5.25" PointY="6.5" />
+        <EntityTypeShape EntityType="sm_RDKModel.Post" Width="1.5" PointX="0.75" PointY="7.125" />
+        <EntityTypeShape EntityType="sm_RDKModel.Power" Width="1.5" PointX="0.75" PointY="0.75" />
+        <EntityTypeShape EntityType="sm_RDKModel.RehearsalDate" Width="1.5" PointX="3" PointY="8.875" />
+        <EntityTypeShape EntityType="sm_RDKModel.RehearsalSchedule" Width="1.5" PointX="5.25" PointY="3.625" />
+        <EntityTypeShape EntityType="sm_RDKModel.Users" Width="1.5" PointX="3" PointY="3" />
         <AssociationConnector Association="sm_RDKModel.FK_ConcertProgram_Concert" />
-        <AssociationConnector Association="sm_RDKModel.FK_Users_Logined" />
         <AssociationConnector Association="sm_RDKModel.FK_ConcertProgram_Numbers" />
+        <AssociationConnector Association="sm_RDKModel.FK_Users_Logined" />
         <AssociationConnector Association="sm_RDKModel.FK_Numbers_Users" />
         <AssociationConnector Association="sm_RDKModel.FK_Users_Post" />
         <AssociationConnector Association="sm_RDKModel.FK_Users_Power" />

+ 1 - 1
PDK_Concert/Pages/ConcertPage.xaml.cs

@@ -38,7 +38,7 @@ namespace PDK_Concert.Pages
         private void listConcent_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
             Concert concertProgram = listConcent.SelectedItem as Concert;
-            Classes.FrameClass.menuFrame.Navigate(new ConcertProgramPage(concertProgram.IDConcert));
+            Classes.FrameClass.menuFrame.Navigate(new ConcertProgramPage(concertProgram.IDConcert, logined));
         }
 
         private void btConcert_Click(object sender, RoutedEventArgs e)

+ 20 - 4
PDK_Concert/Pages/ConcertProgramPage.xaml

@@ -9,15 +9,23 @@
       Title="ConcertProgramPage">
 
     <Grid>
-        <StackPanel>
-            <TextBlock Text="{Binding Titlee}" Style="{StaticResource Title}" HorizontalAlignment="Center" FontWeight="Bold"/>
-            <ListView Name="listNumber">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="60"/>
+            <RowDefinition Height="*"/>
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"/>
+            <ColumnDefinition Width="*"/>
+        </Grid.ColumnDefinitions>
+        <TextBlock Text="{Binding Titlee}" Style="{StaticResource Title}" HorizontalAlignment="Center" FontWeight="Bold"/>
+        <StackPanel Grid.Row="1">
+            <ListView Name="listNumber" FontSize="20">
                 <ListView.View>
                     <GridView>
                         <GridViewColumn Header="Номер">
                             <GridViewColumn.CellTemplate>
                                 <DataTemplate>
-                                    <TextBox Foreground="Black" FontSize="20" Text="{Binding IndexNumber}"/>
+                                    <TextBox TextChanged="TextBox_TextChanged" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black" FontSize="20" Text="{Binding IndexNumber}"/>
                                 </DataTemplate>
                             </GridViewColumn.CellTemplate>
                         </GridViewColumn>
@@ -33,5 +41,13 @@
             </ListView>
             <TextBlock Text="Концертной прораммы нет" Style="{StaticResource Title}" Name="not" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
         </StackPanel>
+        <StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical">
+            <TextBlock Style="{StaticResource Title}" Text="Добавить свой номер" Margin="0 0 0 50" HorizontalAlignment="Center"/>
+            <GroupBox Width="300" Header="Название номера">
+                <ComboBox Width="300" FontSize="20" Name="numberTitle"/>
+            </GroupBox>
+            <Button Content="Добавить"  Name="addNumder" Click="addNumder_Click"/>
+            <Button Content="Назад" Name="back" Click="back_Click"/>
+        </StackPanel>
     </Grid>
 </Page>

+ 52 - 3
PDK_Concert/Pages/ConcertProgramPage.xaml.cs

@@ -22,18 +22,67 @@ namespace PDK_Concert.Pages
     {
         List<ConcertProgram> concertProgramList;
         Concert program;
-        public ConcertProgramPage(int IDConcert)
+        Numbers numbers;
+        Logined logined;
+        int ID;
+        int index = 1;
+        public ConcertProgramPage(int IDConcert, Logined logined)
         {
             InitializeComponent();
-            concertProgramList = Classes.DataBaseClass.connect.ConcertProgram.Where(x=> x.IDConcert == IDConcert).ToList();
+            this.ID = IDConcert;
+            numberTitle.ItemsSource = Classes.DataBaseClass.connect.Numbers.Where(x => x.IDUser == logined.ID).ToList();
+            numberTitle.DisplayMemberPath = "Title";
+            concertProgramList = Classes.DataBaseClass.connect.ConcertProgram.Where(x => x.IDConcert == IDConcert).OrderBy(x=> x.IndexNumber).ToList();
             listNumber.ItemsSource = concertProgramList;
-            program = Classes.DataBaseClass.connect.Concert.FirstOrDefault(x=> x.IDConcert==IDConcert);
+            program = Classes.DataBaseClass.connect.Concert.FirstOrDefault(x => x.IDConcert == IDConcert);
             DataContext = program;
             if (concertProgramList.Count == 0)
             {
                 not.Visibility = Visibility.Visible;
                 listNumber.Visibility = Visibility.Collapsed;
             }
+
+            this.logined = logined;
+        }
+
+        private void addNumder_Click(object sender, RoutedEventArgs e)
+        {
+            /*while (index== )
+            {
+                index++;
+            }*/
+            numbers = Classes.DataBaseClass.connect.Numbers.FirstOrDefault(x => x.Title == numberTitle.Text);
+            if (numberTitle.SelectedIndex != -1)
+            {
+                ConcertProgram concertProgram = new ConcertProgram()
+                {
+                    IDConcert = ID,
+                    IDNumber = numbers.IDNumber,
+                    IndexNumber = index
+                };
+                Classes.DataBaseClass.connect.ConcertProgram.Add(concertProgram);
+                Classes.DataBaseClass.connect.SaveChanges();
+                listNumber.ItemsSource = Classes.DataBaseClass.connect.ConcertProgram.Where(x => x.IDConcert == ID).OrderBy(x => x.IndexNumber).ToList();
+                numberTitle.SelectedIndex = -1;
+            }
+            else
+            {
+                MessageBox.Show("Вы не выбрали номер","Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
+            }
+            
+        }
+
+        private void back_Click(object sender, RoutedEventArgs e)
+        {
+            Classes.FrameClass.menuFrame.Navigate(new CocertPage(logined));
+        }
+
+        private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            ConcertProgram programID = listNumber.SelectedItem as ConcertProgram;
+            //programID.IndexNumber = num;
+            Classes.DataBaseClass.connect.SaveChanges();
+            //listNumber.ItemsSource = Classes.DataBaseClass.connect.ConcertProgram.Where(x => x.IDConcert == ID).OrderBy(x => x.IndexNumber).ToList();
         }
     }
 }

+ 26 - 0
PDK_Concert/Pages/NewDayPehearsalPage.xaml

@@ -0,0 +1,26 @@
+<Page x:Class="PDK_Concert.Pages.NewDayPehearsalPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:PDK_Concert.Pages"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="NewDayPehearsalPage">
+
+    <Grid>
+        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
+            <TextBlock Text="Новый день для репетии" Style="{StaticResource Title}" HorizontalAlignment="Center"/>
+            <GroupBox Header="Дата">
+                <DatePicker Name="date" FontSize="20"/>
+            </GroupBox>
+            <GroupBox Header="Время вашей репетиции">
+                <TextBox Name="time"/>
+            </GroupBox>
+            <StackPanel Orientation="Horizontal">
+            <Button Content="Добавить" Name="addRehearsal" Click="addRehearsal_Click"/>
+                <Button Content="Отмена" Name="back" Click="back_Click"/>
+            </StackPanel>
+        </StackPanel>
+    </Grid>
+</Page>

+ 62 - 0
PDK_Concert/Pages/NewDayPehearsalPage.xaml.cs

@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDK_Concert.Pages
+{
+    /// <summary>
+    /// Логика взаимодействия для NewDayPehearsalPage.xaml
+    /// </summary>
+    public partial class NewDayPehearsalPage : Page
+    {
+        Logined logined;
+        public NewDayPehearsalPage(Logined logined)
+        {
+            InitializeComponent();
+            this.logined = logined;
+        }
+
+        private void addRehearsal_Click(object sender, RoutedEventArgs e)
+        {
+            if (date.DisplayDate >= DateTime.Today)
+            {
+                //сделать проверу на имеющийся элемент
+                RehearsalDate rehearsalDate = new RehearsalDate()
+                {
+                    RehearsalDate1 = date.DisplayDate
+                };
+                Classes.DataBaseClass.connect.RehearsalDate.Add(rehearsalDate);
+                RehearsalSchedule rehearsalSchedule = new RehearsalSchedule()
+                {
+                    IDSchedule = rehearsalDate.IDData,
+                    IDUser = logined.ID,
+                    RehearsalTime = time.Text
+                };
+                Classes.DataBaseClass.connect.RehearsalSchedule.Add(rehearsalSchedule);
+                Classes.DataBaseClass.connect.SaveChanges();
+                MessageBox.Show("Репетиция успешно добавлена", "Информация", MessageBoxButton.OK, MessageBoxImage.Information);
+                Classes.FrameClass.menuFrame.Navigate(new RehearsalSchedulePage(logined));
+            }
+            else
+            {
+                MessageBox.Show("Вы выбрали дату позднее текущей","Ошибка",MessageBoxButton.OK, MessageBoxImage.Error);
+            }
+        }
+
+        private void back_Click(object sender, RoutedEventArgs e)
+        {
+            Classes.FrameClass.menuFrame.Navigate(new RehearsalSchedulePage(logined));
+        }
+    }
+}

+ 53 - 0
PDK_Concert/Pages/RehearsalPage.xaml

@@ -0,0 +1,53 @@
+<Page x:Class="PDK_Concert.Pages.RehearsalPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:PDK_Concert.Pages"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="RehearsalPage">
+
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="60"/>
+            <RowDefinition Height="*"/>
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"/>
+            <ColumnDefinition Width="*"/>
+        </Grid.ColumnDefinitions>
+        <TextBlock Text="{Binding RehearsalDate1, StringFormat={}dd.MM.yyyy}" Style="{StaticResource Title}" HorizontalAlignment="Center" FontWeight="Bold"/>
+        <StackPanel Grid.Row="1">
+            <ListView Name="listRehearsal" FontSize="20">
+                <ListView.View>
+                    <GridView>
+                        <GridViewColumn Header="Время">
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBox TextChanged="TextBox_TextChanged" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black" FontSize="20" Text="{Binding RehearsalTime}"/>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+                        <GridViewColumn Header="Кто">
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Style="{StaticResource List}" Text="{Binding Numbers.Title}"/>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+                    </GridView>
+                </ListView.View>
+            </ListView>
+            <TextBlock Text="Репетиций в этот день нет" Style="{StaticResource Title}" Name="not" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
+        </StackPanel>
+        <StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical">
+            <TextBlock Style="{StaticResource Title}" Text="Добавить свой номер" Margin="0 0 0 50" HorizontalAlignment="Center"/>
+            <GroupBox Width="300" Header="Название номера">
+                <ComboBox Width="300" FontSize="20" Name="numberTitle"/>
+            </GroupBox>
+            <Button Content="Добавить"  Name="addNumder" Click="addNumder_Click"/>
+            <Button Content="Назад" Name="back" Click="back_Click"/>
+        </StackPanel>
+    </Grid>
+</Page>

+ 33 - 0
PDK_Concert/Pages/RehearsalPage.xaml.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDK_Concert.Pages
+{
+    /// <summary>
+    /// Логика взаимодействия для RehearsalPage.xaml
+    /// </summary>
+    public partial class RehearsalPage : Page
+    {
+        public RehearsalPage()
+        {
+            InitializeComponent();
+            if (concertProgramList.Count == 0)
+            {
+                not.Visibility = Visibility.Visible;
+                listRehearsal.Visibility = Visibility.Collapsed;
+            }
+        }
+    }
+}

+ 1 - 1
PDK_Concert/Pages/RehearsalSchedulePage.xaml

@@ -19,7 +19,7 @@
             <ListView.ItemTemplate>
                 <DataTemplate>
                     <StackPanel>
-                        <TextBlock Text="{Binding RehearsalDate, StringFormat={}dd.MM.yyyy}" Style="{StaticResource List}"/>
+                        <TextBlock Text="{Binding RehearsalDate1, StringFormat={}dd.MM.yyyy}" Style="{StaticResource List}"/>
                     </StackPanel>
                 </DataTemplate>
             </ListView.ItemTemplate>

+ 3 - 2
PDK_Concert/Pages/RehearsalSchedulePage.xaml.cs

@@ -26,7 +26,7 @@ namespace PDK_Concert.Pages
         {
             InitializeComponent();
             this.logined = logined;
-            listRehearsal.ItemsSource = Classes.DataBaseClass.connect.RehearsalDate.ToList();
+            listRehearsal.ItemsSource = Classes.DataBaseClass.connect.RehearsalDate.Where(x => x.RehearsalDate1 >= DateTime.Today).OrderBy(x=> x.RehearsalDate1).ToList();
             schedules = Classes.DataBaseClass.connect.RehearsalDate.ToList();
             if (schedules.Count==0)
             {
@@ -37,11 +37,12 @@ namespace PDK_Concert.Pages
 
         private void btNewDay_Click(object sender, RoutedEventArgs e)
         {
-
+            Classes.FrameClass.menuFrame.Navigate(new NewDayPehearsalPage(logined));
         }
 
         private void listRehearsal_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
+            RehearsalDate rehearsalDate = listRehearsal.SelectedItem as RehearsalDate;
 
         }
     }

+ 14 - 0
PDK_Concert/RDK_Concert.csproj

@@ -88,6 +88,9 @@
     <Compile Include="Pages\ConcertProgramPage.xaml.cs">
       <DependentUpon>ConcertProgramPage.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Pages\NewDayPehearsalPage.xaml.cs">
+      <DependentUpon>NewDayPehearsalPage.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Pages\NewNumberPage.xaml.cs">
       <DependentUpon>NewNumberPage.xaml</DependentUpon>
     </Compile>
@@ -97,6 +100,9 @@
     <Compile Include="Pages\ProfilePage.xaml.cs">
       <DependentUpon>ProfilePage.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Pages\RehearsalPage.xaml.cs">
+      <DependentUpon>RehearsalPage.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Pages\RehearsalSchedulePage.xaml.cs">
       <DependentUpon>RehearsalSchedulePage.xaml</DependentUpon>
     </Compile>
@@ -151,6 +157,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Pages\NewDayPehearsalPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Pages\NewNumberPage.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -163,6 +173,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Pages\RehearsalPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Pages\RehearsalSchedulePage.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 1 - 0
PDK_Concert/RehearsalSchedule.cs

@@ -14,6 +14,7 @@ namespace PDK_Concert
     
     public partial class RehearsalSchedule
     {
+        public int ID { get; set; }
         public int IDSchedule { get; set; }
         public int IDUser { get; set; }
         public string RehearsalTime { get; set; }