Imagara 3 éve
szülő
commit
c294432620

+ 1 - 1
PartsWarehouse/App.config

@@ -14,6 +14,6 @@
     </providers>
   </entityFramework>
 <connectionStrings>
-<add name="EDMEntities" connectionString="metadata=res://*/EDM.csdl|res://*/EDM.ssdl|res://*/EDM.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(localdb)\MSSQLLocalDB;initial catalog=PartsWarehouseDataBase;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
+<add name="EDMEntities" connectionString="metadata=res://*/EDM.csdl|res://*/EDM.ssdl|res://*/EDM.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=mssql;initial catalog=gr692_gav;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
 </connectionStrings>
 </configuration>

+ 1 - 1
PartsWarehouse/App.xaml

@@ -2,7 +2,7 @@
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:local="clr-namespace:PartsWarehouse"
-             StartupUri="MainWindow.xaml">
+             StartupUri="LoginWindow.xaml">
     <Application.Resources>
         <ResourceDictionary Source="Styles/Style.xaml"/>
     </Application.Resources>

+ 3 - 1
PartsWarehouse/MainWindow.xaml.cs

@@ -65,8 +65,10 @@ namespace PartsWarehouse
                 {
                     Car car = cnt.db.Car.Where(item => item.IdCar == cnt.db.UserCar.Where(uc => uc.Vin == VinBox.Text).Select(uc => uc.IdCar).FirstOrDefault()).FirstOrDefault();
                     MainFrame.Content = new СatalogPage(car.Company, car.Name, car.Generation);
-                    new ErrorWindow((car.Company, car.Name, car.Generation).ToString()).ShowDialog();
+                    new ErrorWindow($"Найдено: ({car.Company}, {car.Name}, {car.Generation} поколения)").ShowDialog();
                 }
+                else if (VinBox.Text == "Vin..." || VinBox.Text.Trim() == "")
+                    new ErrorWindow("Введите Vin.").ShowDialog();
                 else
                     new ErrorWindow("Ничего не найдено.").ShowDialog();
             }

+ 1 - 3
PartsWarehouse/PartsWarehouse.csproj

@@ -191,9 +191,6 @@
     <None Include="App.config" />
   </ItemGroup>
   <ItemGroup>
-    <Resource Include="Resources\NotFound.png" />
-  </ItemGroup>
-  <ItemGroup>
     <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
   </ItemGroup>
   <ItemGroup>
@@ -207,6 +204,7 @@
       <DependentUpon>EDM.edmx</DependentUpon>
       <LastGenOutput>EDM.cs</LastGenOutput>
     </Content>
+    <Resource Include="Resources\NotFound.png" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

BIN
PartsWarehouse/Resources/NotFound.png


+ 3 - 0
UnitTestProject/App.config

@@ -10,4 +10,7 @@
       <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
     </providers>
   </entityFramework>
+	<connectionStrings>
+		<add name="EDMEntities" connectionString="metadata=res://*/EDM.csdl|res://*/EDM.ssdl|res://*/EDM.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=mssql;initial catalog=gr692_gav;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
+	</connectionStrings>
 </configuration>

+ 9 - 10
UnitTestProject/UnitTest1.cs

@@ -17,15 +17,14 @@ namespace UnitTestProject
         [TestMethod]
         public void LoginTest()
         {
-            string login = "Matrix";
-            string password = "meme3";
+            string login = "Imagara";
+            string password = "imalalka";
             Assert.IsTrue(Functions.LoginCheck(login, password));
         }
         [TestMethod]
         public void IsValidLoginAndPassword()
         {
-            Assert.IsTrue(Functions.IsValidLogAndPass("Matrix", "meme3"));
-            Assert.IsTrue(Functions.IsValidLogAndPass("Imagine", "pizza"));
+            Assert.IsTrue(Functions.IsValidLogAndPass("Imagara", "imalalka"));
             Assert.IsTrue(Functions.IsValidLogAndPass("Login???", "p@ssw0rd"));
             Assert.IsFalse(Functions.IsValidLogAndPass("", ""));
             Assert.IsFalse(Functions.IsValidLogAndPass("", "SimplePass"));
@@ -34,7 +33,7 @@ namespace UnitTestProject
         [TestMethod]
         public void IsLoginAlreadyTaken()
         {
-            Assert.IsTrue(Functions.IsLoginAlreadyTaken("Matrix"));
+            Assert.IsTrue(Functions.IsLoginAlreadyTaken("Imagara"));
             Assert.IsTrue(Functions.IsLoginAlreadyTaken("Imagine"));
             Assert.IsFalse(Functions.IsLoginAlreadyTaken("SimpleLogin"));
             Assert.IsFalse(Functions.IsLoginAlreadyTaken("Login?"));
@@ -43,15 +42,15 @@ namespace UnitTestProject
         [TestMethod]
         public void IsLogEqualPass()
         {
-            Assert.IsFalse(Functions.IsLogEqualPass("Matrix", "Matrix"));
-            Assert.IsTrue(Functions.IsLogEqualPass("Matrix", "meme3"));
+            Assert.IsFalse(Functions.IsLogEqualPass("Imagara", "Imagara"));
+            Assert.IsTrue(Functions.IsLogEqualPass("Imagara", "imalalka"));
         }
         [TestMethod]
         public void IsValidLength()
         {
-            Assert.IsTrue(Functions.IsValidLength("Matrix"));
-            Assert.IsTrue(Functions.IsValidLength("Matrwerwewe"));
-            Assert.IsFalse(Functions.IsValidLength("Ma"));
+            Assert.IsTrue(Functions.IsValidLength("Imagara"));
+            Assert.IsTrue(Functions.IsValidLength("ImaImaggara"));
+            Assert.IsFalse(Functions.IsValidLength("ima"));
             Assert.IsFalse(Functions.IsValidLength(""));
         }
     }