Всем привет немного доработал проект добавил раскладку + подскажите как сделать кнопку LANG в переключение раскладки с англиской на русскую

27

(47 replies, posted in Script)

Does anyone know how to increase the tick on the checkbox ?? And then in the editor it shows a large one, but in fact, when you run the program, it is small
datetimepiker

28

(2 replies, posted in Script)

procedure frmLogin_Button1_OnClick ( Sender: string; var Cancel: boolean ); // check credentials and, if okay, show Form1
///////////////  Login, password, user rights  /////////////////////
var
       sHash: string;
       s: string;
begin
     // SQL login and password request user
        sHash: = VarToStr ( SQLExecute ( 'SELECT pass FROM users WHERE ( lldelo = '' '+ frmLogin.Edit1.Text + '' ); ') );


     // if the hash in the database = hash of entered a password
         if sHash = StrToMD5 ( frmLogin.Edit2.Text ) then
         Form1.Show;
end;




I have Hash in my database:
         202cb962ac59075b964b07152d234b70
When I do the above password check, there is no comparison, but when you change to the manual in the database by capital letters:
         202CB962AC59075B964B07152D234B70
then everything is fine..
Does anyone know how to specify a letter rig in a script or can turn it off?

29

(6 replies, posted in Script)

brian.zaballa wrote:
frmOrderProduct.Button6.dbDontResetID := False;

This code will always make make it add new record if you are not closing the form after saving.

it will be much appreciated if you can attach if not your project, just a simple one so that people can check it out easily. It is much easier to debug with it

Thanks!!!

30

(5 replies, posted in Script)

paste this script separately or in Form1 ? I just have a connection to the 1 database..




procedure Form1_OnShow (Sender: string; Action: string);
var
   //////////////////////////////////////////////////////////////////////////////////////////////////Создаем переменые для меню
   //////////////////////////////////////////////////////////////////////////////////////////////////Создаем переменые меню
   MyItem1: TMenuItem;//Файл
   MyItem2: TMenuItem;//О программе
   MySubItem3: TMenuItem;//Файл - закрыть
   ok: boolean;
   var  vreminder: string; vapps : integer;

   ////////////////////////////////////////////////////////////////////////////////////////////////////
begin
     frmWait.Show;
     Application.ProcessMessages;
     {$MySQL disable_connectdialog}
     Form1.MySQLConnection.Server := '10.24.221.20';
     Form1.MySQLConnection.Port := 3306;
     Form1.MySQLConnection.Username := 'BASE';
     Form1.MySQLConnection.Password := '123123';
     Form1.MySQLConnection.Database := 'newbase';
       try
       // попытка 1...
    Form1.MySQLConnection.Connect;
    ok:=true;
  except
      end;
  if not ok then                                           
    begin                                               
      Form1.MySQLConnection.Server := '192.168.1.85';
      Form1.MySQLConnection.Port := 3306;
      Form1.MySQLConnection.Username := 'BASE';
      Form1.MySQLConnection.Password := '123123';
      Form1.MySQLConnection.Database := 'newbase';
      try
            // попытка 2...
        Form1.MySQLConnection.Connect;
        ok:=true;
        except
        end;
    end;
       if ok then
    begin
    UpdateDatabase('');
    end else
    begin
     frmWait.Close;
     ShowMessage('Проверте подключение к базе данных');
     Form1.Close;
end;
     if Form1.MySQLConnection.Connected then
     UpdateDatabase('');

31

(5 replies, posted in Script)

Well, tell me the button script to connect to another database in the program to make some changes or direct me in the right direction! : ) Thanks

32

(5 replies, posted in Script)

Hi all. Is it possible to connect an existing database such as BASE on the server 192.168.0.1 to the BASE2 database on 192.168.2.1 ??? and get data from there

Разобрался данный скрипт нужно вешать на кнопку показа записи а не на открытие формы smile

DriveSoft wrote:

Нет, это не SQL запрос.


У компонентов ComboBox и TableGrid есть свойство dbItemID, позволяет как прочитать id записи, которая выделена в компоненте, так и выделить запись в компоненте по ее id.


В данном примере мы просто выделяем в ComboBox запись, которая выделена в TableGrid.

frmOrder.cbClient.dbItemID := Form1.gridOrdered.dbItemID; - в событии открытия формы frmOrder - происходит следующее при нажатии с Form1 в таблице показать запись в combobox frmOrder - вылезает другое ID не то которое было выбрано в таблице... в чем проблема подскажите

А как сделать наоборот из Textbox - передать значение в combobox>?

36

(6 replies, posted in Script)

