saindras

[PembekalanPRAKERIN2015] Klik DBGrid

Jun 22nd, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.31 KB | None | 0 0
  1. //== KLIK CELL PADA DBGRID =================================================
  2. procedure TForm1.DBGrid1CellClick(Column: TColumn);
  3. begin
  4.   Button2.Enabled := True;
  5.   CheckBox1.Checked := FALSE;
  6.   if ZTable1.FieldByName('NIK').AsString = '' then
  7.   begin
  8.     ShowMessage('Kosong!');
  9.     Edit1.Clear;
  10.     Edit2.Clear;
  11.     Edit3.Clear;
  12.     Exit;
  13.   end;
  14.  
  15.   Edit1.Text := ZTable1.FieldByName('NIK').AsString;
  16.   Edit2.Text := ZTable1.FieldByName('nama_karyawan').AsString;
  17.   if ZTable1.FieldByName('jenis_kelamin').AsString = 'Laki-laki' then
  18.   begin
  19.     RadioButton1.Checked := TRUE;
  20.     RadioButton2.Checked := FALSE;
  21.   end else
  22.   begin
  23.     RadioButton1.Checked := FALSE;
  24.     RadioButton2.Checked := TRUE;
  25.   end;
  26.   Edit3.Text := ZTable1.FieldByName('tempat_lahir').AsString;
  27.   DateTimePicker1.DateTime := ZTable1.FieldByName('tanggal_lahir').AsDateTime;
  28.   if ZTable1.FieldByName('jabatan').AsString = 'Manager' then
  29.   begin
  30.     ComboBox1.ItemIndex := 0;
  31.   end else if ZTable1.FieldByName('jabatan').AsString = 'Supervisor' then
  32.   begin
  33.     ComboBox1.ItemIndex := 1;
  34.   end else if ZTable1.FieldByName('jabatan').AsString = 'Staff' then
  35.   begin
  36.     ComboBox1.ItemIndex := 2;
  37.   end else
  38.   begin
  39.     ComboBox1.ItemIndex := 3;
  40.   end;
  41. end;
  42. //==========================================================================
Advertisement
Add Comment
Please, Sign In to add comment