Example #1
0
 public void GravaPerfil(PerfilUsuario perfil)
 {
     try
     {
         this.dataService.ExecutaQuery(" UPDATE PERFIL_USUARIO  SET DSC_PERFIL_USUARIO = '" + perfil.GetDescricao() + "'" +
                                       " WHERE COD_PERFIL_USUARIO = " + perfil.GetCodigo() + ";");
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #2
0
 public int CriarPerfil(PerfilUsuario perfil)
 {
     try
     {
         this.dataService.ExecutaQuery("INSERT INTO PERFIL_USUARIO(DSC_PERFIL_USUARIO) VALUES ('" + perfil.GetDescricao() + "');");
         DataTable result = this.dataService.BuscaDados("SELECT MAX(COD_PERFIL_USUARIO) FROM PERFIL_USUARIO");
         return(result.Rows[0].Field <int>(0));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }