Udj.pas
上传用户:jiete_yjc
上传日期:2010-02-11
资源大小:422k
文件大小:2k
源码类别:

医药行业

开发平台:

Delphi

  1. unit Udj;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils,  Classes, Graphics, Controls, Forms,
  5.   Dialogs, StdCtrls, Grids, DBGridEh, ComCtrls, Buttons, 
  6.   DBLookupEh,upreview,udm, DBSumLst, Mask, DBCtrlsEh,  DBCtrls;
  7. type
  8.   Tfdj = class(TForm)
  9.     DBGridEh1: TDBGridEh;
  10.     Label1: TLabel;
  11.     TabControl1: TTabControl;
  12.     TabControl2: TTabControl;
  13.     Label2: TLabel;
  14.     Label4: TLabel;
  15.     Label5: TLabel;
  16.     Label6: TLabel;
  17.     BitBtn3: TBitBtn;
  18.     BitBtn6: TBitBtn;
  19.     bh: TMaskEdit;
  20.     search: TSpeedButton;
  21.     DBEdit1: TDBEdit;
  22.     DBEdit2: TDBEdit;
  23.     DBEdit3: TDBEdit;
  24.     DBText1: TDBText;
  25.     procedure BitBtn3Click(Sender: TObject);
  26.     procedure searchClick(Sender: TObject);
  27.     procedure BitBtn6Click(Sender: TObject);
  28.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  29.     procedure bhExit(Sender: TObject);
  30.   private
  31.     { Private declarations }
  32.   public
  33.     { Public declarations }
  34.   end;
  35. implementation
  36. {$R *.dfm}
  37. procedure Tfdj.BitBtn3Click(Sender: TObject);
  38. begin
  39. close;
  40. end;
  41. procedure Tfdj.searchClick(Sender: TObject);
  42. begin
  43. adodm.tdjsearch.Close;
  44. adodm.tdjsearch.Parameters.ParamByName('bh').Value:=bh.Text;
  45. try
  46. adodm.tdjsearch.Open;
  47. except
  48. end;
  49. if adodm.tdjsearch.RecordCount<=0 then
  50. showmessage('没有找到相应的单据');
  51. end;
  52. procedure Tfdj.BitBtn6Click(Sender: TObject);
  53. begin
  54. if adodm.tdjsearch.active   then
  55. if adodm.tdjsearch.RecordCount>0 then
  56. begin
  57. fpreview.frdj.FindObject('memo1').Memo.Text:='药品'+adodm.tdjsearch.FieldValues['类型']+'单' ;
  58.  fpreview.frdj.ShowReport;
  59.  fpreview.ShowModal;
  60. end;
  61. end;
  62. procedure Tfdj.FormClose(Sender: TObject; var Action: TCloseAction);
  63. begin
  64. action:=cafree;
  65. end;
  66. procedure Tfdj.bhExit(Sender: TObject);
  67. begin
  68. try
  69. search.Click;
  70. except
  71. end;
  72. end;
  73. end.