Exemple #1
0
 private CsFuncao CsFuncao_Preencher()
 {
     try
     {
         CsFuncao csFuncao = new CsFuncao
         {
             Nome      = TxtNome.Text,
             Descricao = TxtDescricao.Text
         };
         return(csFuncao);
     }
     catch (Exception exception)
     {
         MessageBox.Show("Houve um erro durante a transferência de dados, detalhes:" + exception.Message);
     }
     return(null);
 }
        public CsCollectionFuncao CsFuncaoParametroColecao_Returno(CommandType commandType, string oleDbCommand, string where, string name)
        {
            csFuncao           = new CsFuncao();
            csCollectionFuncao = new CsCollectionFuncao();
            csCommand          = new CsCommand();

            csCommand.ParameterCollection_Clear();

            if (!(String.IsNullOrEmpty(name)))
            {
                csCommand.ParameterCollection_Add("@Nome", name);
            }

            DataTable dataTable = csCommand.ExecuteCommandConsult(commandType, oleDbCommand);

            foreach (DataRow linha in dataTable.Rows)
            {
                csCollectionFuncao.Add(csFuncao.CsFuncaoDataGridView(linha));
            }

            return(csCollectionFuncao);
        }
        public void CsFuncaoParemetroColecao(CommandType commandType, string oleDbCommand, CsFuncao csFuncao)
        {
            csCommand = new CsCommand();

            csCommand.ParameterCollection_Clear();

            csCommand.ParameterCollection_Add("@Nome", csFuncao.Nome);
            csCommand.ParameterCollection_Add("@Descricao", csFuncao.Descricao);

            csCommand.ExecuteCommandNonQuery(commandType, oleDbCommand);
        }