private void button2_Click(object sender, EventArgs events) { try { Login.Login.LoggedUserRoleID = DBHandler.SPWithValue("MATOTA.GetGuestRoleID"); } catch (InvalidCastException e) { // Este tipo exc solo va a pasar si no se encontro el rol guest en la db MessageBox.Show("Ocurrio un error interno", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } MenuPrincipal menu = new MenuPrincipal(); this.Hide(); menu.ShowDialog(this); this.Close(); }
public static void listarHoteles(ComboBox comboBox) { comboBox.DataSource = DBHandler.QueryForComboBox("SELECT idHotel,nombre FROM MATOTA.Hotel WHERE idHotel NOT IN (SELECT idHotel FROM MATOTA.InactividadHotel)"); comboBox.DisplayMember = "nombre"; comboBox.ValueMember = "idHotel"; }
public static string getIdTipoDoc(string tipoDoc) { var query = new QueryBuilder(QueryBuilder.QueryBuilderType.SELECT).Fields("td.idTipoDocumento").Table("MATOTA.TipoDocumento td").AddEquals("td.nombre", tipoDoc).Build(); return(DBHandler.Query(query).First().Values.First().ToString()); }
public static void listarTipoDoc(ComboBox comboBox) { comboBox.DataSource = DBHandler.QueryForComboBox("SELECT * FROM MATOTA.TipoDocumento"); comboBox.DisplayMember = "nombre"; comboBox.ValueMember = "IdTipoDocumento"; }
public static void listarRegimenes(ComboBox comboBox) { comboBox.DataSource = DBHandler.QueryForComboBox("SELECT idRegimen,nombre FROM MATOTA.Regimen"); comboBox.DisplayMember = "nombre"; comboBox.ValueMember = "idRegimen"; }
public static void listarRoles(ComboBox comboBox) { comboBox.DataSource = DBHandler.QueryForComboBox("SELECT * FROM MATOTA.Rol WHERE NOMBRE <> 'Guest'"); comboBox.DisplayMember = "NOMBRE"; comboBox.ValueMember = "idRol"; }