private void btnSend_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(this.lblSeatSelectList.Text.Trim())) { Globalizer.ShowMessage(MessageType.Warning, "Select Seat No"); } else { this.Close(); } }
private void btnLogIn_Click(object sender, EventArgs e) { UserController userController = new UserController(); if (CheckRequiredFields()) { try { string str = userController.CheckUserNameAndPassword(txtUserName.Text.Trim(), txtPassword.Text.Trim()); if (str == "admin") { if (Globalizer.userName != null) { Globalizer.userName = null; } Globalizer.userName = txtUserName.Text; string log = "--------------User LogIn:"******";" + "Level:" + str + "--------------"; userAction.Log(log); MainMenu admin = new MainMenu(); admin.Show(); this.InitializeControl(); //this.txtUserName.Text = ""; //this.txtPassword.Text = ""; } else if (str == "staff") { if (Globalizer.userName != null) { Globalizer.userName = null; } Globalizer.userName = txtUserName.Text; string log = "--------------User LogIn:"******"Level:" + str + "--------------"; userAction.Log(log); MainMenuForStaff staff = new MainMenuForStaff(); staff.Show(); this.InitializeControl(); //this.txtUserName.Text = ""; //this.txtPassword.Text = ""; } this.Hide(); } catch (Exception ex) { Globalizer.ShowMessage(MessageType.Warning, ex.Message); this.InitializeControl(); this.txtUserName.Focus(); } // this.Hide(); } }
//private void toolStripMenuItem5_Click(object sender, EventArgs e) //{ // BTS.UI.Process.Trip_Confirm tripConfirm = new BTS.UI.Process.Trip_Confirm(); // tripConfirm.ShowDialog(); //} //private void toolStripMenuItem6_Click(object sender, EventArgs e) //{ // BTS.UI.Confirm confirm = new Confirm(); // confirm.ShowDialog(); //} //private void toolStripMenuItem7_Click(object sender, EventArgs e) //{ // BTS.UI.TicketOut ticketOut = new TicketOut(); // ticketOut.ShowDialog(); //} private void tsmExit_Click(object sender, EventArgs e) { DialogResult dialogresult = Globalizer.ShowMessage(MessageType.Question, "Are you sure to exit?"); if (dialogresult == DialogResult.Yes) { Application.Exit(); string log = "------------------------------USER LOGOUT------------------------------"; userAction.Log(log); } }
private void exitToolStripMenuItem1_Click(object sender, EventArgs e) { DialogResult dialogresult = Globalizer.ShowMessage(MessageType.Question, "Are you sure to exit?"); if (dialogresult == DialogResult.Yes) { Application.Exit(); string log = "------------------------------USER Logout;User:"******"userName" + "------------------------------"; userAction.Log(log); } }
private void txtCustomerName_KeyDown(object sender, KeyEventArgs e) { if ((Keys)e.KeyCode == Keys.Enter) { if (string.IsNullOrEmpty(this.txtCustomerName.Text.Trim().ToString())) { Globalizer.ShowMessage(MessageType.Warning, "Customer Name should not be blank"); } else { this.SearchByCustomerName(this.txtCustomerName.Text.Trim()); } } }
private bool CheckRequiredFields() { if (string.IsNullOrEmpty(this.txtUserName.Text.Trim())) { Globalizer.ShowMessage(MessageType.Warning, "Please enter the User Name"); this.txtUserName.Focus(); return(false); } if (string.IsNullOrEmpty(this.txtPassword.Text.Trim())) { Globalizer.ShowMessage(MessageType.Warning, "Please enter the Password"); this.txtPassword.Focus(); return(false); } return(true); }