Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About toufik

  • Birthday 02/02/1988

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. toufik

    Correctly displaying a Message Dialog in FireMonkey

    @Remy Lebeau thanks alot for taking a time to reply ,,,now its work with small change in line TDialogService.MessageDialog('you are gonna edit something ', TMsgDlgType.mtInformation, [TMsgDlgBtn.mbYes], TMsgDlgBtn.mbYes,0, to TDialogService.MessageDialog('you are gonna edit something ', TMsgDlgType.mtConfirmation, [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], TMsgDlgBtn.mbYes, 0,
  2. good morning every one .. its work just fine in windows ,, and in android its doesn't execute the procedure called StartLogin10 after the user choses yes ,, nothing happen ....can someone help please thanks ... i have this code below : procedure TFrmLogin.SpeedButton5Click(Sender: TObject); var Reply : Integer; begin if (lst2.Items.Count <> 0) and (lst2.ItemIndex <> -1)then begin Reply := 0; TDialogService.MessageDialog('you are gonna edit something ', TMsgDlgType.mtInformation, [TMsgDlgBtn.mbYes], TMsgDlgBtn.mbYes,0, procedure(const AResult: TModalResult) begin Reply := AResult; end ); if Reply =mrYes then StartLogin10 ;******************************************** end else ShowMessage( 'you have cancel the operation'); end else ShowMessage('chose something from the list');
  3. toufik

    TListView Paging

    I have to ask is this the proper way to do it though ?
  4. toufik

    TListView Paging

    thank you for taking time to reply .
  5. toufik

    TListView Paging

    good morning every one ^^... TListView Paging**** is this look logic to you ? a mobile app + rest . I want to be able to get 10 record every time . so how about putting the last record i get every time and send it back to the server side to get 10 more record starting with it ,,,,and so on ... is this look ok to you thank you
  6. thanks for taking time to reply i found that i did not add an array , tjsonarray , that fix it for me
  7. hello every one can some one help convert Thorse procedure unit to Tdwserverevent thank you in advance the code on Thorse are: unit uServico; interface uses Horse, System.SysUtils, DataSet.Serialize; procedure Servico(App: THorse); procedure Get(Req: THorseRequest; Res: THorseResponse; Next: TProc); implementation uses dmPrincipal; procedure Get(Req: THorseRequest; Res: THorseResponse; Next: TProc); begin try try DataModule1 := TDataModule1.Create(nil); DataModule1.FDQuery1.Close; if req.Params.Count > 0 then begin DataModule1.FDQuery1.FetchOptions.RecsSkip:= strtointdef(req.Params.Items['pagina'],1) * strtointdef(req.Params.Items['max'],1); DataModule1.FDQuery1.FetchOptions.RecsMax:= strtointdef(req.Params.Items['max'],1); end; DataModule1.FDQuery1.Open(); Res.Send(DataModule1.FDQuery1.ToJSONArray.ToJSON); finally Res.Status(200); FreeAndNil(DataModule1); end; except on e: exception do begin Res.Send(e.Message); Res.Status(400); end; end; end; procedure Servico(App: THorse); begin App.Get('/saler/:pagina/:max', Get); end;
  8. hi every one can some one help me with problem I'm using Delphi REST with server and client but when i tried to show data on the client side its show only one row for some reason, what did i do wrong ? PS : I'm using Delphi roi and restdataware the video down show what I'm deal with ; any help will be very appreciated ^^ thank you on the client side i'm using this code procedure listv; var jsonObj : TJsonObject; json, sucesso, erro,id_store ,nom_store, phone_saler: string; begin // FrmLogin.FloatAnimation2.Stop; // FrmLogin.FloatAnimation3.Stop; if FrmLogin.listvreq.Response.JSONValue = nil then begin // FrmLogin.ExibirCampos; ShowMessage('خطأ في إنشاء الحساب (JSON غير صالح)'); exit; end; try json := FrmLogin.listvreq.Response.JSONValue.ToString; jsonObj := TJSONObject.ParseJSONValue(TEncoding.UTF8.GetBytes(json), 0) as TJSONObject; sucesso := jsonObj.GetValue('sucesso').Value; erro := jsonObj.GetValue('erro').Value; id_store := jsonObj.GetValue('id_store').Value; nom_store := jsonObj.GetValue('nom_store').Value; if sucesso <> 'S' then begin // FrmLogin.ExibirCampos; ShowMessage(erro); exit; end else // showmessage('تم احضار بيانات: ' + id_store+nom_store); // FrmLogin.ExibirCampos;/// // FrmLogin.ListView1.Items.Clear(); finally jsonObj.DisposeOf; end; end; procedure listverr(Sender: TObject); begin if Assigned(Sender) and (Sender is Exception) then begin // FrmLogin.ExibirCampos; showmessage(Exception(Sender).Message); end; end; procedure TFrmLogin.StartLogin2; begin TThread.CreateAnonymousThread( procedure var Success: Boolean; begin try RequestLogin.Execute; Success := RequestLogin.Response.Status.Success; except Success := False; end; TThread.Queue(nil, procedure begin AfterLogin2(Success); end ); end ).Start; end; procedure TFrmLogin.AfterLogin2(Success: Boolean); begin if Success then begin listvreq.Params.Clear; listvreq.AddParameter('type_store',ComboBox1.Selected.Text); /// **** listvreq.ExecuteAsync(listv, true, true, listverr); end else begin showmessage (' عفوا ...! لايمكن الاتصال بالخادم حاليا يرجى المحاولة لاحقا') end; on server side : procedure Tdm.DWEventsEventslistvReplyEvent(var Params: TDWParams; var Result: string); var type_store, erro : string; usuario : TUsuario; json : TJsonObject; begin try sleep(4000); type_store := Params.ItemsString['type_store'].AsString; json := TJsonObject.Create; usuario := TUsuario.Create(dm.conn); usuario.type_store := type_store; if NOT usuario.listv(erro) then begin //{"sucesso": "N", "erro":"Usuلrio nمo informado", "codusuario":"0"} json.AddPair('sucesso', 'N'); json.AddPair('erro', erro); json.AddPair('id_store', ''); json.AddPair('nom_store', ''); end else begin json.AddPair('sucesso', 'S'); json.AddPair('erro', ''); json.AddPair('id_store', usuario.id_store.ToString); json.AddPair('nom_store', usuario.nom_store); end; Result := json.ToString; finally json.DisposeOf; usuario.DisposeOf; end; and in class i add called unit usuario function TUsuario.listv(out erro: string): Boolean; var qry : TFDQuery; begin try qry := TFDQuery.Create(nil); qry.Connection := FConn; with qry do begin Active := false; SQL.Clear; SQL.Add('SELECT * from saler WHERE type_store = :any '); ParamByName('any').Value := type_store; Active := true; if RecordCount > 0 then begin id_store := FieldByName('id_store').AsInteger; nom_store := FieldByName('nom_store').AsString; erro := ''; Result := true; end else begin // id_store := 0; erro := 'تعذر جلب بيانات المعلنين'; Result := false; end; DisposeOf; end; except on ex:exception do begin erro := 'خطأ في التحقق من صحة تسجيل الدخول: ' + ex.Message; Result := false; end; end; bandicam_2021-05-01_17-50-29-913.mp4
  9. toufik

    play all videos in one folder delphi?

    thank you very much
  10. toufik

    loop a table field

    hello every on , i'm using this code to loop a sqllite database field called 'photos' and not doing the job for me im using a timer for that named tmr1 where is the problem please thank you ps : this loop stop when one of fields value is empty tmr1.Enabled := False; if not FDTableTask.IsEmpty and not FDTableTask.FieldByName('photos').IsNull and FileExists(FDTableTask.FieldByName('photos').asString) then begin FDTableTask.next; // ImageEnView2.PrepareTransition; // ImageEnView2.RunTransition( TIETransitionType( 1 + random( ord( High( TIETransitionType )) - 2 )), 550); // tmr1.Enabled := true; while FDTableTask.EOF do begin FDTableTask.First; end; end; tmr1.Enabled := true;
  11. hello every one I want to play videos one by one , when one finished the second one start and that on ,like slidshow but with videos not pictures , using tMediaPlayer ,how can I approach that ? or is there a way to detect when start and end of a video ?thank you
  12. @emailx45 thank you its work thanks a lot ^^
  13. hello every one ..............how to store a video location to database and restore to play it in tMediaPlayer ? thank you
  14. toufik

    The location of sqllite database ?

    good morning every one ^^ how is every one doing )) 1- i have fmx android app that s create sqllite db on create ,what's the location of db on the phone and is it const location ? (does not change for every other phones) 2- what's the proper way to copy it from that location to sd card (backup) ? thanks and take care