private void btn_return_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { QLBan ban = new QLBan(); ban.Show(); this.Hide(); }
private void bbiRefresh_ItemClick(object sender, ItemClickEventArgs e) { this.Hide(); QLBan ban = new QLBan(); ban.Show(); }
private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e) { QLBan themsp = new QLBan(); themsp.Show(); this.Hide(); }
private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e) { string mamon = gridViewSP.GetFocusedDisplayText(); DialogResult r; r = MessageBox.Show("Bạn có muốn xóa?", "xóa thông tin", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (r == DialogResult.Yes) { MySqlConnection conn = getDB.getData(); conn.Open(); string sql = "delete from thucdon where mamon =" + mamon; try { MySqlCommand cmd = new MySqlCommand(sql, conn); if (cmd.ExecuteNonQuery() == 1) { MessageBox.Show("Thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Fails", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } this.Hide(); QLBan ban = new QLBan(); ban.Show(); } catch { MessageBox.Show("Mời chọn vào ô mã món", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Warning); } finally { conn.Close(); conn.Dispose(); } } }