private void TextBoxharga_KeyUp(object sender, KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Enter) { if (txtnama.Text == "" || txttotalcustom.Text == "") { e.Handled = false; MessageBox.Show("the first row cannot empty", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error); return; } // your event handler here ShopingchartBLL shopingBLL = new ShopingchartBLL(); OrderCustomBeli oService = new OrderCustomBeli(); oService.NamaCustom = txtnama.Text; oService.HargaCustom = double.Parse(txtharga.Text); oService.IdTransaksi = int.Parse(txttota.Text); oService.JumlahCustom = int.Parse(txttotalcustom.Text); oService.TotalCustom = double.Parse(txttotal1.Text); oService.Checkboxaktif = true; if (shopingBLL.AddOrderCustombeli(oService) > 0) { this.ClearForm3(); MessageBox.Show("Add Order Buy Custom successfully added !"); this.LoadDataSku(); } else { MessageBox.Show("Add Order Buy Custom failed to add !"); } e.Handled = true; } }
public void Addsku_Clicks(object sender, RoutedEventArgs e) { ShopingchartBLL receivedBLL = new ShopingchartBLL(); if (receivedBLL.AddOrderCustombeli(this.GetData()) > 0) { this.ClearForm(); MessageBox.Show("Add Order Buy Custom successfully added !"); this.newreturn.LoadDataSku(); } else { MessageBox.Show("Add Order Buy Custom failed to add !"); } this.Close(); }
private void custom_Click(object sender, RoutedEventArgs e) { ShopingchartBLL shopingBLL = new ShopingchartBLL(); if (shopingBLL.AddOrderCustombeli(this.GetData1()) > 0) { this.ClearForm2(); MessageBox.Show("Add Order Buy Custom successfully added !"); if (int.Parse(txttota.Text) != 0) { this.LoadDataSku(); } else if (int.Parse(txttota.Text) == 0) { this.LoadDataSku1(); } } else { MessageBox.Show("Add Order Buy Custom failed to add !"); } }
public void Addsku_Clicks(object sender, RoutedEventArgs e) { ShopingchartBLL receivedBLL = new ShopingchartBLL(); if (receivedBLL.AddOrderCustombeli(this.GetData()) > 0) { this.ClearForm(); MessageBox.Show("Add Order Buy Custom successfully added !"); if (int.Parse(txttota.Text) != 0) { this.newReceivedGood.LoadDataSku(); } else if (int.Parse(txttota.Text) == 0) { this.newReceivedGood.LoadDataSku1(); } } else { MessageBox.Show("Add Order Buy Custom failed to add !"); } newReceivedGood.DGSKUReceivedGood.Visibility = Visibility.Visible; this.Visibility = Visibility.Collapsed; }