bool checkdata() { if (model_cmb.SelectedItem == null) { messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, model_lbl.Text); popUpMessage.Warning(messageData, Text); model_cmb.Focus(); return(false); } //if (assy_txt.Text == null) //{ // messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, assy_lbl.Text); // popUpMessage.Warning(messageData, Text); // assy_txt.Focus(); // return false; //} if (line_cmb.SelectedItem == null) { messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, line_lbl.Text); popUpMessage.Warning(messageData, Text); line_cmb.Focus(); return(false); } if (String.IsNullOrEmpty(User_txt.Text)) { messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, User_lbl.Text); popUpMessage.Warning(messageData, Text); User_txt.Focus(); return(false); } if (action_cmb.SelectedItem == null) { messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, action_lbl.Text); popUpMessage.Warning(messageData, Text); action_cmb.Focus(); return(false); } if (cause_cmb.SelectedItem == null) { messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, cause_lbl.Text); popUpMessage.Warning(messageData, Text); cause_cmb.Focus(); return(false); } if (timefrom_dtp.Value > timeto_dtp.Value) { messageData = new MessageData("mmcc00005", Properties.Resources.mmcc00005, "Time Error"); popUpMessage.Warning(messageData, Text); timefrom_dtp.Focus(); return(false); } return(true); }
private void Aceptar_btn_Click(object sender, EventArgs e) { if (User_txt.Text.Length != 0) { string Usuario = User_txt.Text; string Password = Password_txt.Text; bool Log = false; if (Password_txt.Text.Length != 0) { Conexiones Conexion = new Conexiones(); Log = Conexion.Login(Usuario, Password); if (Log == true) { //usuario anterior administrador rh if (Usuario == "raul") { this.Hide(); User_txt.Clear(); Password_txt.Clear(); frmMenuRH M = new frmMenuRH(1, Usuario); M.Show(); } else { } } } else { MessageBox.Show("Introdusca su contraseña!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Introdusca su usuario!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }