Облік зареєстрованих автомобілів в ДАІ

Курсовой проект - Компьютеры, программирование

Другие курсовые по предмету Компьютеры, программирование

omboBox2->Text == "МТС" )

{

StringGrid1->Cells[6][b]= z;

}

if (ComboBox1->Text =="Билайн" && ComboBox2->Text == "Киевстар" )

{

StringGrid1->Cells[6][b]= z;

}

if (ComboBox1->Text =="Билайн" && ComboBox2->Text == "Life :)" )

{

StringGrid1->Cells[6][b]= z;

}

if (ComboBox1->Text =="Билайн" && ComboBox2->Text == "Городской телефон" )

{

StringGrid1->Cells[6][b]= z;

}

 

//Для Городского телефона

if (ComboBox1->Text =="Городской телефон" && ComboBox2->Text == "Городской телефон" )

{

StringGrid1->Cells[6][b]= w;

}

if (ComboBox1->Text =="Городской телефон" && ComboBox2->Text == "МТС" )

{

StringGrid1->Cells[6][b]= z;

}

if (ComboBox1->Text =="Городской телефон" && ComboBox2->Text == "Киевстар" )

{

StringGrid1->Cells[6][b]= z;

}

if (ComboBox1->Text =="Городской телефон" && ComboBox2->Text == "Life :)" )

{

StringGrid1->Cells[6][b]= z;

}

if (ComboBox1->Text =="Городской телефон" && ComboBox2->Text == "Билайн" )

{

StringGrid1->Cells[6][b]= z;

}

else

{

x= StrToFloat(StringGrid1->Cells[5][b]);

l= StrToFloat(StringGrid1->Cells[6][b]);

m= StrToFloat(x*l);

StringGrid1->Cells[7][b] = m;

}

b=b+1;

}

//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)

{

StringGrid1->Options << goEditing << goTabs;

StringGrid1->FixedCols = 0;

StringGrid1->Cells[0][0]="№";

StringGrid1->Cells[1][0]="Номер телефона";

StringGrid1->Cells[2][0]="Ф.И.О выз. аб.";

StringGrid1->Cells[3][0]="Оператор выз. аб.";

StringGrid1->Cells[4][0]="Оператор наб. аб.";

StringGrid1->Cells[5][0]="Продолж звонка";

StringGrid1->Cells[6][0]="Стоимость 1 минуты (в грн.)";

StringGrid1->Cells[7][0]="Сумма к оплате";

StringGrid1->RowCount = 2;

}

//---------------------------------------------------------------------------

void __fastcall TForm1::BitBtn3Click(TObject *Sender)

{

int DeleteIndex = i;

if(StringGrid1->RowCount > 2)

{

for ( int q = DeleteIndex,MaxRowIndex=StringGrid1->RowCount-1;q<MaxRowIndex;q++)

StringGrid1->Rows[q]->Assign(StringGrid1->Rows[q+1]);

StringGrid1->RowCount = StringGrid1->RowCount-1;

b=b-1;

int q=1;

for(int x=1;x<=b;x++)

{

StringGrid1->Cells[0][x]=q;

q=q+1;

}

p=p-1;

}

else

{

StringGrid1->Cells[1][1] = "";

StringGrid1->Cells[2][1] = "";

StringGrid1->Cells[3][1] = "";

StringGrid1->Cells[4][1] = "";

StringGrid1->Cells[5][1] = "";

StringGrid1->Cells[6][1] = "";

StringGrid1->Cells[7][1] = "";

}

}

//---------------------------------------------------------------------------

bool draw_it;

void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, int ACol,

int ARow, TRect &Rect, TGridDrawState State)

{

i=ARow;

 

if (Find && Edit3->Text == StringGrid1->Cells[ACol][ARow])

{

StringGrid1->Canvas->Brush->Color = clRed; //цвет

StringGrid1->Canvas->FillRect(Rect);

StringGrid1->Canvas->Font->Color = clWhite;

Canvas->TextOut(Rect.Left,Rect.Top,StringGrid1->Cells[ACol][ARow]);">StringGrid1->Canvas->TextOut(Rect.Left, Rect.Top, StringGrid1->Cells[ACol][ARow]);

//Find = false; - раз комментировать если надо найти только первый экземпляр

}

}

//---------------------------------------------------------------------------

void __fastcall TForm1::BitBtn4Click(TObject *Sender)

{

if(OpenDialog1->Execute())

{

TStringList *pStrings = new TStringList;

pStrings->LoadFromFile(OpenDialog1->FileName);

StringGrid1->RowCount = pStrings->Count+1;

for(int i=0; i Count; i++)

{

StringGrid1->Rows[i+1]->Delimiter = wchar_t(" ");

StringGrid1->Rows[i+1]->DelimitedText = pStrings->Strings[i];

}

delete pStrings;

}

}

//---------------------------------------------------------------------------

void __fastcall TForm1::BitBtn5Click(TObject *Sender)

{

if(SaveDialog1->Execute()){TStringList *pStrings = new TStringList;

for(int i=1; i RowCount; i++)

{

pStrings->Add(StringGrid1->Cells[0][i] + " " + StringGrid1->Cells[1][i] + " " + StringGrid1->Cells[2][i]+ " " + StringGrid1->Cells[3][i]+ " " + StringGrid1->Cells[4][i]+ " " + StringGrid1->Cells[5][i]+ " " + StringGrid1->Cells[6][i]+ " " + StringGrid1->Cells[7][i]+ " " + StringGrid1->Cells[8][i]+ " " + StringGrid1->Cells[9][i]+ " " + StringGrid1->Cells[10][i]+ " " + StringGrid1->Cells[11][i]);

}

pStrings->SaveToFile(SaveDialog1->FileName);

delete pStrings;

}

}

//---------------------------------------------------------------------------

void __fastcall TForm1::BitBtn6Click(TObject *Sender)

{

Find = true;

StringGrid1->Repaint();

}

//---------------------------------------------------------------------------

void __fastcall TForm1::BitBtn7Click(TObject *Sender)

{

AboutBox->Show();

}

//---------------------------------------------------------------------

#include

#pragma hdrstop

 

#include "Unit3.h"

//---------------------------------------------------------------------

#pragma resource "*.dfm"

TAboutBox *AboutBox;

//---------------------------------------------------------------------

__fastcall TAboutBox::TAboutBox(TComponent* AOwner)

: TForm(AOwner)

{

}

//---------------------------------------------------------------------

void __fastcall TAboutBox::OKButtonClick(TObject *Sender)

{

AboutBox->Close();

}

//---------------------------------------------------------------------------