private void BTN_SAVE_Click(object sender, EventArgs e) { if (DGV_ITEMS_LIST.Rows.Count == 0) { TXT_ITEMNAME.Focus(); MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ADD ITEMS FIRST!", MessageAlertImage.Alert()); mdg.ShowDialog(); } else if (CMB_SUPPLIER.SelectedIndex == -1) { CMB_SUPPLIER.Focus(); MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE SELECT SUPPLIER!", MessageAlertImage.Alert()); mdg.ShowDialog(); } else if (Convert.ToDouble(TXT_CARD.Text) <= 0 && TXT_CARD_NO.Text == string.Empty) { TXT_CARD_NO.Focus(); MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ENTER CARD NO!", MessageAlertImage.Alert()); mdg.ShowDialog(); } else if (Convert.ToDouble(TXT_CHEQUE.Text) > 0 && (TXT_CHEQUE_NO.Text == string.Empty || CMB_CHEQUE_BANK.SelectedIndex == -1)) { TXT_CHEQUE_NO.Focus(); MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ENTER CHEQUE INFORMATIONS!", MessageAlertImage.Alert()); mdg.ShowDialog(); } else { SAVEGRN(); } }
private void BTN_NEW_Click(object sender, EventArgs e) { if (BTN_SAVE.Enabled == true && DGV_ITEMS_LIST.Rows.Count > 0) { DialogResult DS = MessageBox.Show("DO YOU WANT TO CLEAR THIS DATA" + Environment.NewLine + "ARE YOU SURE ?", "ALERT", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (DS == DialogResult.Yes) { CLER_ALL(); CMB_SUPPLIER.Focus(); } } else { EnableControls(); CLER_ALL(); CMB_SUPPLIER.Focus(); } }
private void GRN_Load(object sender, EventArgs e) { FILL_COMBOBOX(); CMB_SUPPLIER.Focus(); }