private void btnOK_Click(object sender, EventArgs e) { if (txtTokenNo.Text.Trim() == "") { MessageBox.Show("Please enter token no !!", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { AppConfiguration a = new AppConfiguration(); a.OrderID = Convert.ToInt32(txtTokenNo.Text.Trim()); bool Flag = CheckOrderExistByOrderIDAndTerminalID(a.OrderID, a.TerminalID); if (Flag == false) { MessageBox.Show("No any order by given token no on your terminal id", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { this.Visible = false; this.Visible = false; this.Close(); this.Hide(); if (Application.OpenForms.OfType <frmPrintToken>().Any()) { frmPrintToken frm = new frmPrintToken(); frm.Visible = false; frm.Close(); frm.Hide(); } InsertDataFromMainToTemp(a.OrderID, a.TerminalID); frmPrintToken frm1 = new frmPrintToken(); frm1.Show(); } } }
private void dgv_CellDoubleClick_1(object sender, DataGridViewCellEventArgs e) { int rowIndex = e.RowIndex; DataGridViewRow row = dgv.Rows[rowIndex]; int CID = Convert.ToInt32(row.Cells[0].Value); string C_Name = "" + row.Cells[1].Value; InventryOrder i = new InventryOrder(); i.OrderEmployeeID = CID; i.OrderEmployeeName = C_Name; AppConfiguration c = new AppConfiguration(); int n = SetOrderCustomerID(c.TerminalID, CID); if (n > 0) { this.Visible = false; this.Visible = false; this.Close(); this.Hide(); if (Application.OpenForms.OfType <frmPrintToken>().Any()) { frmPrintToken frm = new frmPrintToken(); frm.Visible = false; frm.Close(); frm.Hide(); } frmPrintToken frm1 = new frmPrintToken(); frm1.Show(); } else { MessageBox.Show("Failed to set employee!!", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error); txtCustomerName.Focus(); } }