Subject | Invalidate SessionProps? |
---|---|
Author | Magnus Johansson |
Post date | 2003-07-01T18:18:55Z |
Hi.
D7, 4.2.Ib
Is there any way to get controls settings (color and enabled state) updated
to reflect changes when EditSQL changes in the bound TIB_Query and the
querys state already is dssEdit or dssInsert?
As an example: Depending of CustomerType, only one of the TIB_Edit controls
should be used for entering names. Yellow/White, Enabled or not.
procedure TCustomerForm.QM_CustomerBeforeEdit(IB_Dataset: TIB_Dataset);
begin
QM_CustomerBuildEditSQL;
end;
procedure TCustomerForm.QL_CustomerTypeAfterScroll(IB_Dataset: TIB_Dataset);
begin
if QM_Customer.State = dssEdit then QM_CustomerBuildEditSQL;
end;
procedure TCustomerForm.QM_CustomerBuildEditSQL;
begin
QM_Customer.EditSQL.Clear;
QM_Customer.EditSQL.Add('EXECUTE PROCEDURE CUSTOMER_U (');
QM_Customer.EditSQL.Add(' :OLD_CUSTOMERKEY');
QM_Customer.EditSQL.Add(', :CUSTOMERTYPEKEY');
if (QL_CustomerType.FieldByName('CUSTOMERTYPEKEY').AsSmallint =
cCustomerType_Private) then
begin
QM_Customer.EditSQL.Add(', :PRIVATE_NAME');
QM_Customer.EditSQL.Add(', NULL');
end
else
begin
QM_Customer.EditSQL.Add(', NULL');
QM_Customer.EditSQL.Add(', :COMPANY_NAME');
end;
QM_Customer.EditSQL.Add(')');
end;
Thanks, Magnus
D7, 4.2.Ib
Is there any way to get controls settings (color and enabled state) updated
to reflect changes when EditSQL changes in the bound TIB_Query and the
querys state already is dssEdit or dssInsert?
As an example: Depending of CustomerType, only one of the TIB_Edit controls
should be used for entering names. Yellow/White, Enabled or not.
procedure TCustomerForm.QM_CustomerBeforeEdit(IB_Dataset: TIB_Dataset);
begin
QM_CustomerBuildEditSQL;
end;
procedure TCustomerForm.QL_CustomerTypeAfterScroll(IB_Dataset: TIB_Dataset);
begin
if QM_Customer.State = dssEdit then QM_CustomerBuildEditSQL;
end;
procedure TCustomerForm.QM_CustomerBuildEditSQL;
begin
QM_Customer.EditSQL.Clear;
QM_Customer.EditSQL.Add('EXECUTE PROCEDURE CUSTOMER_U (');
QM_Customer.EditSQL.Add(' :OLD_CUSTOMERKEY');
QM_Customer.EditSQL.Add(', :CUSTOMERTYPEKEY');
if (QL_CustomerType.FieldByName('CUSTOMERTYPEKEY').AsSmallint =
cCustomerType_Private) then
begin
QM_Customer.EditSQL.Add(', :PRIVATE_NAME');
QM_Customer.EditSQL.Add(', NULL');
end
else
begin
QM_Customer.EditSQL.Add(', NULL');
QM_Customer.EditSQL.Add(', :COMPANY_NAME');
end;
QM_Customer.EditSQL.Add(')');
end;
Thanks, Magnus