Jump to content

Osama Ghazal

Members
  • Posts

    56
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Osama Ghazal

  1. I did it already, but this code is abridgement code, and it did commit but no effect until append a new record or log out from the program. it didn't run exception or rollback, it run commit and save the voucher
  2. Hi All, I have a big problem in FireDAC Transactions With UniGUI and MySQL The Problem is that the Connection does not commit the transaction until I close the program and re-open it or until i add another voucher. for example, If I have two users working on the same database, every user open the program on his browser. If (User 1) add new voucher let's say the new VoucherID will be 125, after seconds (User 2) wants also to add a new voucher, the fdquery can't find that the (User 1) added voucherID Number 125, so it will gives him that the new VoucherID also 125 not 126. This happened when I have many queries executed with one transaction. I did't face this problem when I work on Normal Desktop Application in delphi, only when I use UniGUI Trial Version:1.90.0 build 1564 and older The MySQL Database is on Outside Server with Mochahost and I am using Delphi 10.3 My Code is like the following: var VoucherID : Integer; Begin qryGetVoucherID.Close; qryGetVoucherID.Open; VoucherID := qryGetVoucherIDNewID.Value; // the query statement is: Select IfNull((Select Max(VoucherID) + 1 From vouchersheaders),1) as NewID; qryVouchersHeaders.Append; qryVouchersHeadersVoucherID.Value := VoucherID; // ....... ..... FDConnection.StartTransaction; try qryVouchersHeaders.Post; .... .... qrysaveCheques_payments.execute(chRecCount,0); qrysaveWallets_payments.execute(chRecCount,0); qrysaveAccountingEntries.execute(chRecCount,0); FDConnection.Commit; qryVouchersHeaders.Refresh; qryCheques_Payments.Refresh; qryWallets_Payments.Refresh; qryAccounting_Entries.Refresh; except FDConnection.rollback end; End;
  3. @Sherzod uniGUI Web Application Framework - Trial Edition Copyright FMSoft 2009-2022. All rights reserved. Version:1.90.0 build 1563 info@fmsoft.net
  4. Hi All How Can I put a vertical scrollbar inside UniFieldSet, same as the question in this topic: because it seems that the answer was deleted. Thank You
  5. I am using : uniGUI Web Application Framework - Trial Edition Copyright FMSoft 2009-2022. All rights reserved. Version:1.90.0 build 1563 But I solve it. in fdquery > Fetch Options> Set Unidirectional to False. I solve the problem only when I post this question. I am trying to solve it from yesterday. 😧
  6. Hi All, I am using unidbgrid and i connect it to datasource and connect the datasource to fdquery with MySQL Cloud Database, some times it works ok and sometimes it gives me this error message: operation not allowed on a unidirectional dataset. so does anybody know the reason? Osama Ghazal
  7. Thank you Sherzod for your cooperate, It works excellent Best Regards
  8. Thank you Sherzod, but this is a part of solution, and it is good, but this put the cursor in the end of the sentence, I need to select all the sentence and focus also. so, this solve the focus but didn't solve the selection of the sentence. and should i learn CSS, JavaScript and Sencha Ext to work on UniGUI . Really, I know UniGUI is a great component, but I face some difficulty like these problems. I am trying to accomplished around 30% from my new project before buying this component to see if it fully help me to do my project or not. Thank you for your co-operate
  9. Hi All, how can I make the text in the Prompt command is selected when the prompt is open? Prompt('Enter Name',' I need this text to be selected all and focused ',msConfirmation,callpackproc,false); Thanks
  10. Hi All, There is an error in the MessageDlg Direction. If the MainModule.RTL = True and The Form.RTL = False Then Messages and Prompts Directions in the Form Will be Right To Left, But it Should be Left To Right. ** Solved in this version: FMSoft_uniGUI_Complete_Professional_1.90.0.1551_Trial ** The Problem was in this version : FMSoft_uniGUI_Complete_Professional_1.90.0.1547_Trial
  11. Hi All, If you have a DBGrid and you lock one or more columns and the RTL = True Then the only locked Columns will appeared and the other columns will disappered. but if the RTL is False everything is ok, so is there is any solution for this or it is bug? Thank you.
  12. ****************************** Thanks God, I solve it. The Problem is with loading the uniDBGrid, I enable the BufferedStore, and it solve the problem ****************************** Hi All, I am trying to insert a new customer by fireDAC query and mysql database, The Problem is When I Refresh the query, it gives me no errors but the application is freezing. I put the insert query in UNIDatamodule and the CustomersQuery in the customers form and also I move it to the datamodule, but it is the same. I enabled the screen mask and disable it and it is the same problem I didn't face any problems with the other forms, only this form. Only I open the web from another pc and re open it from my pc, and it was solved directly for only 2 inserting I am working on this problem for 2 days 🥵🥵 I used this sentences: Function TdmMySQL.AddCustomer(CustomersQuery, TagsQuery: TFDQuery; CustomerTags : TStrings) : Integer; var NewID, I: Integer; c_Tag : String; begin With qryInsertCustomer Do Begin Close; if dmMainModule.recCustomer.CustomerNo = 0 then dmMainModule.recCustomer.CustomerNo := dmMainModule.CompanyConnection.ExecSQLScalar('Select IfNull(Max(CustomerNo),0) + 1 From customers'); ParamByName('CustomerNo').Value := dmMainModule.recCustomer.CustomerNo; ParamByName('CustomerName').Value := dmMainModule.recCustomer.CustomerName; ParamByName('CustomerType').Value := dmMainModule.recCustomer.CustomerTypeID; ParamByName('LinkedWithSalesMan').Value := dmMainModule.recCustomer.LinkedWithSalesMan; ParamByName('SalesManID').Value := dmMainModule.recCustomer.SalesManID; ParamByName('SalesTaxType').Value := dmMainModule.recCustomer.SalesTaxType; ParamByName('SalesTaxNumber').Value := dmMainModule.recCustomer.SalesTaxNumber; ParamByName('IsBlackListed').Value := dmMainModule.recCustomer.IsBlackListed; ParamByName('AllowCredit').Value := dmMainModule.recCustomer.AllowCredit; ParamByName('HasDebtLimit').Value := dmMainModule.recCustomer.HasDebtLimit; ParamByName('DebtLimit').Value := dmMainModule.recCustomer.DebtLimit; ParamByName('AllowCheques').Value := dmMainModule.recCustomer.AllowCheques; ParamByName('HasChequesValuesLimit').Value := dmMainModule.recCustomer.HasChequesValuesLimit; ParamByName('ChequesValuesLimit').Value := dmMainModule.recCustomer.ChequesValuesLimit; ParamByName('BankName').Value := dmMainModule.recCustomer.BankName; ParamByName('BankBranch').Value := dmMainModule.recCustomer.BankBranch; ParamByName('BankAccountNumber').Value := dmMainModule.recCustomer.BankAccountNumber; ParamByName('BankSwiftCode').Value := dmMainModule.recCustomer.BankSwiftCode; ParamByName('BankAddress').Value := dmMainModule.recCustomer.BankAddress; ParamByName('IBANNumber').Value := dmMainModule.recCustomer.IBANNumber; End; With qrySaveCustomerInfo Do Begin ParamByName('Phone1').Value := dmMainModule.recCustomer.Phone1; ParamByName('Phone2').Value := dmMainModule.recCustomer.Phone2; ParamByName('Fax').Value := dmMainModule.recCustomer.Fax; ParamByName('Section1ExtName').Value := dmMainModule.recCustomer.Section1ExtName; ParamByName('Section1Ext').Value := dmMainModule.recCustomer.Section1Ext; ParamByName('Section2ExtName').Value := dmMainModule.recCustomer.Section2ExtName; ParamByName('Section2Ext').Value := dmMainModule.recCustomer.Section2Ext; ParamByName('ContactPerson1Name').Value := dmMainModule.recCustomer.ContactPerson1Name; ParamByName('ContactPerson1Mobile').Value := dmMainModule.recCustomer.ContactPerson1Mobile; ParamByName('ContactPerson2Name').Value := dmMainModule.recCustomer.ContactPerson2Name; ParamByName('ContactPerson2Mobile').Value := dmMainModule.recCustomer.ContactPerson2Mobile; ParamByName('EMail1').Value := dmMainModule.recCustomer.EMail1; ParamByName('EMail2').Value := dmMainModule.recCustomer.EMail2; ParamByName('Website').Value := dmMainModule.recCustomer.Website; ParamByName('City').Value := dmMainModule.recCustomer.City; ParamByName('Area').Value := dmMainModule.recCustomer.Area; ParamByName('Street').Value := dmMainModule.recCustomer.Street; ParamByName('BuildingNo').Value := dmMainModule.recCustomer.BuildingNo; ParamByName('BuildingSubNo').Value := dmMainModule.recCustomer.BuildingSubNo; ParamByName('Floor').Value := dmMainModule.recCustomer.Floor; ParamByName('OfficeNo').Value := dmMainModule.recCustomer.OfficeNo; ParamByName('POBOX').Value := dmMainModule.recCustomer.POBOX; ParamByName('POBoxCity').Value := dmMainModule.recCustomer.POBoxCity; ParamByName('ZipCode').Value := dmMainModule.recCustomer.ZipCode; ParamByName('POBoxState').Value := dmMainModule.recCustomer.POBoxState; ParamByName('Remarks').Value := dmMainModule.recCustomer.Remarks; End; With qrySaveCustomerOpenBalances Do Begin ParamByName('PeriodID').Value := dmMainModule.LoginInfo.PeriodID; ParamByName('Debit').Value := dmMainModule.recCustomer.OpeningDebit; ParamByName('Credit').Value := dmMainModule.recCustomer.OpeningCredit; End; dmMainModule.CompanyConnection.StartTransaction; Try qryInsertCustomer.OpenOrExecute; // I tried this and also open to take a newid result NewID := qryInsertCustomer.FieldByName('NewID').Value; dmMainModule.recCustomer.CustomerID := NewID; qrySaveCustomerInfo.ParamByName('CustomerID').Value := NewID; qrySaveCustomerInfo.ExecSQL; qrySaveCustomerOpenBalances.ParamByName('CustomerID').Value := NewID; qrySaveCustomerOpenBalances.ExecSQL; qrySaveCustomerTags.Params.ArraySize := CustomerTags.Count; for I := 0 to CustomerTags.Count - 1 do Begin c_Tag := CustomerTags[i]; if TagsQuery.Locate('Tag',c_Tag,[]) then Begin qrySaveCustomerTags.ParamByName('CustomerID').Values[i] := NewID; qrySaveCustomerTags.ParamByName('TagID').Values[i] := TagsQuery.FieldByName('TagID').AsInteger; End; End; qrySaveCustomerTags.Execute(qrySaveCustomerTags.Params.ArraySize); dmMainModule.CompanyConnection.Commit; qryInsertCustomer.Close; CustomersQuery.Refresh; // ***** here is the problem and I tried to close it and reopen it also ********/// CustomersQuery.Locate('CustomerID', dmMainModule.recCustomer.CustomerID, []); Result := NewID; Except On E : Exception Do Begin dmMainModule.CompanyConnection.Rollback; ShowMessage(E.Message); Result := -1; raise; End; End; end; the CustomersQuery.text is : Select c.CustomerID, c.CustomerNo, c.CustomerName, Cast(c.CustomerType as signed integer) as CustomerTypeID, ct.TypeName as CustomerType, c.LinkedWithSalesMan, c.SalesManID, sm.SalesManName, c.SalesTaxType, c.SalesTaxNumber, c.IsBlackListed, c.AllowCredit, c.HasDebtLimit , c.DebtLimit, c.AllowCheques, c.HasChequesValuesLimit, c.ChequesValuesLimit , c.BankName, c.BankBranch, c.BankAccountNumber, c.BankSwiftCode , c.BankAddress, c.IBANNumber, ci.Phone1, ci.Phone2, ci.Fax, ci.Section1ExtName , ci.Section1Ext, ci.Section2ExtName, ci.Section2Ext, ci.ContactPerson1Name, ci.ContactPerson1Mobile, ci.ContactPerson2Name, ci.ContactPerson2Mobile , ci.EMail1, ci.EMail2 , ci.Website, ci.City, ci.Area , ci.Street, ci.BuildingNo, ci.BuildingSubNo, ci.Floor , ci.OfficeNo, ci.POBOX, ci.POBoxCity, ci.ZipCode , ci.POBoxState, ci.Remarks From customers c Left Outer Join customersinfo ci on c.CustomerID = ci.CustomerID Left Outer Join customertypes ct on c.CustomerType = ct.TypeID Left Outer Join SalesMen sm on sm.SalesManID = c.SalesManID Where Upper(c.CustomerName) Like Upper(:CustomerName) AND Upper(sm.SalesManName) Like Upper(:SalesManName)
  13. Hi All, In Delphi there is an event called onEnter and onExit for any Control. but in UniGUI it is not available. So, How can I Change the color for the CheckBox When it was focused it is an active control and when I move the control to the next control I want to return the color to btnFace. or how can I put a rectangle around the checkbox when it is focused? Thank you all
  14. I swear that I Search about it before, but I didn't found it, 😔, Maybe that my Glasses was not Clean, 😅 but now I found it 👍👍 Thank you Very Much
  15. Last Trial Version from UniGUI website: FMSoft_uniGUI_Complete_Professional_1.90.0.1547_Trial.exe
  16. Last Trial Version from UniGUI website: FMSoft_uniGUI_Complete_Professional_1.90.0.1547_Trial.exe
  17. Hi All, I Tried To use the TitleClick on the uniDBGrid, but it is not working. I used this code: procedure T_dfrmStores.grdStoresTitleClick(Column: TUniDBGridColumn); begin ShowMessage('title click'); qryStores.IndexFieldNames := Column.FieldName; end; and I make all the Fields is Sortable.
  18. Hi All, Where should I put the FDQueries Components, should I put them in the form or in datamodule. and when I close the form will the queries freed automatically ? the FDConnection I put in in the MainModule, FDManager in Server Module. and also the code for insert update and delete and other operations, should I write them in the form or in separate datamodule? Thank you all
  19. Forget it, I used TreeView and DBGrid and everything is working perfect now. I used multi levels (not fixed) sometimes it will be 2 levels for categories and 1 level for products , and another case I used 3 or 4 levels in categories in the same TreeView and link it with DBGrid , and everything is fine. Thank you all for your co-operate
  20. I already use it, but it reads only the last node not the category that depends on the TreeKeyFields
×
×
  • Create New...