Browse Source

Комент

Rav3nFK 2 years ago
parent
commit
bca1ed0196
2 changed files with 36 additions and 3 deletions
  1. 22 2
      modulekz/Cart.xaml.cs
  2. 14 1
      modulekz/ListBook.xaml.cs

+ 22 - 2
modulekz/Cart.xaml.cs

@@ -26,7 +26,8 @@ namespace modulekz
         {
             InitializeComponent();
 
-            foreach (Book b in books)
+            
+            foreach (Book b in books) //пересчет скидки
             {
                 if (sale > 0)
                 {
@@ -40,6 +41,11 @@ namespace modulekz
             ListBook.ItemsSource = books;
         }
 
+        /// <summary>
+        /// Покупка книг
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void Buy_Click(object sender, RoutedEventArgs e)
         {
             int o = BaseConnect.BaseModel.BuyOrder.Max(x => x.id) + 1;
@@ -119,6 +125,11 @@ namespace modulekz
 
         }
 
+        /// <summary>
+        /// Очищение корзины
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void Clear_Click(object sender, RoutedEventArgs e)
         {
             foreach (Book b in bb)
@@ -129,6 +140,11 @@ namespace modulekz
             ListBook.Items.Refresh();
         }
 
+        /// <summary>
+        /// Переход назад
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void Back_Click(object sender, RoutedEventArgs e)
         {
             LoadPage.MainFrame.Navigate(new ListBook(bb));
@@ -145,7 +161,11 @@ namespace modulekz
 
 
         }
-
+        /// <summary>
+        /// Удаление позиции
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void Delet_Click(object sender, RoutedEventArgs e)
         {
             Button button = (Button)sender;

+ 14 - 1
modulekz/ListBook.xaml.cs

@@ -52,11 +52,21 @@ namespace modulekz
             }
         }
 
+        /// <summary>
+        /// Переход в корзину
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void Gocart_Click(object sender, RoutedEventArgs e)
         {
             LoadPage.MainFrame.Navigate(new Cart(tableBooks, sale));
         }
 
+        /// <summary>
+        /// Добавление позиции в корзину
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void AddCart_Click(object sender, RoutedEventArgs e)
         {
             System.Windows.Controls.Button btn = sender as System.Windows.Controls.Button;
@@ -65,7 +75,10 @@ namespace modulekz
             AddCart(uid);
         }
 
-
+        /// <summary>
+        /// Модуль пересчета стоимости, скидки, количества позиции
+        /// </summary>
+        /// <param name="i"></param>
         public void AddCart(int i)
         {
             List<Book> bl;