private void BTN_SAVE_Click(object sender, EventArgs e) { if (TXT_PKG_NAME.Text == string.Empty) { TXT_PKG_NAME.Focus(); MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "PLEASE ENTER PACKAGE NAME", MessageAlertImage.Warning()); mdg.ShowDialog(); } else if (CMB_ROOM_TYPE.SelectedIndex < 0) { CMB_ROOM_TYPE.Focus(); MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "PLEASE SELECT ROOM TYPE", MessageAlertImage.Warning()); mdg.ShowDialog(); } else { if (BTN_SAVE.Text == "SAVE") { SAVE_ROOM_PACKAGE(); } else if (BTN_SAVE.Text == "UPDATE") { string result = UPDATE_PACKAGE(); if (result == "done") { MSGBOX mdg = new MSGBOX(MessageAlertHeder.Success(), "PACKAGE DETAILS UPDATED SUCCESSFULLY!", MessageAlertImage.Success()); mdg.ShowDialog(); LOAD_PACKAGE_LIST(); } } LOAD_PACKAGE_LIST(); } }
private void clear() { LBL_PKG_ID.Text = "N/A"; TXT_PKG_NAME.Clear(); TXT_DESCRIPTION.Clear(); CMB_ROOM_TYPE.SelectedIndex = -1; TXT_PKG_RATE.Text = "0.00"; TXT_PKG_NAME.Focus(); LBL_COLOR.Text = "SELECT COLOR"; LBL_COLOR.BackColor = DefaultBackColor; BTN_SAVE.Text = "SAVE"; }