Курсовая работа: База данных продуктового магазина
AnsiString a4 = Form1->DataGrid1->Cells[3][i];
AnsiString a5 = Form1->DataGrid1->Cells[4][i];
strncpy(one,a1.c_str(),50);
strncpy(two,a2.c_str(),50);
strncpy(three,a3.c_str(),50);
strncpy(four,a4.c_str(),50);
strncpy(five,a5.c_str(),50);
fwrite(one,sizeof(char),50,this->f);
fwrite(two,sizeof(char),50,this->f);
fwrite(three,sizeof(char),50,this->f);
fwrite(four,sizeof(char),50,this->f);
fwrite(five,sizeof(char),50,this->f);
}
fclose(this->f);
}
void Ta::delet()
{
int k = 0;
for(int i = 1; i < row; i++)
k++;
if (Form1->DataGrid1->RowCount == 1)ShowMessage( "Òàáëèöà ïóñòà" );
else
{
Form1->DataGrid1->Cells[0][rowtab] = Form1->DataGrid1->Cells[0][k];
Form1->DataGrid1->Cells[1][rowtab] = Form1->DataGrid1->Cells[1][k];
Form1->DataGrid1->Cells[2][rowtab] = Form1->DataGrid1->Cells[2][k];
Form1->DataGrid1->Cells[3][rowtab] = Form1->DataGrid1->Cells[3][k];
Form1->DataGrid1->Cells[4][rowtab] = Form1->DataGrid1->Cells[4][k];
Form1->DataGrid1->Cells[5][rowtab] = Form1->DataGrid1->Cells[5][k];