private void BtnConfirm_Click(object sender, RoutedEventArgs e) { if (CheckBill() == false) { return; } var bill = new Bill_Show(); bill.DateCreate = DateTime.Now; bill.Name_Cus = editCustomerName.Text; bill.Phone = editCustomerPhone.Text.Length == 0 ? null : editCustomerPhone.Text; bill.ID_PRO = product.ID_Product; bill.Amount = (int.Parse(editNumberBuy.Text)); bill.Initial_price = (int.Parse(editSalePrice.Text)); bill.Sale_price = int.Parse(editTotalPrice.Text); bill.Online = (bool)rdoGoToShop.IsChecked ? "No" : "Yes"; bill.Address = (bool)rdoShip.IsChecked ? editAddress.Text : null; bill.Ship = (bool)rdoShip.IsChecked ? Int32.Parse(editShipCost.Text) : 0; bill.status = (bool)rdoGoToShop.IsChecked ? "Complete" : "No complete"; bill.Namepro = product.NameProduct; bill.birthday = DateTime.Parse(birthdate.Text); bill.Email = editCustomerEmail.Text == null ? "" : editCustomerEmail.Text; bill.ID_output = manage.Create_NewIdOutput_Auto(); manage.AddnewOutput(bill); Dialog a = new Dialog() { Message = "Đã tạo Bill!" }; a.Owner = Window.GetWindow(this); a.ShowDialog(); if (loadlistbill != null) { loadlistbill.Invoke(true); } }