Please help me, I just need from the form: employees - I select names through the search - then they go as a new record in OrderT - then we create a new record in the OrderProduct form and on this form, when saving with a button without a script, id_employees are NOT saved (this field is located in the table Orderproduct

Table - Employees
Table - OrderT
Table - OrderProduct

37

(6 replies, posted in Script)

I could use the standard means of saving with a button through the program, but the problem is that the id_employees table with data on customers does not want to write the id itself in the OrderProduct, can there be a way to display the ID on the form?

38

(6 replies, posted in Script)

Hello
I have a new entry on the form, open it and save it to the database with a script, and the next time you go to view or change the entry, then when you try to click on this script, a repeated entry is added. How to avoid it?
Here is the button script:
procedure frmOrderProduct_Button6_OnClick(Sender: TObject; var Cancel: boolean);
var
s:string
maxID:string;
maxID2:string;
maxID3:string;
maxID4:string;
begin
      // Pass from product combobox to another combobox

        begin
      //Save the value in the additional table with the button
      maxID := SQLExecute('SELECT MAX(id) FROM ORDERT');
      maxID2 := SQLExecute('SELECT id_employees FROM ORDERT WHERE id= '+maxID+'');
      maxID4 := SQLExecute('SELECT MAX(id) FROM Product');
      SQLExecute('INSERT INTO orderproduct (Quantity, QuantityFact, Cost, summa, kolminus, ID_ORDERT, id_employees,id_product) VALUES('+frmOrderProduct.edQuantity.Text+','+frmOrderProduct.Edit1.Text+','+frmOrderProduct.edCost.Text+ ','+frmOrderProduct.edTotal.Text+','+frmOrderProduct.kolminus.Text+','+maxID+','+maxID2+','+frmOrderProduct.cbProduct.sqlValue+')');
      UpdateDatabase('orderproduct');
      frmOrderProduct.Button6.dbDontResetID := False;
      end;

    begin
    frmOrder.bSearchGridOrdered.Click;
    end;
end;

39

(19 replies, posted in Script)

k245 wrote:
chartcatuser wrote:

Hello everyone, how can I find out in the computational field that checkbox = Null?
(select count(*) from table where checkbox = -1) ?

By default, the field with checkboxes is not stored in the database, but you can create a field for storing checkers yourself and use a script to set or write the state of checkers to the database. Then you will be able to extract data about their health status from the database.


Well, then tell me, I have a dashboard and it shows open deals, closed deals, and now I want to add NULL - they are waiting for how to implement this? Despite the fact that I have open = 1 closed 0, everything counts the computational field

40

(19 replies, posted in Script)

Hello everyone, how can I find out in the computational field that checkbox = Null?
(select count(*) from table where checkbox = -1) ?

41

(3 replies, posted in Reports)

I got something like, but I don’t know how to Display all id_employees records from the bsm_off table for a certain period and so that it includes the checkbox bsm_off.Vidano
Select employees.employees.lastname,
   Total(bsm_off.cost),Total(bsm_off.inn),
   
   Total((bsm_off.cost * bsm_off.inn))
From bsm_off
Left Join employees On employees.id = bsm_off.id_employees
Left Join orderproduct On orderproduct.id = bsm_off.id_orderproduct
Group By bsm_off.orderproduct

42

(3 replies, posted in Reports)

There are 4 tables:
Help with the selection of records..
I need the report to contain all records for example from 1.07 -10.07 that have the status in checkbox =1 and for each ID the price was calculated in just 10 days.
bsm_off table:
cost - price
inn - qty
date - date
id_employees - person id
id_orderproduct - order id
(the checkbox status is bsm_off.Vidano)
All products id_employees for a month are recorded in this table, but the selection must be made based on the status of combobox =1

How to make a request correctly, I've been suffering for a month, I've tried everything sad

I would like to see this in the report:
lastname total for the period
Mark 350
Sam 652
Max 1150

43

(19 replies, posted in Script)

А как выделить все checkbox в таблице нажав на 1 checkbox который вне таблицы ??

А есть такой вариант как то сделать когда добавляешь например заказ - и указываешь сумму то автоматически на этот заказ создается как бы лицевой счет с этой суммой и когда ты будешь добавлять по этому заказу продукты - то он будет уменьшаться и когда дойдет до 0 сообщение или если не дошел до 0 то тоже сообщение есть пример? Помогите пожалуйста..

Или допустим ты казала в колонке G - 10  а в колонке H всего 9 и перед тем как выйти с другой формы - ошибка  ну тоесть это альтернативный вариант подсчета остатка в таблице... Как это реализовать?

Смотрите что получилось я добавил вычислительные поля...
Вот как сделать так чтоб если строка G и строка H соответствовали 10 то сообщение готово если больше 10 в H то ошибка ?

Ну кнопкой записываются 10 записей в отдельную таблицу а вот как создать условие что если 11-я запись будет или 9 то ошибка....Долго страдаю уже>....

48

(7 replies, posted in Russian)

derek wrote:

Это то, что тебе надо?
Derek.

спасибо Как всегда работает )

49

(7 replies, posted in Russian)

А вот ты в курсе как на кнопке поиска сортировать три столбца Сначало 2 потом 1 (по алфавиту) и 3 (с конца алфавита) вэто только SQL запросом ?

50

(7 replies, posted in Russian)

k245 wrote:

chartcatuser, ..и опять нужно угадать, что у вас в проекте творится? smile

Да нет я разобрался сделал все скриптами )
Оказалось идентификатор таблицы у меня не соответствовал, вообщем пришлось скриптами )