private void buttonThem_Click(object sender, EventArgs e) { try { PhieuXuat px = new PhieuXuat() { maPX = textBoxMaPX.Text, ngayXuat = dateTimeNX.Value, tongTien = decimal.Parse(textBoxTT.Text) }; db.PhieuXuats.Add(px); db.SaveChanges(); MessageBox.Show("Them thanh cong!!!"); FormXuat_Load(sender, e); FormCTXuat.MaPX = textBoxMaPX.Text; if (MessageBox.Show("Vui long them chi tiet phieu xuat!!", "Thông báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { FormCTXuat ctpn = new FormCTXuat(); this.Hide(); ctpn.ShowDialog(); this.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { FormCTXuat hh = new FormCTXuat(); this.Hide(); hh.ShowDialog(); this.Show(); }
private void buttonCT_Click(object sender, EventArgs e) { if (MaPX == "") { MessageBox.Show("Chon phieu xuat truoc!", "Thông báo"); } else { FormCTXuat ctx = new FormCTXuat(); FormCTXuat.MaPX = MaPX; this.Hide(); ctx.ShowDialog(); this.Show(); } }