Ver Fonte

the end

ivana há 7 meses atrás
pai
commit
af833f3167

+ 1 - 1
WriteErase/App.config

@@ -8,7 +8,7 @@
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
   </startup>
   <connectionStrings>
-    <add name="TradeEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=ngknn.ru;initial catalog=TradeAstashin;user id=33П;password=12357;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
+    <add name="TradeEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=sql;initial catalog=TradeAstashin;user id=33П;password=12357;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
   </connectionStrings>
   <entityFramework>
     <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">

+ 1 - 1
WriteErase/MainWindow.xaml

@@ -6,7 +6,7 @@
         xmlns:local="clr-namespace:WriteErase"
         mc:Ignorable="d"
         
-        Title="MainWindow" Height="750" Width="1040">
+        Title="WriteErase" Height="750" Width="1040">
     <Grid>
         <Frame Name="FrameMainWindow" NavigationUIVisibility="Hidden"/>
     </Grid>

+ 4 - 2
WriteErase/Windows/ShoppingCart.xaml.cs

@@ -183,7 +183,6 @@ namespace WriteErase.Windows
             newOrder.OrderReceivingCode = random.Next(100, 999);
             newOrder.OrderStatus = 1;
             DB.Order.Add(newOrder);
-            //DB.SaveChanges();
             int id = DB.Order.Where(x => x.OrderCreateDate == newOrder.OrderCreateDate).Select(x => x.OrderID).FirstOrDefault();
             foreach (Product p in Products)
             {
@@ -194,8 +193,11 @@ namespace WriteErase.Windows
                 DB.OrderProduct.Add(newOrderProduct);
             }
             DB.SaveChanges();
-            MessageBox.Show("Заказ был сформирован, код получения: " + newOrder.OrderReceivingCode + " \nПункт выдачи находится по адресу: " +
+            MessageBox.Show("Заказ был сформирован, код получения: " + newOrder.OrderReceivingCode + " \nПункт выдачи: " +
                 DB.PickupPoints.Where(x => x.PickupID == newOrder.OrderPickupPoint).Select(x => x.PuckupAddress).FirstOrDefault());
+            Products.Clear();
+            ProductsAmount.Clear();
+            this.Close();
         }
     }
 }