Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.ButtonZatwierdzClick(Sender: TObject);
- begin
- If (ComboBoxNazwa.Text='') OR (ComboBoxKraj.Text='') OR (ComboBoxTemperatura.Text='') OR (EditIlosc.Text='') OR (EditCena.Text='') OR (EditDostawca.Text='') OR (EditOdbiorca.Text='') then begin ShowMessage('Musisz podac wszystkie dane!'); exit; end;
- if Tabela.Cells[0, Tabela.RowCount-1] <> '' then Tabela.RowCount:=Tabela.RowCount+1; //zwiekszanie ilosci wierszy
- Tabela.Cells[0,Tabela.RowCount-1] := IntToStr(Tabela.RowCount-1);
- Tabela.Cells[1,Tabela.RowCount-1] := ComboBoxNazwa.Text;
- Tabela.Cells[2,Tabela.RowCount-1] := ComboBoxKraj.Text;
- Tabela.Cells[3,Tabela.RowCount-1] := EditIlosc.Text;
- Tabela.Cells[4,Tabela.RowCount-1] := EditCena.Text;
- Tabela.Cells[5,Tabela.RowCount-1] := IntToStr(StrToInt(EditCena.Text)*StrToInt(EditIlosc.Text));
- Tabela.Cells[6,Tabela.RowCount-1] := ComboBoxTemperatura.Text;
- if (CheckBoxMrozenie.Checked = true) then Tabela.Cells[7,Tabela.RowCount-1]:='TAK' else Tabela.Cells[7,Tabela.RowCount-1] := 'NIE';
- Tabela.Cells[8,Tabela.RowCount-1] := EditDostawca.Text;
- Tabela.Cells[9,Tabela.RowCount-1] := EditOdbiorca.Text;
- ComboBoxNazwa.ClearSelection;
- ComboBoxKraj.ClearSelection;
- EditIlosc.Text := '';
- EditCena.Text := '';
- ComboBoxTemperatura.ClearSelection;
- CheckBoxMrozenie.Checked := false;
- EditDostawca.Text := '';
- EditOdbiorca.Text := '';
- LabelNazwa.Enabled := false; ComboBoxNazwa.Enabled := false;
- LabelKraj.Enabled := false; ComboBoxKraj.Enabled := false;
- LabelIlosc.Enabled := false; EditIlosc.Enabled := false;
- LabelCena.Enabled := false; EditCena.Enabled := false;
- LabelTemperatura.Enabled := false; ComboBoxTemperatura.Enabled := false;
- CheckBoxMrozenie.Enabled := false;
- LabelDostawca.Enabled := false; EditDostawca.Enabled := false;
- LabelOdbiorca.Enabled := false; EditOdbiorca.Enabled := false;
- ButtonZatwierdz.Enabled := false;
- ButtonUsun.Enabled := true;
- ButtonZapisz.Enabled := true;
- ButtonWczytaj.Enabled := true;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement