bool CheckBill() { if (editCustomerName.Text.Length == 0 || // Nếu tên khách hàng trống editCustomerEmail.Text.Length == 0 || editCustomerPhone.Text.Length == 0 || birthdate.Text.Length == 0 || imgProduct.Source == null || // Nếu sản phẩm mua trống editNumberBuy.Text.Length == 0 || // Nếu số lượng mua trống (rdoGoToShop.IsChecked == true && editMoneyTaken.Text.Length == 0) || // Nếu thanh toán trực tiếp mà chưa đưa tiền (rdoShip.IsChecked == true && editAddress.Text.Length == 0) || // Nếu thanh toán giao hàng mà không đưa địa chỉ (rdoShip.IsChecked == true && editMoneyWillGet.Text.Length == 0)) // Nếu thanh toán giao hàng mà không biết số tiền sẽ thu { var dialog = new Dialog() { Message = "Vui lòng nhập đầy đủ thông tin" }; dialog.Owner = Window.GetWindow(this); dialog.ShowDialog(); return(false); } // Kiểm tra còn đủ hàng hay không int number = 0; // Số lượng mua int.TryParse(editNumberBuy.Text, out number); Manage_Product manage = new Manage_Product(); if (manage.CheckCurrentAmount(product.ID_Product, number) == false) // Nếu số lượng không đủ thì thông báo { var dialog = new Dialog() { Message = "Sản phẩm không đủ số lượng" }; dialog.Owner = Window.GetWindow(this); dialog.ShowDialog(); return(false); } return(true); }