Скачиваний:
16
Добавлен:
28.06.2014
Размер:
1.91 Кб
Скачать
//---------------------------------------------------------------------------
//ИЗМЕНЕНИЕ ПОЛЕЙ ЗАПИСИ
#include <vcl.h>
#include <stdio.h>
#include <dstring.h>
#pragma hdrstop
#include "Unit4.h"
#include "Unit1.h"
#include "Unit3.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm4 *Form4;
extern FILE *FN;
extern Auto Info;
extern Auto InfoOld;
extern int tmp;
extern AnsiString Trans(char []);
extern void PrintList(FILE *);
extern ChangeInfo(FILE *,Auto ,Auto);
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
//Отменить изменение полей записи
void __fastcall TForm4::Button2Click(TObject *Sender)
{
  Form4->Edit1->Text = Trans(InfoOld.Name);
  Form4->Edit2->Text = Trans(InfoOld.Mark);
  Form4->Edit3->Text = IntToStr(InfoOld.SeatsNumb);
  Form4->Edit4->Text = FloatToStr(InfoOld.UseP);
}
//---------------------------------------------------------------------------
//Изменить поля записи
void __fastcall TForm4::Button1Click(TObject *Sender)
{
  Auto InfoNew;

  if (Application->MessageBox(
  "Хотите изменить эту информацию?","Изменение",
  MB_YESNO+MB_ICONQUESTION)==IDYES)
  {
    strcpy(InfoNew.Name, Form4->Edit1->Text.c_str());
    strcpy(InfoNew.Mark, Form4->Edit2->Text.c_str());
    InfoNew.SeatsNumb = StrToInt(Form4->Edit3->Text);
    InfoNew.UseP = StrToFloat(Form4->Edit4->Text);
    ChangeInfo(FN,InfoOld,InfoNew);
    Form4->Edit1->Text = "";
    Form4->Edit2->Text = "";
    Form4->Edit3->Text = "";
    Form4->Edit4->Text = "";
    Form4->Close();
    PrintList(FN);
  }
}
//---------------------------------------------------------------------------

Соседние файлы в папке Программа
  • #
    28.06.201410.88 Кб17Unit3.cpp
  • #
    28.06.2014472 б16Unit3.h
  • #
    28.06.201485.92 Кб16Unit3.obj
  • #
    28.06.201410.88 Кб16Unit3.~cpp
  • #
    28.06.2014475 б16Unit3.~h
  • #
    28.06.20141.91 Кб16Unit4.cpp
  • #
    28.06.201451 б16Unit4.ddp
  • #
    28.06.20143.7 Кб17Unit4.dfm
  • #
    28.06.20141.11 Кб16Unit4.h
  • #
    28.06.201444.19 Кб17Unit4.obj
  • #
    28.06.20141.91 Кб16Unit4.~cpp