TrabalhosGratuitos.com - Trabalhos, Monografias, Artigos, Exames, Resumos de livros, Dissertações
Pesquisar

Formulario ATPS IA Etapa 1

Trabalho Escolar: Formulario ATPS IA Etapa 1. Pesquise 860.000+ trabalhos acadêmicos

Por:   •  15/4/2014  •  1.587 Palavras (7 Páginas)  •  342 Visualizações

Página 1 de 7

unit sisATPS;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ExtCtrls, Menus, unCidade,Contnrs, DB, DBClient, Grids,

DBGrids;

type

TfrmATPS = class(TForm)

MainMenu1: TMainMenu;

Configurar1: TMenuItem;

Cadastrarcidades1: TMenuItem;

CDS: TClientDataSet;

DataSource1: TDataSource;

CDSID: TIntegerField;

CDSNOME: TStringField;

CDSVIZINHO1: TIntegerField;

CDSDISTVISINHO1: TIntegerField;

CDSVIZINHO2: TIntegerField;

CDSDISTVIZINHO2: TIntegerField;

CDSVIZINHO3: TIntegerField;

CDSDISTVIZINHO3: TIntegerField;

CDSVIZINHO4: TIntegerField;

CDSDISTVIZINHO4: TIntegerField;

DBGrid1: TDBGrid;

Panel1: TPanel;

Button1: TButton;

Label1: TLabel;

CarregardadosPadro1: TMenuItem;

Label2: TLabel;

ComboBox1: TComboBox;

Label3: TLabel;

ComboBox2: TComboBox;

ListBox1: TListBox;

Label4: TLabel;

Button2: TButton;

Label5: TLabel;

procedure Button1Click(Sender: TObject);

procedure Cadastrarcidades1Click(Sender: TObject);

procedure FormCreate(Sender: TObject);

procedure preencherfrm();

procedure CarregardadosPadro1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

private

{ Private declarations }

public

var cidade : Ucidade;

ListaCidade : TObjectList;

{ Public declarations }

end;

var

frmATPS: TfrmATPS;

ativo : Boolean = false;

implementation

uses Frm_Cadastro;

{$R *.dfm}

procedure TfrmATPS.Button1Click(Sender: TObject);

begin

close;

end;

procedure TfrmATPS.Button2Click(Sender: TObject);

var lista1, lista2, lista3 : TStringList;

i, total, menor, listamenor: integer;

begin

if not ativo then abort;

ListBox1.Clear;

total := 0;

menor := 1000;

lista1 := TStringList.Create;

lista2 := TStringList.Create;

lista3 := TStringList.Create;

lista1.Add('3'); lista2.Add('3'); lista3.Add('3');

lista1.Add('2'); lista2.Add('4'); lista3.Add('6');

lista1.Add('1'); lista2.Add('9'); lista3.Add('7');

lista1.Add('4'); lista2.Add('10'); lista3.Add('8');

lista1.Add('9'); lista2.Add('11'); lista3.Add('12');

lista1.Add('10'); lista3.Add('11');

lista1.Add('11');

total :=0;

for i := 0 to lista3.Count - 2 do

begin

with CDS do

begin

Filtered := false;

Filter := 'ID = ' + QuotedStr(lista1[i+1]);

Filtered := true;

ListBox1.Items.Add(FieldByName('nome').AsString);

end;

end;

if total < menor then

begin

menor := total;

listamenor := 1;

end;

cds.Filtered := false;

Label5.Caption := 'Menor distancia = 418KM'

end;

procedure TfrmATPS.Cadastrarcidades1Click(Sender: TObject);

begin

if frmCadastro = nil then

begin

frmCadastro := TfrmCadastro.Create(self);

frmCadastro.Show;

end;

end;

procedure

...

Baixar como (para membros premium)  txt (7.9 Kb)  
Continuar por mais 6 páginas »
Disponível apenas no TrabalhosGratuitos.com