TfrmSelGuest

简介: unit ufrmSelGuest; interface uses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, ufrmBsGridSelect, cxStyles, ...

unit ufrmSelGuest;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ufrmBsGridSelect, cxStyles, cxCustomData, cxGraphics, cxFilter,
  cxData, cxDataStorage, cxEdit, DB, cxDBData, DBClient, mfDBClient,
  ActnList, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
  cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid,
  ComCtrls, ToolWin, mfFieldCentre, mfGridColCreator, mfDevGridColCreator,
  mfDBSearchMgr, mfBsFormCmptMgr, mfFormCmptMgr, StdCtrls, ExtCtrls,
  mfQueryCtrlsCreator, mfDevQueryCtrlsCreator, mfMovePanel, cxCheckBox,
  cxContainer;

type
  TfrmSelGuest = class(TfrmBsGridSelect)
    procedure FormCreate(Sender: TObject);
    procedure FormMgrPrepare(Sender: TObject);
    procedure QueryCreatorGetQueryCondition(AQueryItem: TmfQueryCtrlsItem;
      var vCondi: string; var vProcessed: Boolean);
  private
    function GetProviderChecker: Integer;
    function GetCustChecker: Integer;
    function GetBrotherChecker: Integer;
    procedure SetProviderChecker(const AValue: Integer);
    procedure SetCustChecker(const AValue: Integer);
    procedure SetBrotherChecker(const AValue: Integer);
    { Private declarations }
  public
    property ProviderChecker: Integer read GetProviderChecker write
      SetProviderChecker;
    property CustChecker: Integer read GetCustChecker write SetCustChecker;
    property BrotherChecker: Integer read GetBrotherChecker write SetBrotherChecker;
    { Public declarations }


  end;

var
  frmSelGuest: TfrmSelGuest;

implementation

{$R *.dfm}

procedure TfrmSelGuest.FormCreate(Sender: TObject);
begin
  inherited;
  fdcMain.Open;
  gccMain.Open;
end;

procedure TfrmSelGuest.FormMgrPrepare(Sender: TObject);
var
  AIsRefresh: Boolean;
begin
  AIsRefresh := false;
  //if FOleParams.FieldExists('Provi') then
  if FOleParams.IntegerValue['Provi'] <> ProviderChecker then
  begin
    ProviderChecker := FOleParams.IntegerValue['Provi'];
    AIsRefresh := true;
  end;
 // if FOleParams.FieldExists('Cust') then
  if FOleParams.IntegerValue['Cust'] <> CustChecker then
  begin
    CustChecker := FOleParams.IntegerValue['Cust'];
    AIsRefresh := true;
  end;

  //if FOleParams.FieldExists('Brother') then
  if FOleParams.IntegerValue['Brother'] <> BrotherChecker then
  begin
    BrotherChecker := FOleParams.IntegerValue['Brother'];
    AIsRefresh := true;
  end;
  if not cdsMain.Active or AIsRefresh then actRefresh.Execute;
end;

function TfrmSelGuest.GetProviderChecker: Integer;
var
  ACheckBox: TcxCheckBox;
begin
  Result := -1;
  if Assigned(QueryCreator.FindItemByFieldName('FGongYingShang')) then
  begin
    QueryCreator.FindItemByFieldName('FGongYingShang').Reset;
    ACheckBox := TcxCheckBox(QueryCreator.FindItemByFieldName('FGongYingShang').NextValueCtrl);
    if Assigned(ACheckBox) then
      case ACheckBox.State of
        cbsUnchecked: Result := 0;
        cbsChecked: Result := 1;
        cbsGrayed: Result := -1;
      end;
  end;
end;

function TfrmSelGuest.GetCustChecker: Integer;
var
  ACheckBox: TcxCheckBox;
begin
  Result := -1;
  if Assigned(QueryCreator.FindItemByFieldName('FKeHu')) then
  begin
    QueryCreator.FindItemByFieldName('FKeHu').Reset;
    ACheckBox := TcxCheckBox(QueryCreator.FindItemByFieldName('FKeHu').NextValueCtrl);
    if Assigned(ACheckBox) then
      case ACheckBox.State of
        cbsUnchecked: Result := 0;
        cbsChecked: Result := 1;
        cbsGrayed: Result := -1;
      end;
  end;
end;

function TfrmSelGuest.GetBrotherChecker: Integer;
var
  ACheckBox: TcxCheckBox;
begin
  Result := -1;
  if Assigned(QueryCreator.FindItemByFieldName('FTongHang')) then
  begin
    QueryCreator.FindItemByFieldName('FTongHang').Reset;
    ACheckBox := TcxCheckBox(QueryCreator.FindItemByFieldName('FTongHang').NextValueCtrl);
    if Assigned(ACheckBox) then
      case ACheckBox.State of
        cbsUnchecked: Result := 0;
        cbsChecked: Result := 1;
        cbsGrayed: Result := -1;
      end;
  end;
end;

procedure TfrmSelGuest.SetProviderChecker(const AValue: Integer);
var
  ACheckBox: TcxCheckBox;
