private void CarregarComboFuncionario(ref SuperComboBox combo) { try { FuncionarioController funcCtrl = new FuncionarioController(); DataTable table = funcCtrl.CarregarComboFuncionario(); combo.CarregaCombo(table, "Cod_Matricula", "Nome_Funcionario", UserControl.eTipoMensagem.Selecione); } catch (Exception ex) { Utils.ExibirMensagem(ex.Message, eTipoMensagem.Erro); } }
private void CarregarComboVeiculo(ref SuperComboBox combo) { try { VeiculoController veicCtrl = new VeiculoController(); DataTable table = veicCtrl.CarregarComboVeiculo(); combo.CarregaCombo(table, "Cod_Veiculo", "Modelo", UserControl.eTipoMensagem.Selecione); } catch (Exception ex) { Utils.ExibirMensagem(ex.Message, eTipoMensagem.Erro); } }
private void CarregarComboCliente(ref SuperComboBox combo) { try { ClienteController cli = new ClienteController(); if (tableCliente == null) { tableCliente = cli.ComboCliente(); } combo.CarregaCombo(tableCliente, "Cod_Cliente", "Nome_Cliente", UserControl.eTipoMensagem.Selecione); } catch (Exception ex) { Utils.ExibirMensagem(ex.Message, eTipoMensagem.Erro); } }
private void CarregarComboMotorista(ref SuperComboBox combo) { try { MotoristaController motoristaCtrl = new MotoristaController(); if (tableMotorista == null) { tableMotorista = motoristaCtrl.ComboMotorista(); } combo.CarregaCombo(tableMotorista, "Cod_Motorista", "Nome_Motorista", UserControl.eTipoMensagem.Selecione); } catch (Exception ex) { Utils.ExibirMensagem(ex.Message, eTipoMensagem.Erro); } }
//Método para carregar combos de estado. public static void CarregarEstado(ref SuperComboBox combo) { try { EstadoController estadoCtrl = new EstadoController(); DataTable table = estadoCtrl.CarregarEstado(); if (table != null) { combo.CarregaCombo(table, "Cod_Estado", "UF_Estado", UserControl.eTipoMensagem.Selecione); } } catch (Exception ex) { throw new Exception(ex.Message); } }
//Método para carregar os combos de cidade. public static void CarregarComboCidade(int codEstado, ref SuperComboBox combo) { try { CidadeController cidCtrl = new CidadeController(); if (codEstado > 0) { DataTable table = cidCtrl.CarregarCidadeController(codEstado); combo.CarregaCombo(table, "Cod_Cidade", "Nome_Cidade", UserControl.eTipoMensagem.Selecione); } } catch (Exception ex) { throw new Exception(ex.Message); } }