private CsFuncionario CsFuncionario_Preencher() { try { CsFuncionario csFuncionario = new CsFuncionario(); csFuncionario.Matricula = Convert.ToInt32(TxtMatricula.Text); csFuncionario.Nome = TxtNome.Text; csFuncionario.FkFuncao = CsFuncao_Fk_Preencher(); csFuncionario.DataAdmissao = Convert.ToDateTime(DtDataAdmissao.Value.ToShortDateString()); csFuncionario.CargaHoraria = Convert.ToInt32(CboxCargaHoraria.Text); return(csFuncionario); } catch (Exception exception) { MessageBox.Show(exception.Message); } return(null); }
public CsCollectionFuncionario FuncionarioParametroColecao_Returno(CommandType commandType, string oleDbCommand, string where, string name) { csFuncionario = new CsFuncionario(); csCollectionFuncionario = new CsCollectionFuncionario(); csCommand = new CsCommand(); csCommand.ParameterCollection_Clear(); if (!(String.IsNullOrEmpty(name))) { csCommand.ParameterCollection_Add("@Name", name); } DataTable dataTable = csCommand.ExecuteCommandConsult(commandType, oleDbCommand); foreach (DataRow linha in dataTable.Rows) { csCollectionFuncionario.Add(csFuncionario.CsFuncionarioDataGridView(linha)); } return(csCollectionFuncionario); }
public void FuncionarioParametroColecao(CommandType commandType, string oleDbCommand, CsFuncionario csFuncionario) { csCommand = new CsCommand(); csCommand.ParameterCollection_Clear(); csCommand.ParameterCollection_Add("@Matricula", csFuncionario.Matricula); csCommand.ParameterCollection_Add("@Nome", csFuncionario.Nome); csCommand.ParameterCollection_Add("@FkFuncao", csFuncionario.FkFuncao); csCommand.ParameterCollection_Add("@DataAdmissao", csFuncionario.DataAdmissao); csCommand.ParameterCollection_Add("@CargaHoraria", csFuncionario.CargaHoraria); csCommand.ParameterCollection_Add("@Id", csFuncionario.Id); csCommand.ExecuteCommandNonQuery(commandType, oleDbCommand); }