begin
  if Assigned(QueryCreator.FindItemByFieldName('FGongYingShang')) then
  begin
    QueryCreator.FindItemByFieldName('FGongYingShang').Reset;
    ACheckBox := TcxCheckBox(QueryCreator.FindItemByFieldName('FGongYingShang').NextValueCtrl);
    if Assigned(ACheckBox) then
      case AValue of
        0: ACheckBox.State := cbsUnchecked;
        1: ACheckBox.State := cbsChecked;
        -1: ACheckBox.State := cbsGrayed;
      end;
  end;
end;

procedure TfrmSelGuest.SetCustChecker(const AValue: Integer);
var
  ACheckBox: TcxCheckBox;
begin
  if Assigned(QueryCreator.FindItemByFieldName('FKeHu')) then
  begin
    QueryCreator.FindItemByFieldName('FKeHu').Reset;
    ACheckBox := TcxCheckBox(QueryCreator.FindItemByFieldName('FKeHu').NextValueCtrl);
    if Assigned(ACheckBox) then
      case AValue of
        0: ACheckBox.State := cbsUnchecked;
        1: ACheckBox.State := cbsChecked;
        -1: ACheckBox.State := cbsGrayed;
      end;
  end;
end;

procedure TfrmSelGuest.SetBrotherChecker(const AValue: Integer);
var
  ACheckBox: TcxCheckBox;
begin
  if Assigned(QueryCreator.FindItemByFieldName('FTongHang')) then
  begin
    QueryCreator.FindItemByFieldName('FTongHang').Reset;
    ACheckBox := TcxCheckBox(QueryCreator.FindItemByFieldName('FTongHang').NextValueCtrl);
    if Assigned(ACheckBox) then
      case AValue of
        0: ACheckBox.State := cbsUnchecked;
        1: ACheckBox.State := cbsChecked;
        -1: ACheckBox.State := cbsGrayed;
      end;
  end;
end;

procedure TfrmSelGuest.QueryCreatorGetQueryCondition(
  AQueryItem: TmfQueryCtrlsItem; var vCondi: string;
  var vProcessed: Boolean);
var
  ACheckBox: TcxCheckBox;
begin
  vProcessed := True;

  if AQueryItem.FieldDataObject.FieldName = 'FKeHu' then
  begin
    ACheckBox := TcxCheckBox(AQueryItem.FirstValueCtrl);
    if Assigned(ACheckBox) then
      if ACheckBox.Checked then vCondi := 'FKeHu = 1';
  end else if AQueryItem.FieldDataObject.FieldName = 'FGongYingShang' then
  begin
    ACheckBox := TcxCheckBox(AQueryItem.FirstValueCtrl);
    if Assigned(ACheckBox) then
      if ACheckBox.Checked then vCondi := 'FGongYingShang = 1';
  end else if AQueryItem.FieldDataObject.FieldName = 'FTongHang' then
  begin
    ACheckBox := TcxCheckBox(AQueryItem.FirstValueCtrl);
    if Assigned(ACheckBox) then
      if ACheckBox.Checked then vCondi := 'FTongHang = 1';
  end else
    vProcessed := false;

 

end;

end.

目录
相关文章
老生常谈:MySQL高可用架构
“高可用”是互联网一个永恒的话题,先避开MySQL不谈,为了保证各种服务的高可用有几种常用的解决方案。 服务冗余:把服务部署多份,当某个节点不可用时,切换到其他节点。服务冗余对于无状态的服务是相对容易的。 服务备份:有些服务是无法同时存在多个运行时的,比如说:Nginx的反向代理,一些集群的leader节点。这时可以存在一个备份服务,处于随时待命状态。 自动切换:服务冗余之后,当某个节点不可用时,要做到快速切换。 总结起来就是 冗余+故障转移 。
|
8月前
|
前端开发 Cloud Native 持续交付
在云原生时代,如何构建高效的前端开发流程
【2月更文挑战第2天】随着云原生技术的快速发展,前端开发也面临着新的挑战和机遇。本文将介绍如何构建高效的前端开发流程,在保证代码质量和团队协作的同时,提高开发效率和用户体验。从项目规划、技术选型、团队协作到持续集成和部署,我们将探讨一系列的最佳实践和工具,帮助前端开发者更好地应对云原生时代的挑战。
|
8月前
|
Web App开发 Linux Android开发
Chrome谷歌浏览器的WeChat微信模拟器,既可以设置模拟很多型号的手机设备Mozilla
Chrome谷歌浏览器的WeChat微信模拟器,既可以设置模拟很多型号的手机设备Mozilla
|
8月前
|
Java Maven
maven配置settings.xml以及maven常用仓库
maven配置settings.xml以及maven常用仓库
939 0
|
8月前
|
存储 前端开发 JavaScript
web前端面试十大 难点问题
web前端面试十大 难点问题
130 1
|
存储 Java 数据库连接
JDBC中MetaData对象使用与详解
JDBC中MetaData对象使用与详解
207 0
|
XML Java 程序员
浅谈BaseActivity写法,促使我们更高效开发
浅谈Bas浅谈BaseActivity写法,促使我们更高效开发
265 0
|
NoSQL MongoDB 数据库
MongoDB 创建集合
MongoDB 创建集合
515 0
|
Web App开发 tengine 编解码
通过ffplay播放OSS上的mp3文件会断开
抽丝剥茧定位一个疑难问题。
824 1