ผู้เขียน หัวข้อ: สำหรับ การตรวจแรงงานต่างด้าวจังหวัดกาญจนบุรี ระบบส่งรายงาน  (อ่าน 4132 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

doramon

  • บุคคลทั่วไป
สำหรับ การตรวจแรงงานต่างด้าวจังหวัดกาญจนบุรี  ระบบส่งรายงาน

DFM

โค๊ด: Delphi
  1. object Form1: TForm1
  2.   Left = 0
  3.   Top = 0
  4.   Caption = #3619#3632#3610#3610#3626#3656#3591#3586#3657#3629#3617#3641#3621#3588#3656#3634#3651#3594#3657#3592#3656#3634#3618#3649#3618#3585#3626#3636#3607#3608#3636
  5.   ClientHeight = 521
  6.   ClientWidth = 766
  7.   Color = clBtnFace
  8.   Font.Charset = DEFAULT_CHARSET
  9.   Font.Color = clWindowText
  10.   Font.Height = -11
  11.   Font.Name = 'Tahoma'
  12.   Font.Style = []
  13.   OldCreateOrder = False
  14.   OnCreate = FormCreate
  15.   DesignSize = (
  16.     766
  17.     521)
  18.   PixelsPerInch = 96
  19.   TextHeight = 13
  20.   object Bevel1: TBevel
  21.     Left = 480
  22.     Top = 12
  23.     Width = 283
  24.     Height = 178
  25.     Shape = bsFrame
  26.   end
  27.   object Label6: TLabel
  28.     Left = 487
  29.     Top = 21
  30.     Width = 37
  31.     Height = 13
  32.     Caption = #3594#3656#3623#3591#3623#3633#3609#3607#3637#3656
  33.   end
  34.   object Label7: TLabel
  35.     Left = 637
  36.     Top = 21
  37.     Width = 11
  38.     Height = 13
  39.     Caption = #3606#3638#3591
  40.   end
  41.   object GroupBox1: TGroupBox
  42.     Left = 8
  43.     Top = 8
  44.     Width = 470
  45.     Height = 182
  46.     Caption = #3611#3619#3632#3648#3616#3607#3626#3636#3607#3608#3636
  47.     TabOrder = 0
  48.     object PttypeCombobox1: TComboBox
  49.       Left = 111
  50.       Top = 18
  51.       Width = 343
  52.       Height = 21
  53.       Style = csDropDownList
  54.       ItemHeight = 13
  55.       TabOrder = 0
  56.     end
  57.     object PttypeCombobox2: TComboBox
  58.       Left = 111
  59.       Top = 45
  60.       Width = 343
  61.       Height = 21
  62.       Style = csDropDownList
  63.       ItemHeight = 13
  64.       TabOrder = 1
  65.     end
  66.     object PttypeCombobox3: TComboBox
  67.       Left = 111
  68.       Top = 72
  69.       Width = 280
  70.       Height = 21
  71.       Style = csDropDownList
  72.       ItemHeight = 13
  73.       TabOrder = 2
  74.     end
  75.     object PttypeButton: TButton
  76.       Left = 395
  77.       Top = 72
  78.       Width = 62
  79.       Height = 21
  80.       Caption = #3648#3614#3636#3656#3617
  81.       TabOrder = 3
  82.       OnClick = PttypeButtonClick
  83.     end
  84.     object PttypeListBox: TListBox
  85.       Left = 111
  86.       Top = 99
  87.       Width = 280
  88.       Height = 70
  89.       ItemHeight = 13
  90.       TabOrder = 4
  91.     end
  92.     object Button1: TButton
  93.       Left = 395
  94.       Top = 99
  95.       Width = 62
  96.       Height = 21
  97.       Caption = 'Clear'
  98.       TabOrder = 5
  99.       OnClick = Button1Click
  100.     end
  101.     object RadioButton1: TRadioButton
  102.       Left = 11
  103.       Top = 20
  104.       Width = 76
  105.       Height = 17
  106.       Caption = #3619#3632#3610#3640#3594#3639#3656#3629#3626#3636#3607#3608#3636
  107.       Checked = True
  108.       TabOrder = 6
  109.       TabStop = True
  110.     end
  111.     object RadioButton2: TRadioButton
  112.       Left = 11
  113.       Top = 47
  114.       Width = 89
  115.       Height = 17
  116.       Caption = #3619#3632#3610#3640#3627#3617#3623#3604#3626#3636#3607#3608#3636
  117.       TabOrder = 7
  118.     end
  119.     object RadioButton3: TRadioButton
  120.       Left = 11
  121.       Top = 73
  122.       Width = 89
  123.       Height = 17
  124.       Caption = #3619#3632#3610#3640#3585#3621#3640#3656#3617#3626#3636#3607#3608#3636
  125.       TabOrder = 8
  126.     end
  127.   end
  128.   object GroupBox3: TGroupBox
  129.     Left = 373
  130.     Top = 194
  131.     Width = 234
  132.     Height = 92
  133.     Caption = #3619#3627#3633#3626#3626#3606#3634#3609#3614#3618#3634#3610#3634#3621
  134.     TabOrder = 1
  135.     object Label4: TLabel
  136.       Left = 12
  137.       Top = 21
  138.       Width = 40
  139.       Height = 13
  140.       Caption = #3619#3627#3633#3626#3627#3621#3633#3585
  141.     end
  142.     object Label5: TLabel
  143.       Left = 12
  144.       Top = 49
  145.       Width = 36
  146.       Height = 13
  147.       Caption = #3619#3627#3633#3626#3619#3629#3591
  148.     end
  149.     object HospcodeEdit1: TEdit
  150.       Left = 81
  151.       Top = 18
  152.       Width = 121
  153.       Height = 21
  154.       TabOrder = 0
  155.     end
  156.     object HospcodeEdit2: TEdit
  157.       Left = 81
  158.       Top = 45
  159.       Width = 121
  160.       Height = 21
  161.       TabOrder = 1
  162.     end
  163.   end
  164.   object Button2: TButton
  165.     Left = 676
  166.     Top = 51
  167.     Width = 75
  168.     Height = 25
  169.     Caption = #3649#3626#3604#3591#3586#3657#3629#3617#3641#3621
  170.     TabOrder = 2
  171.     OnClick = Button2Click
  172.   end
  173.   object DBGrid1: TDBGrid
  174.     Left = 8
  175.     Top = 292
  176.     Width = 743
  177.     Height = 198
  178.     Anchors = [akLeft, akTop, akRight, akBottom]
  179.     DataSource = ds
  180.     TabOrder = 3
  181.     TitleFont.Charset = DEFAULT_CHARSET
  182.     TitleFont.Color = clWindowText
  183.     TitleFont.Height = -11
  184.     TitleFont.Name = 'Tahoma'
  185.     TitleFont.Style = []
  186.     Columns = <
  187.       item
  188.         Expanded = False
  189.         FieldName = 'hn'
  190.         Title.Caption = #3621#3635#3604#3633#3610
  191.         Visible = True
  192.       end
  193.  
  194.       item
  195.         Expanded = False
  196.         FieldName = 'cid'
  197.         Title.Caption = 'CID'
  198.         Visible = True
  199.       end
  200.  
  201.  
  202.  
  203.       item
  204.         Expanded = False
  205.         FieldName = 'name'
  206.         Title.Caption = #3594#3639#3656#3629
  207.         Width = 144
  208.         Visible = True
  209.       end
  210.  
  211.       item
  212.         Expanded = False
  213.         FieldName = 'birthday'
  214.         Title.Caption = 'birthday'
  215.         Width = 144
  216.         Visible = True
  217.       end
  218.  
  219.      item
  220.         Expanded = False
  221.         FieldName = 'sex_name'
  222.         Title.Caption = #3648#3614#3624
  223.         Visible = True
  224.       end
  225.  
  226.  
  227.  
  228.       item
  229.         Expanded = False
  230.         FieldName = 'nation'
  231.         Title.Caption = 'nation'
  232.         Width = 144
  233.         Visible = True
  234.       end
  235.  
  236.       item
  237.         Expanded = False
  238.         FieldName = 'hn'
  239.         Title.Caption = 'HN'
  240.         Visible = True
  241.       end
  242.  
  243.  
  244.       item
  245.         Expanded = False
  246.         FieldName = 'house'
  247.         Title.Caption = 'house'
  248.         Width = 144
  249.         Visible = True
  250.       end
  251.  
  252.       item
  253.         Expanded = False
  254.         FieldName = 'village'
  255.         Title.Caption = 'village'
  256.         Width = 144
  257.         Visible = True
  258.       end
  259.  
  260.       item
  261.         Expanded = False
  262.         FieldName = 'tambon'
  263.         Title.Caption = 'tambon'
  264.         Width = 144
  265.         Visible = True
  266.       end
  267.  
  268.        item
  269.         Expanded = False
  270.         FieldName = 'ampur'
  271.         Title.Caption = 'ampur'
  272.         Width = 144
  273.         Visible = True
  274.       end
  275.  
  276.        item
  277.         Expanded = False
  278.         FieldName = 'province'
  279.         Title.Caption = 'province'
  280.         Width = 144
  281.         Visible = True
  282.       end
  283.  
  284.       item
  285.         Expanded = False
  286.         FieldName = 'vstdate'
  287.         Title.Caption = 'cdate'
  288.         Visible = True
  289.       end
  290.  
  291.  
  292.         item
  293.         Expanded = False
  294.         FieldName = 'receipt1'
  295.         Title.Caption = 'receipt1'
  296.         Width = 144
  297.         Visible = True
  298.       end
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.         item
  306.         Expanded = False
  307.         FieldName = 'employer'
  308.         Title.Caption = 'employer'
  309.         Width = 144
  310.         Visible = True
  311.       end
  312.  
  313.  
  314.  
  315.  
  316.       item
  317.         Expanded = False
  318.         FieldName = 'pttypeno'
  319.         Title.Caption = 'Card No'
  320.         Visible = True
  321.       end
  322.       item
  323.         Expanded = False
  324.         FieldName = 'age_y'
  325.         Title.Caption = #3629#3634#3618#3640
  326.         Visible = True
  327.       end
  328.  
  329.       item
  330.         Expanded = False
  331.         FieldName = 'pdx'
  332.         Title.Caption = 'ICD10'
  333.         Visible = True
  334.       end
  335.       item
  336.         Expanded = False
  337.         FieldName = 'op0'
  338.         Title.Caption = 'ICD9'
  339.         Visible = True
  340.       end
  341.       item
  342.         Expanded = False
  343.         FieldName = 'inc01'
  344.         Title.Caption = #3594#3633#3609#3626#3641#3605#3619
  345.         Visible = True
  346.       end
  347.       item
  348.         Expanded = False
  349.         FieldName = 'inc02'
  350.         Title.Caption = #3619#3633#3591#3626#3633#3623#3636#3607#3618#3634
  351.         Visible = True
  352.       end
  353.       item
  354.         Expanded = False
  355.         FieldName = 'inc03'
  356.         Title.Caption = #3605#3619#3623#3592#3623#3636#3609#3636#3592#3593#3633#3618#3629#3639#3609#3654
  357.         Width = 99
  358.         Visible = True
  359.       end
  360.       item
  361.         Expanded = False
  362.         FieldName = 'inc04'
  363.         Title.Caption = #3612#3656#3634#3605#3633#3604
  364.         Visible = True
  365.       end
  366.       item
  367.         Expanded = False
  368.         FieldName = 'inc05'
  369.         Title.Caption = #3619#3632#3591#3633#3610#3588#3623#3634#3617#3619#3641#3657#3626#3638#3585
  370.         Width = 85
  371.         Visible = True
  372.       end
  373.       item
  374.         Expanded = False
  375.         FieldName = 'inc06'
  376.         Title.Caption = #3629#3640#3611#3585#3619#3603#3660#3610#3635#3610#3633#3604#3650#3619#3588
  377.         Width = 77
  378.         Visible = True
  379.       end
  380.       item
  381.         Expanded = False
  382.         FieldName = 'inc07'
  383.         Title.Caption = #3648#3588#3617#3637#3610#3635#3610#3633#3604
  384.         Visible = True
  385.       end
  386.       item
  387.         Expanded = False
  388.         FieldName = 'inc08'
  389.         Title.Caption = #3619#3633#3591#3626#3637#3619#3633#3585#3625#3634
  390.         Visible = True
  391.       end
  392.       item
  393.         Expanded = False
  394.         FieldName = 'inc09'
  395.         Title.Caption = #3618#3634#3649#3621#3632#3648#3623#3594#3616#3633#3603#3601#3660
  396.         Width = 79
  397.         Visible = True
  398.       end
  399.       item
  400.         Expanded = False
  401.         FieldName = 'inc10'
  402.         Title.Caption = #3648#3623#3594#3615#3639#3657#3609#3615#3641
  403.         Visible = True
  404.       end
  405.       item
  406.         Expanded = False
  407.         FieldName = 'inc11'
  408.         Title.Caption = #3610#3635#3610#3633#3604#3619#3633#3585#3625#3634#3629#3639#3656#3609#3654
  409.         Width = 88
  410.         Visible = True
  411.       end
  412.       item
  413.         Expanded = False
  414.         FieldName = 'inc12'
  415.         Title.Caption = #3619#3623#3617#3607#3633#3657#3591#3626#3636#3657#3609
  416.         Visible = True
  417.       end>
  418.   end
  419.   object Button3: TButton
  420.     Left = 676
  421.     Top = 82
  422.     Width = 75
  423.     Height = 25
  424.     Caption = #3626#3656#3591#3629#3629#3585' Excel'
  425.     TabOrder = 4
  426.     OnClick = Button3Click
  427.   end
  428.   object Button4: TButton
  429.     Left = 676
  430.     Top = 113
  431.     Width = 75
  432.     Height = 25
  433.     Caption = #3614#3636#3617#3614#3660
  434.     TabOrder = 5
  435.   end
  436.   object GroupBox4: TGroupBox
  437.     Left = 8
  438.     Top = 196
  439.     Width = 197
  440.     Height = 90
  441.     Caption = #3648#3591#3639#3656#3629#3609#3652#3586' '#3607#3637#3656#3605#3657#3629#3591#3585#3634#3619#3619#3632#3610#3640' '#3648#3614#3636#3656#3617#3648#3605#3636#3617
  442.     TabOrder = 6
  443.     object CheckBox2: TCheckBox
  444.       Left = 11
  445.       Top = 21
  446.       Width = 97
  447.       Height = 17
  448.       Caption = #3611#3619#3632#3648#3616#3607#3651#3609#3648#3586#3605
  449.       TabOrder = 0
  450.     end
  451.     object CheckBox3: TCheckBox
  452.       Left = 11
  453.       Top = 39
  454.       Width = 140
  455.       Height = 17
  456.       Caption = #3619#3627#3633#3626#3626#3606#3634#3609#3614#3618#3634#3610#3634#3621
  457.       TabOrder = 1
  458.     end
  459.   end
  460.   object cxDateEdit1: TcxDateEdit
  461.     Left = 530
  462.     Top = 18
  463.     TabOrder = 7
  464.     Width = 104
  465.   end
  466.   object cxDateEdit2: TcxDateEdit
  467.     Left = 654
  468.     Top = 18
  469.     TabOrder = 8
  470.     Width = 100
  471.   end
  472.   object RadioGroup2: TRadioGroup
  473.     Left = 211
  474.     Top = 196
  475.     Width = 156
  476.     Height = 90
  477.     Caption = #3611#3619#3632#3648#3616#3607#3651#3609#3648#3586#3605
  478.     ItemIndex = 0
  479.     Items.Strings = (
  480.       #3652#3617#3656#3619#3632#3610#3640
  481.       #3651#3609#3648#3586#3605
  482.       #3609#3629#3585#3648#3586#3605)
  483.     TabOrder = 9
  484.   end
  485.   object PG: TProgressBar
  486.     Left = 8
  487.     Top = 496
  488.     Width = 528
  489.     Height = 17
  490.     Anchors = [akLeft, akBottom]
  491.     TabOrder = 10
  492.   end
  493.   object cds: TClientDataSet
  494.     Aggregates = <>
  495.     Params = <>
  496.     Left = 405
  497.     Top = 141
  498.   end
  499.   object ds: TDataSource
  500.     DataSet = cds
  501.     Left = 438
  502.     Top = 141
  503.   end
  504. end
  505.  
  506.  
  507.  

pas
โค๊ด: Delphi
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls, DB, DBClient, Grids, DBGrids, cxControls, cxContainer,
  8.   cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar, ExtCtrls, ComCtrls;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     GroupBox1: TGroupBox;
  13.     GroupBox3: TGroupBox;
  14.     PttypeCombobox1: TComboBox;
  15.     PttypeCombobox2: TComboBox;
  16.     PttypeCombobox3: TComboBox;
  17.     PttypeButton: TButton;
  18.     PttypeListBox: TListBox;
  19.     Label4: TLabel;
  20.     Label5: TLabel;
  21.     HospcodeEdit1: TEdit;
  22.     HospcodeEdit2: TEdit;
  23.     Button2: TButton;
  24.     DBGrid1: TDBGrid;
  25.     cds: TClientDataSet;
  26.     ds: TDataSource;
  27.     Button3: TButton;
  28.     Button4: TButton;
  29.     GroupBox4: TGroupBox;
  30.     CheckBox2: TCheckBox;
  31.     CheckBox3: TCheckBox;
  32.     Label6: TLabel;
  33.     cxDateEdit1: TcxDateEdit;
  34.     Label7: TLabel;
  35.     cxDateEdit2: TcxDateEdit;
  36.     Button1: TButton;
  37.     RadioGroup2: TRadioGroup;
  38.     PG: TProgressBar;
  39.     RadioButton1: TRadioButton;
  40.     RadioButton2: TRadioButton;
  41.     RadioButton3: TRadioButton;
  42.     Bevel1: TBevel;
  43.     procedure Button2Click(Sender: TObject);
  44.     procedure FormCreate(Sender: TObject);
  45.     procedure PttypeButtonClick(Sender: TObject);
  46.     procedure Button1Click(Sender: TObject);
  47.     procedure Button3Click(Sender: TObject);
  48.   private
  49.     { Private declarations }
  50.     procedure ProcessIncome(field_name, income_group: string);
  51.   public
  52.     { Public declarations }
  53.   end;
  54.  
  55. var
  56.   Form1: TForm1;
  57.   pttype_cri: string;
  58.   i: integer; s: string;
  59.   paidst_cri: string;
  60.   region_cri : string;
  61.   hospcode_cri : string;
  62.  
  63. implementation
  64.  
  65. {$R *.dfm}
  66.  
  67. procedure TForm1.ProcessIncome(field_name, income_group: string);
  68. begin
  69.   cds.fieldbyname(field_name).asfloat := 0;
  70.   try
  71.     cds.fieldbyname(field_name).asfloat := getsqldata('select sum(rcptamt) as cc from incoth where vn = "' +
  72.       cds.fieldbyname('vn').asstring + '" and paidst in (' + paidst_cri + ') and income in (select income from income where income_group in (' + income_group + ')) ');
  73.   except end;
  74. end;
  75.  
  76. procedure TForm1.Button1Click(Sender: TObject);
  77. begin
  78.   pttypelistbox.items.clear;
  79. end;
  80.  
  81. procedure TForm1.Button2Click(Sender: TObject);
  82. begin
  83.  
  84.   pttype_cri := '';
  85.  
  86.  
  87.   if radiobutton1.checked then
  88.   begin
  89.     pttype_cri := ' and v.pttype = "' +
  90.       vartostr(getsqldata('select pttype from pttype where name = "' + pttypecombobox1.text + '"')) + '" ';
  91.   end else
  92.     if radiobutton2.checked then
  93.     begin
  94.       pttype_cri := ' and v.pcode = "' +
  95.         vartostr(getsqldata('select code from pcode where name = "' + pttypecombobox2.text + '"')) + '" ';
  96.     end else
  97.       if radiobutton3.checked then
  98.       begin
  99.         s := '';
  100.         for i := 0 to pttypelistbox.items.count - 1 do
  101.         begin
  102.           if s = '' then s := '"' + vartostr(getsqldata('select pttype from pttype where name = "' + pttypelistbox.items[i] + '"')) + '"' else
  103.             s := s + ',"' + vartostr(getsqldata('select pttype from pttype where name = "' + pttypelistbox.items[i] + '"')) + '"';
  104.         end;
  105.  
  106.         pttype_cri := ' and v.pttype in (' + s + ') ';
  107.       end;
  108.  
  109.  
  110.   region_cri := '';
  111.   if checkbox2.checked then
  112.   begin
  113.     if radiogroup2.itemindex=1 then
  114.     region_cri := ' and v.pttype_in_region = "Y"' else
  115.     if radiogroup2.itemindex=2 then
  116.     region_cri := ' and v.pttype_in_region = "N" ';
  117.   end;
  118.  
  119.   hospcode_cri := '';
  120.   if checkbox3.checked then
  121.   begin
  122.     if hospcodeedit1.text<>'' then
  123.     hospcode_cri :=' and v.hospmain = "'+hospcodeedit1.text+'" ';
  124.  
  125.     if hospcodeedit2.text<>'' then
  126.     begin
  127.       hospcode_cri := hospcode_cri + ' and v.hospsub = "'+hospcodeedit2.text+'" ';
  128.  
  129.     end;
  130.   end;
  131.  
  132.  
  133.   button2.enabled := false;
  134.  
  135.   cds.data := HOSxP_GetDataset('select space(3) as no_card,v.cid ,concat(p.pname,p.fname) as name,p.birthday,s.name as sex_name,p.nationality as nation,p.hn,p.hid,p.addrpart as house,p.moopart as village,p.tmbpart as tambon,p.amppart as ampur,p.chwpart as  province,v.vstdate,v.rcpno_list as receipt1,space(5) as receipt2,space(5) as rcode,space(5) as diag,space(5) as fu,concat(p.informname,"/",p.informaddr) as employer' +
  136.     ' from vn_stat v ' +
  137.     ' left outer join patient p on p.hn = v.hn ' +
  138.     ' left outer join sex s on s.code = p.sex ' +
  139.     ' where v.vstdate between "' + formatdatetime('yyyy-mm-dd', cxdateedit1.date) + '" and "' + formatdatetime('yyyy-mm-dd', cxdateedit2.date) + '" ' +
  140.     pttype_cri+' '+region_cri+' '+hospcode_cri);
  141.  
  142.   paidst_cri := '"02"';
  143.  
  144.   pg.position := 0;
  145.   pg.max := cds.recordcount;
  146.  
  147.   cds.first;
  148.   dbgrid1.enabled := false;
  149.   while not cds.eof do
  150.   begin
  151.     pg.position := pg.position + 1;
  152.     cds.edit;
  153. //    cds.fieldbyname('count_in_day').asinteger := cds.recno;
  154.  
  155. //    cds.fieldbyname('inc01').asfloat := 0;
  156. //    cds.fieldbyname('inc02').asfloat := 0;
  157. //    cds.fieldbyname('inc03').asfloat := 0;
  158. //    cds.fieldbyname('inc04').asfloat := 0;
  159. //    cds.fieldbyname('inc05').asfloat := 0;
  160. //    cds.fieldbyname('inc06').asfloat := 0;
  161. //    cds.fieldbyname('inc07').asfloat := 0;
  162. //    cds.fieldbyname('inc08').asfloat := 0;
  163. //    cds.fieldbyname('inc09').asfloat := 0;
  164. //    cds.fieldbyname('inc10').asfloat := 0;
  165. //    cds.fieldbyname('inc11').asfloat := 0;
  166. //    cds.fieldbyname('inc12').asfloat := 0;
  167.  
  168.  
  169.  
  170. //     ProcessIncome('inc01', '"01"');
  171. //     ProcessIncome('inc02', '"04"');
  172.  
  173. //     ProcessIncome('inc04', '"06"');
  174. //     ProcessIncome('inc05', '"07"');
  175. //     ProcessIncome('inc06', '"09"');
  176. //     ProcessIncome('inc07', '"10"');
  177. //     ProcessIncome('inc09', '"12"');
  178.  //    ProcessIncome('inc10', '"13"');
  179. //     ProcessIncome('inc11', '"14"');
  180.  
  181. //     ProcessIncome('inc03', '"02","03","05","08","11","15","16","17"');
  182.  
  183. //     cds.fieldbyname('inc12').asfloat :=
  184. //       cds.fieldbyname('inc01').asfloat +
  185. //       cds.fieldbyname('inc02').asfloat +
  186. //       cds.fieldbyname('inc03').asfloat +
  187. //       cds.fieldbyname('inc04').asfloat +
  188. //       cds.fieldbyname('inc05').asfloat +
  189.  //      cds.fieldbyname('inc06').asfloat +
  190. //       cds.fieldbyname('inc07').asfloat +
  191. //       cds.fieldbyname('inc08').asfloat +
  192. //       cds.fieldbyname('inc09').asfloat +
  193. //       cds.fieldbyname('inc10').asfloat +
  194. //       cds.fieldbyname('inc11').asfloat;
  195.  
  196.  
  197.  
  198.     cds.post;
  199.     cds.next;
  200.   end;
  201.  
  202.  
  203.   cds.first;
  204.   dbgrid1.enabled := true;
  205.  
  206.   button2.enabled := true;
  207.  
  208. end;
  209.  
  210. procedure TForm1.Button3Click(Sender: TObject);
  211. begin
  212.   fcds.data := cds.data;
  213.   ExportDatasetToExcel('nhso.xls');
  214. end;
  215.  
  216. procedure TForm1.FormCreate(Sender: TObject);
  217. var tc: tclientdataset;
  218. begin
  219.  
  220.   tc := tclientdataset.create(nil);
  221.   tc.data := HOSxP_Getdataset('select name from pttype order by name');
  222.   while not tc.eof do
  223.   begin
  224.     pttypecombobox1.items.add(tc.fieldbyname('name').asstring);
  225.     pttypecombobox3.items.add(tc.fieldbyname('name').asstring);
  226.     tc.next;
  227.   end;
  228.  
  229.   tc.data := HOSxP_GetDataset('select name from pcode order by name');
  230.   while not tc.eof do
  231.   begin
  232.     pttypecombobox2.items.add(tc.fieldbyname('name').asstring);
  233.     tc.next;
  234.   end;
  235.  
  236.   tc.free;
  237.  
  238.   cxdateedit1.date := date;
  239.   cxdateedit2.date := date;
  240.  
  241. end;
  242.  
  243. procedure TForm1.PttypeButtonClick(Sender: TObject);
  244. begin
  245.   if pttypecombobox3.text <> '' then
  246.     if pttypelistbox.items.indexof(pttypecombobox3.text) = -1 then
  247.       pttypelistbox.items.add(pttypecombobox3.text);
  248. end;
  249.  
  250. end.
  251.  
  252.  
  253.  

ออฟไลน์ anukul

  • Hero Member
  • *****
  • กระทู้: 1,363
  • Respect: +1
    • ดูรายละเอียด
เรียกใช้ยังไงครับ อ.อ๊อด 

แล้วตอนตรวจสุขภาพ ส่งเป็นสิทธิอะไร ป้อนค่าตรวจเข้า lab x-ray ตามปกติเลยหรือครับ  ทำยังไงให้ค่าตรวจรวมกันเป็น 600 บาท

 ???
รพ.มะการักษ์ 260 เตียง
เริ่มระบบ 1 ธค 48 (ทีม MN)
Database structure :HOSxP 3.55.9.21b
Client : 3.55.6.8-3.55.9.21b
Server : Double QuadCore XEON 3.2 G. ECC 18 G. SAS 146 G x4(Raid 5) -- CentOS 5.3 (64 bit) , MySQL 5.1.30 percana
Client : Win2000 ~ 200 clients
Module :
OPD -Register,Screening,Doctor,Dispense,Billing,Dentist,PMMR
IPD - Admit center,Ward,Nutrition,Dispense,LR,OR
LAB , X-ray
การเชื่อมต่อ : LIS             --> RAX
                    X-ray PACS --> Infinitt (ThaiGL)