![]() |
|
TEdit Go - Baskı Önizleme +- Delphi Can (https://www.delphican.com) +-- Forum: Delphi (https://www.delphican.com/forumdisplay.php?fid=3) +--- Forum: Mobil Platform - FireMonkey (FMX) (https://www.delphican.com/forumdisplay.php?fid=7) +--- Konu Başlığı: TEdit Go (/showthread.php?tid=5916) |
TEdit Go - cihankoca - 14-04-2021 Merhabalar; Android projem de : Aynı layout içinde barkod okuttuğum, Fiyat ve Miktar girdiğim 3 tane TEdit var. Barkod okutulunca Go ReturnKeyboard olayını çağırarak okutulan barkod geçerli ise miktar a konumlatıp fiyat bilgisini getiriyorum. Lakin miktar veya fiyat yazılınca Go yapıldığında ürünü listeye ekletemiyorum. Çünkü aynı anda ikisine birden Go metodu veremiyorum. Barkodun KeyDown Event ın da yazan kodları aşağıya ekliyorum. Nasıl bir yol izlemem gerekiyor yardımcı olabilir misiniz?
if Sender is TEdit then
begin
case TEdit(Sender).ReturnKeyType of
TReturnKeyType.Go:
if Length(EdtBarkod.Text) >= 12 then
begin
if (cbPb.Items.Strings[cbPb.ItemIndex] <> '') and
(cbDepo.Items.Strings[cbDepo.ItemIndex] <> '') then
begin
EdtMiktar.SetFocus;
SL_GFiyat := TStringList.Create;
SL_GSeri := TStringList.Create;
SL_GSonuc := TList<TStringList>.Create;
FDm.ReconnToDb;
try
users := TServerMethods1Client.Create(FDm.SQLConnection1.DBXConnection);
SL_GSonuc := users.GetTopluUrun('Barkod', EdtBarkod.Text, cbPb.Items.Strings[cbPb.ItemIndex],cbDepo.Items.Strings[cbDepo.ItemIndex]);
SL_GFiyat := SL_GSonuc[3];
SL_GSeri := SL_GSonuc[6];
if (SL_GFiyat[0] <> '') and (SL_GFiyat[0] <> '0') then
begin
EdtFiyat.Text := FormatFloat('###,##0.00',StrToFloat(SL_GFiyat[0]));
SeriAdet := StrToInt(SL_GSeri[0]);
end
else
begin
EdtFiyat.Text := FormatFloat('###,##0.00',0);
SeriAdet := 1;
end;
finally
FreeAndNil(users);
end;
end
else if cbPb.Items.Strings[cbPb.ItemIndex] = '' then ShowMessage('Pb Seçiniz!')
else if cbDepo.Items.Strings[cbDepo.ItemIndex] = '' then ShowMessage('Depo Seçiniz!');
end;
end;
end;
Cvp: TEdit Go - cihankoca - 14-04-2021 (14-04-2021, Saat: 13:36)cihankoca Adlı Kullanıcıdan Alıntı: Merhabalar; TEditlerin KeyboardType = PhonePad ; ReturnKeyType = Send yapılıp aşağıdaki kod yazılınca işlem yapılabiliyor. if Key = vkReturn then
begin
if TEdit(Sender).Name = 'EdtBarkod' then
begin
if Length(EdtBarkod.Text) >= 12 then
begin
if (cbPb.Items.Strings[cbPb.ItemIndex] <> '') and
(cbDepo.Items.Strings[cbDepo.ItemIndex] <> '') then
begin
EdtMiktar.SetFocus;
SL_GFiyat := TStringList.Create;
SL_GSeri := TStringList.Create;
SL_GSonuc := TList<TStringList>.Create;
FDm.ReconnToDb;
try
users := TServerMethods1Client.Create(FDm.SQLConnection1.DBXConnection);
SL_GSonuc := users.GetTopluUrun('Barkod', EdtBarkod.Text, cbPb.Items.Strings[cbPb.ItemIndex],cbDepo.Items.Strings[cbDepo.ItemIndex]);
SL_GFiyat := SL_GSonuc[3];
SL_GSeri := SL_GSonuc[6];
if (SL_GFiyat[0] <> '') and (SL_GFiyat[0] <> '0') then
begin
EdtFiyat.Text := FormatFloat('###,##0.00',StrToFloat(SL_GFiyat[0]));
SeriAdet := StrToInt(SL_GSeri[0]);
end
else
begin
EdtFiyat.Text := FormatFloat('###,##0.00',0);
SeriAdet := 1;
end;
finally
FreeAndNil(users);
end;
end
else if cbPb.Items.Strings[cbPb.ItemIndex] = '' then ShowMessage('Pb Seçiniz!')
else if cbDepo.Items.Strings[cbDepo.ItemIndex] = '' then ShowMessage('Depo Seçiniz!');
end;
end;
if (TEdit(Sender).Name = 'EdtMiktar') or (TEdit(Sender).Name = 'EdtFiyat') then
begin
if StrToFloat(EdtMiktar.Text) >= 1 then BtnUrunEkleClick(Sender);
end;
end;
|