//Método para carregar combo de status do motorista. public static void CarregarStatusMotorista(ref SuperComboBox combo) { try { combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("Ativo", (int)EnumStatusMotorista.Ativo)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("Inativo", (int)EnumStatusMotorista.Inativo)); } catch (Exception ex) { Utils.ExibirMensagem(ex.Message, eTipoMensagem.Erro); } }
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); } }
//Método para carregar combo Status Viagem public static void CarregarStatusViagem(ref SuperComboBox combo) { try { combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("--Selecione--", 0)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("Pendente", EnumStatusViagem.Pendente)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("Em Trânsito", EnumStatusViagem.EmTransito)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("Finalizada", EnumStatusViagem.Finalizada)); combo.SelectedIndex = 0; } 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); } }
public static void CarregarStatusVeiculo(ref SuperComboBox combo) { try { combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("--Selecione--", 0)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("Disponivel", enumStatusVeiculo.Disponivel)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("Transito", enumStatusVeiculo.Transito)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("Manutenção", enumStatusVeiculo.Manutencao)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("Sem Licenciamento", enumStatusVeiculo.SemLicenciamento)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("Desativado", enumStatusVeiculo.Desativado)); combo.SelectedIndex = 0; } catch (Exception ex) { Utils.ExibirMensagem(ex.Message, eTipoMensagem.Erro); } }
//Método para carregar combo de categoria da cnh. public static void CarregarCnhCategoria(ref SuperComboBox combo) { try { combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("--Selecione--", 0)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("A", EnumCnhCategoriaMotorista.A)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("B", EnumCnhCategoriaMotorista.B)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("C", EnumCnhCategoriaMotorista.C)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("D", EnumCnhCategoriaMotorista.D)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("E", EnumCnhCategoriaMotorista.E)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("AB", EnumCnhCategoriaMotorista.AB)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("AC", EnumCnhCategoriaMotorista.AC)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("AD", EnumCnhCategoriaMotorista.AD)); combo.Items.Add(new SmartLog.WindowsForms.Classes.Item("AE", EnumCnhCategoriaMotorista.AE)); combo.SelectedIndex = 0; } catch (Exception ex) { Utils.ExibirMensagem(ex.Message, eTipoMensagem.Erro); } }