private void SAVE_NEW_AGENT() { try { CONNECTION.open_connection(); using (MySqlCommand da = new MySqlCommand("INSERT INTO agent ( agent_name) VALUES ( @agent_name)", CONNECTION.CON)) { da.Parameters.Clear(); da.Parameters.AddWithValue("@agent_name", TXT_NEW_AGENT_NAME.Text); if (da.ExecuteNonQuery() > 0) { string QRY2 = "SELECT agent_id, agent_name FROM agent"; CLS_METHODS.FILL_COMBOBOX(CMB_AGENT, QRY2, "agent_name", "agent_id", -1); CMB_AGENT.Text = TXT_NEW_AGENT_NAME.Text; PNL_QUICK_ADD_AGENT.Visible = false; } } } catch (Exception ex) { MSGBOX mdg = new MSGBOX(MessageAlertHeder.Error(), ex.Message, MessageAlertImage.Error()); mdg.ShowDialog(); } finally { CONNECTION.close_connection(); } }
private void NEW_GUEST_Load(object sender, EventArgs e) { String QRY = "SELECT id,country_name FROM country"; CLS_METHODS.FILL_COMBOBOX(CMB_COUNTRY, QRY, "country_name", "id", -1); TXT_ID_NUMBER.Focus(); }
private void FILL_COMBOBOX() { string QRY1 = "SELECT supplier_id,supplier_name FROM supplier WHERE STATUS='ENABLE'"; string QRY3 = "SELECT id,bank_name FROM bank"; CLS_METHODS.FILL_COMBOBOX(CMB_SUPPLIER, QRY1, "supplier_name", "supplier_id", -1); CLS_METHODS.FILL_COMBOBOX(CMB_CHEQUE_BANK, QRY3, "bank_name", "id", -1); }
private void DAILY_MENU_Load(object sender, EventArgs e) { frm_show = true; string query = "SELECT DISTINCT i.item_category,c.caegory_name FROM item i JOIN category c ON i.item_category=c.categry_id WHERE i.item_type_id=1 OR i.item_type_id=2"; CLS_METHODS.FILL_COMBOBOX(CMB_CATEGORY, query, "caegory_name", "item_category", 0); frm_show = false; }
private void CHECKBILL_PRINT_Load(object sender, EventArgs e) { string QRY3 = "SELECT room_id,room_name FROM room"; LOAD_RESERVATION_NO(); CLS_METHODS.FILL_COMBOBOX(CMB_ROOM_NAME, QRY3, "room_name", "room_id", -1); DTP_FROM_DATE.Value = DTP_FROM_DATE.Value.AddDays(-7); }
private void VIEW_STOCK_Load(object sender, EventArgs e) { LOAD_ALL_ITEMS(); String QRY1 = "SELECT categry_id, caegory_name FROM category"; String QRY2 = "SELECT id, TYPE FROM item_type"; CLS_METHODS.FILL_COMBOBOX(CMB_CATEGORY, QRY1, "caegory_name", "categry_id", -1); CLS_METHODS.FILL_COMBOBOX(CMB_ITEM_TYPE, QRY2, "TYPE", "id", -1); }
private void CHECKED_IN_Load(object sender, EventArgs e) { LOAD_AVAILABLE_ROOMS(); CMB_TAX.SelectedIndex = 0; string QRY2 = "SELECT agent_id, agent_name FROM agent"; CLS_METHODS.FILL_COMBOBOX(CMB_AGENT, QRY2, "agent_name", "agent_id", -1); TXT_NIC_NO.Focus(); flowLayoutPanel1.Controls.Clear(); }
private void BTN_MAKE_NEW_AGENT_Click(object sender, EventArgs e) { if (PNL_QUICK_ADD_AGENT.Visible == true) { PNL_QUICK_ADD_AGENT.Visible = false; } else { PNL_QUICK_ADD_AGENT.Visible = true; PNL_QUICK_ADD_AGENT.Size = new Size(300, 100); TXT_NEW_AGENT_NAME.Focus(); TXT_NEW_AGENT_NAME.Clear(); } string QRY2 = "SELECT agent_id, agent_name FROM agent"; CLS_METHODS.FILL_COMBOBOX(CMB_AGENT, QRY2, "agent_name", "agent_id", -1); }
public REQUEST_ADDITIONAL_SERVICES() { InitializeComponent(); CLS_METHODS.FILL_COMBOBOX(CMB_SERVICES, "SELECT id,service_name FROM additional_service_list WHERE service_status='1'", "service_name", "id", -1); }
public ITEMS() { InitializeComponent(); CLS_METHODS.FILL_COMBOBOX(CMB_ITEM_TYPE, "SELECT id,type FROM item_type ORDER BY type", "type", "id", -1); }