unitsupdetails.pas ( File view )

  • By 2010-07-16
  • View(s):6
  • Download(s):0
  • Point(s): 1
			unit unitsupdetails;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, ComCtrls, ExtCtrls, StdCtrls, DB;

type
  Tformsupdetails = class(TForm)
    Panel1: TPanel;
    page_sup: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    DBGrid1: TDBGrid;
    DataSourcedetail: TDataSource;
    DataSourceconsumedetail: TDataSource;
    but_add: TButton;
    but_modify: TButton;
    but_exit: TButton;
    DBGrid2: TDBGrid;
    Label1: TLabel;
    lab_supuserid: TLabel;
    procedure but_exitClick(Sender: TObject);
    procedure but_addClick(Sender: TObject);
    procedure DBGrid1CellClick(Column: TColumn);
    procedure DBGrid2CellClick(Column: TColumn);
    procedure TabSheet2Show(Sender: TObject);
    procedure but_modifyClick(Sender: TObject);
    procedure TabSheet1Show(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    {
 Private declarations 
}
  public
    {
 Public declarations 
}
  end;

var
  formsupdetails: Tformsupdetails;

  SQL:string;
  G_sdid,G_scdid:string;    //存储就餐客人明细记录号和用餐消费明细记录号
  pageindex:integer;//0-就餐客人明细 1-就餐消费明细
  statuscolor:Tcolor;  //状态颜色
implementation
       uses unitDMHotel,unitsupmanage,unitsupdetail_data,unitsupconsumedetail_data;
{
$R *.dfm
}

procedure Tformsupdetails.but_exitClick(Sender: TObject);
begin
    close;
end;

procedure Tformsupdetails.but_addClick(Sender: TObject);
begin
    pageindex:=page_sup.ActivePageIndex;
    //就餐客人明细
    if  pageindex=0   then
            //打开录入窗口
            formsupdetail_data.ShowModal
    //就餐消费明细
    else
        begin
            //如果没有选定客人就餐记录,不能添加就餐消费记录
            if G_sdid='' then
               begin
                   showmessage('请选选择客人就餐记录!');
                   exit;
               end;
               
            //打开录入窗口
            formsupconsumedetail_data.ShowModal;

        end;
end;

//记录作废
procedure Tformsupdetails.but_modifyClick(Sender: TObject);
var
    ls_sroomno:string;
begin
    pageindex:=page_sup.ActivePageIndex;
    //就餐客人明细
    if  pageindex=0   then
        begin
            DMHotel.ds_sup_detail.Open;
            G_sdid:=DMHotel.ds_sup_detail.FieldByName('sdid').AsString;
            if G_sdid='' then
               begin
                   showmessage('请先选择要作废的记录!');
                   exit;
               end;

            //作废警告提示
            if MessageBox(handle,'作废就餐客人记录将使所有该条记录相关的就餐消费明细记录作废,确定作废吗?','警告',MB_OKCANCEL or MB_ICONERROR)=2 then
               exit;

            //定义一个事务,同时执行改变包间状态和修改iscancellation标志位
            DMHotel.ADOConnection1.BeginTrans;
            //如果是包间,改变包间状态
            if DMHotel.ds_sup_detail.FieldValues['sroomno']<>null then
               begin
                   ls_sroomno:=DMHotel.ds_sup_detail.FieldValues['sroomno'];
                   //showmessage(ls_sroomno);  ////
                   //空闲的颜色
                   statuscolor:=color1;
                   //改变被使用包间状态为空闲
                   formsupmanage.sroomstatus_change(statuscolor,strtoint(ls_sroomno),'空闲');
               end;

            //修改sup_detail表的iscancellation标志位
            SQL:='update sup_detail '+'set iscancellation='+''''+'1'+''''
                +' '+'where sdid='+''''+G_sdid+'''';
            DMHotel.ADOQuery1.SQL.Text:=SQL;
            try
                DMHotel.ADOQuery1.ExecSQL;
            except
                showmessage('操作失败!');
                DMHotel.ADOConnection1.RollbackTrans;  //失败回滚
                exit;
            end;

            //修改dup_consume表的iscancellation标志位
            SQL:='update sup_consume_detail '+'set iscancellation='+''''+'1'+''''
                +' '+'where supuserid='+''''+G_sdid+'''';
            DMHotel.ADOQuery1.SQL.Text:=SQL;
            try
            
...
...
(Please download the complete source code to view)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
Main.dcu11.27 kB28-12-02|17:08
Main.ddp51.00 B28-12-02|18:57
Main.dfm201.48 kB28-12-02|18:44
Main.pas7.57 kB28-12-02|18:42
Main.~ddp51.00 B28-12-02|18:42
Main.~dfm201.48 kB28-12-02|18:42
Main.~pas7.57 kB28-12-02|18:42
ProHotel.cfg386.00 B28-12-02|17:15
ProHotel.dof1.45 kB28-12-02|17:15
ProHotel.DPR7.11 kB28-12-02|17:10
ProHotel.RES876.00 B28-12-02|17:14
ProHotel.~DPR7.13 kB28-12-02|16:49
unitsupcheck.dcu12.37 kB11-10-02|15:39
unitroomquery.dcu6.47 kB18-12-02|20:38
unitsupdetail_data.dfm4.67 kB10-09-02|15:59
unitroomfeerequery.dcu8.42 kB11-10-02|15:39
unitroomquery.dfm9.79 kB18-12-02|20:18
unitroomrep.~dfm30.16 kB21-12-02|17:28
unitsroomstop.pas2.89 kB09-09-02|21:16
unitsroomquery.dfm8.13 kB10-09-02|15:59
unitroomrep.pas1.52 kB10-09-02|13:28
unitroomdebtrep.~pas1.64 kB10-09-02|13:35
unitroomrep.~ddp51.00 B21-12-02|17:32
unitsroomstop.dfm1.62 kB10-09-02|15:59
unitsroomHquery.dcu6.85 kB11-10-02|15:39
unitroomHquery.dcu6.48 kB18-12-02|20:20
unitroomrep.dfm30.16 kB21-12-02|19:57
unitsuproomstatusquery.pas4.24 kB09-09-02|09:10
unitroomdebtrep.~dfm33.28 kB13-12-02|21:14
unitroomdebtrep.pas1.64 kB10-09-02|13:35
unitroomquery.~pas3.05 kB18-12-02|20:19
unitsupmanage.pas17.34 kB05-03-03|21:26
unitroomHquery.pas3.06 kB18-12-02|20:19
unitsupmanage.dcu22.75 kB24-12-02|10:24
unitsroombook_data.pas7.88 kB10-10-02|08:24
unitsroomquery.dcu6.83 kB11-10-02|15:39
unitroomstatusrequery.dcu5.98 kB11-10-02|15:39
unitsuproomstatusquery.dfm4.84 kB10-09-02|15:58
unitroomdebtrep.ddp51.00 B21-12-02|23:07
unitsupconsumedetail_data.pas5.93 kB23-12-02|11:20
unitsupmanage.dfm79.80 kB28-12-02|18:42
unitroombookquery.dcu6.44 kB11-10-02|15:39
unitsupcheckCquery.dcu7.50 kB11-10-02|15:39
unitsupcheckSquery.dcu7.51 kB11-10-02|15:39
unitroomdebtrep.dfm33.25 kB21-12-02|23:01
unitroomcheck.pas44.84 kB14-12-02|09:04
unitsupdetail_data.pas6.37 kB11-10-02|16:23
unitroomquery.~dfm9.79 kB18-12-02|20:18
unitroomcheck.ddp51.00 B22-12-02|10:46
unitroomrep.~pas1.52 kB10-09-02|13:28
unitsroombook_data.dfm6.07 kB10-09-02|15:59
unitsupconsumedetail_data.dfm5.26 kB10-09-02|15:59
unitsroomquery.pas3.50 kB09-09-02|08:13
unitroomcheck.dfm44.33 kB14-12-02|08:08
unitroomHquery.dfm9.79 kB10-09-02|08:00
unitsroombookquery.dcu6.80 kB11-10-02|15:39
unitroomquery.pas3.05 kB18-12-02|20:38
unitchangeroom.dcu13.75 kB25-12-02|21:16
unitchangeroom.ddp51.00 B24-12-02|15:07
unitchangeroom.dfm11.36 kB24-12-02|14:39
unitchangeroom.pas10.45 kB14-12-02|09:03
unitchangeroom.~dfm11.36 kB14-12-02|08:59
unitchangeroom.~pas10.45 kB14-12-02|09:03
Unitcustomerdebt.dcu4.93 kB12-09-02|11:26
unitcustomer.dfm13.83 kB07-09-02|15:49
unitcustomer.pas1.73 kB09-09-02|10:25
unitcustomer.dcu5.60 kB11-10-02|15:39
Unitcustomerdebt.dfm27.54 kB10-09-02|14:48
Unitcustomerdebt.pas1.45 kB10-09-02|14:48
unitcustomermanagerquery.dcu7.34 kB11-10-02|15:39
unitcustomermanagerquery.dfm16.89 kB07-09-02|23:01
unitcustomermanagerquery.pas3.38 kB19-08-02|16:09
unitDBMessage.dcu3.34 kB12-09-02|11:26
unitDBMessage.dfm904.00 B12-08-02|12:09
unitDBMessage.pas434.00 B05-08-02|15:53
unitdebtroomrequery.dcu6.16 kB11-10-02|15:39
unitdebtroomrequery.dfm9.42 kB09-09-02|11:12
unitdebtroomrequery.pas2.57 kB09-09-02|11:13
unitdictionary.dcu6.39 kB11-10-02|15:39
unitdictionary.dfm3.77 kB10-09-02|08:02
unitdictionary.pas2.89 kB08-09-02|08:48
unitDMHotel.dcu36.96 kB18-12-02|20:51
unitDMHotel.ddp51.00 B21-12-02|23:14
unitDMHotel.dfm8.93 kB21-12-02|23:10
unitDMHotel.pas47.43 kB18-12-02|20:50
unitDMHotel.~ddp51.00 B18-12-02|20:50
unitDMHotel.~dfm8.89 kB11-10-02|15:52
unitDMHotel.~pas47.43 kB18-12-02|20:50
unitexitsys.dcu3.84 kB10-10-02|08:06
unitexitsys.dfm1.30 kB10-09-02|08:01
unitexitsys.pas869.00 B17-08-02|08:59
unitfinancemanage.dcu6.47 kB24-12-02|10:24
unitfinacebaobiao.ddp51.00 B25-12-02|22:47
unitfinacebaobiao.dfm5.59 kB25-12-02|21:23
unitfinacebaobiao.pas4.69 kB25-12-02|22:47
unitfinancemanage.~ddp51.00 B28-12-02|18:44
unitfinancemanage.~dfm452.29 kB28-12-02|18:44
unitfinacebaobiao.~pas4.65 kB25-12-02|22:44
unitfinacebaobiao.dcu9.47 kB25-12-02|22:47
unitfinancemanage.ddp51.00 B05-03-03|21:24
unitfinancemanage.dfm452.29 kB28-12-02|18:44
unitfinancemanage.pas3.14 kB05-03-03|21:24
unitfinacebaobiao.~ddp51.00 B25-12-02|22:44
unitfinacebaobiao.~dfm5.59 kB25-12-02|21:23
unitfinancemanage.~pas3.14 kB28-12-02|18:44
unitforbid.dcu8.80 kB25-12-02|21:16
unitforbid.dfm1.36 kB06-08-02|22:20
unitforbid.pas6.06 kB09-09-02|23:40
unitFsupcheckCquery.dcu7.81 kB11-10-02|15:39
unitFsupcheckCquery.dfm7.60 kB10-09-02|08:01
unitFsupcheckCquery.pas4.69 kB09-09-02|09:03
unitFsupcheckSquery.dcu7.81 kB11-10-02|15:39
unitFsupcheckSquery.dfm7.61 kB10-09-02|08:01
unitFsupcheckSquery.pas4.69 kB09-09-02|09:04
unitinroom.dcu16.80 kB25-12-02|21:16
unitinroom.ddp51.00 B25-12-02|20:20
unitinroom.dfm16.27 kB25-12-02|20:20
unitinroom.pas14.38 kB25-12-02|20:20
unitinroom.~ddp51.00 B24-12-02|15:08
unitinroom.~dfm16.69 kB24-12-02|15:08
unitinroom.~pas14.40 kB24-12-02|15:07
unitlogging.dcu8.00 kB24-12-02|10:24
unitlogging.ddp51.00 B05-03-03|21:20
unitlogging.dfm216.68 kB10-10-02|08:11
unitlogging.pas4.92 kB05-03-03|21:19
unitlogging.~ddp51.00 B24-12-02|10:24
unitlogging.~dfm216.68 kB10-10-02|08:11
unitlogging.~pas4.92 kB24-12-02|10:24
unitmanagerroomquery.dcu8.82 kB11-10-02|15:39
unitmanagerroomquery.dfm27.46 kB08-09-02|20:28
unitmanagerroomquery.pas4.80 kB18-08-02|10:20
unitmodifypassword.dcu6.04 kB11-10-02|15:39
unitmodifypassword.ddp51.00 B10-10-02|08:14
unitmodifypassword.dfm3.67 kB09-10-02|23:57
unitmodifypassword.pas2.46 kB10-10-02|08:14
unitmodifypassword.~ddp51.00 B10-10-02|08:08
unitmodifypassword.~dfm3.67 kB09-10-02|23:57
unitmodifypassword.~pas2.46 kB10-10-02|08:08
unitQRdayMXrep.dcu6.46 kB25-12-02|22:44
unitQRmonthrep.ddp51.00 B24-12-02|14:31
unitQRmonthrep.dfm35.58 kB24-12-02|14:16
unitQRdayrep.pas9.12 kB24-12-02|12:58
unitQRmonthrep.~ddp51.00 B24-12-02|14:16
unitQRmonthrep.~dfm35.58 kB24-12-02|14:16
unitQRyearrep.~pas8.27 kB24-12-02|14:13
unitQRyearrep.dcu10.90 kB24-12-02|14:31
unitQRyearrep.ddp51.00 B24-12-02|14:31
unitQRdayrep.dfm37.08 kB24-12-02|10:20
unitQRyearrep.pas8.24 kB24-12-02|14:31
unitQRyearrep.~ddp51.00 B24-12-02|14:16
unitQRyearrep.~dfm35.58 kB24-12-02|14:15
unitQRmonthrep.~pas8.27 kB24-12-02|14:00
unitQRdayrep.dcu12.08 kB24-12-02|13:09
unitQRdayrep.ddp51.00 B24-12-02|12:58
unitQRyearrep.dfm35.58 kB24-12-02|14:15
unitQRdayMXrep.pas2.56 kB25-12-02|22:44
unitQRdayMXrep.~ddp51.00 B25-12-02|22:44
unitQRdayMXrep.~dfm64.08 kB25-12-02|22:38
unitQRdayMXrep.~pas2.56 kB25-12-02|22:44
unitQRmonthrep.dcu10.92 kB24-12-02|14:31
unitQRdayMXrep.ddp51.00 B25-12-02|22:44
unitQRdayMXrep.dfm64.01 kB25-12-02|22:44
unitQRmonthrep.pas8.27 kB24-12-02|14:30
unitQRdayrep.~ddp51.00 B24-12-02|10:24
unitQRdayrep.~dfm37.08 kB24-12-02|10:20
unitQRdayrep.~pas9.12 kB24-12-02|10:16
unitquery.dcu4.81 kB12-09-02|11:26
unitquery.dfm1.84 kB18-08-02|14:48
unitquery.pas1.68 kB18-08-02|12:08
unitroom.dcu27.80 kB25-12-02|21:30
unitroom.ddp51.00 B28-12-02|18:57
unitroom.dfm208.39 kB28-12-02|18:57
unitroom.pas26.81 kB28-12-02|18:57
unitroombook.dcu14.02 kB25-12-02|21:16
unitroombook.ddp51.00 B11-10-02|15:27
unitroombookquery.dfm7.80 kB18-08-02|14:48
unitroombookquery.pas3.09 kB11-08-02|12:38
unitroom.~ddp51.00 B24-12-02|10:53
unitroombook.~dfm6.86 kB09-09-02|23:17
unitroombook.~pas10.87 kB09-09-02|23:19
unitroomrep.dcu4.97 kB12-09-02|11:26
unitroomHquery.ddp51.00 B18-12-02|20:19
unitroomfeerequery.dfm18.96 kB09-09-02|11:16
unitroomfeerequery.pas4.91 kB09-09-02|11:17
unitroomcheck.~ddp51.00 B11-12-02|22:28
unitroomHquery.~dfm9.79 kB10-09-02|08:00
unitroomHquery.~pas3.06 kB11-08-02|12:45
unitroomdebtrep.dcu5.18 kB12-09-02|11:26
unitroomquery.ddp51.00 B18-12-02|20:47
unitroomstatusrequery.dfm8.45 kB08-09-02|20:11
unitroomstatusrequery.pas2.66 kB14-08-02|21:19
unitroomdebtrep.~ddp51.00 B13-12-02|22:26
unitroom.~dfm208.00 kB11-12-02|20:05
unitroom.~pas26.58 kB24-12-02|10:53
unitroomcheck.dcu47.38 kB25-12-02|21:16
unitroomrep.ddp51.00 B21-12-02|19:57
unitroombook.dfm7.40 kB11-10-02|15:26
unitroombook.pas10.87 kB11-10-02|15:26
unitroomquery.~ddp51.00 B18-12-02|20:19
unitroomcheck.~dfm44.11 kB11-12-02|22:22
unitroomcheck.~pas42.30 kB10-09-02|13:26
unitsetsuptype_data.dcu6.95 kB11-10-02|15:39
unitsetprice.dfm5.79 kB10-09-02|08:00
unitsetprice.pas5.67 kB17-08-02|12:39
unitsetroomprice_data.dcu6.14 kB11-10-02|15:39
unitsetroomprice_data.dfm3.01 kB10-09-02|08:00
unitsetroomprice_data.pas2.46 kB17-08-02|12:45
unitsetsupprice_data.dcu8.38 kB11-10-02|15:39
unitsetsupprice_data.dfm4.59 kB10-09-02|08:00
unitsetsupprice_data.pas5.47 kB17-08-02|20:23
unitsetprice.dcu7.91 kB11-10-02|15:39
unitsetsuptype_data.dfm3.35 kB10-09-02|08:00
unitsetsuptype_data.pas4.10 kB08-09-02|08:56
unitsoftinformation.dcu3.42 kB12-09-02|11:26
unitsoftinformation.ddp51.00 B11-10-02|15:05
unitsoftinformation.dfm217.39 kB11-10-02|15:04
unitsoftinformation.pas476.00 B10-08-02|21:29
unitsoftinformation.~dfm217.40 kB10-09-02|08:00
unitsoftinformation.~pas476.00 B10-08-02|21:29
unitsroombook_data.dcu9.77 kB11-10-02|15:39
unitsroombook_data.ddp51.00 B10-10-02|08:24
unitsroombook.dfm4.64 kB10-09-02|09:36
unitsroombookquery.pas3.52 kB09-09-02|08:15
unitsroombook_data.~ddp51.00 B10-10-02|08:20
unitsroombook_data.~dfm6.07 kB10-09-02|15:59
unitsroombook_data.~pas9.37 kB10-10-02|08:20
unitsroombook.dcu6.50 kB11-10-02|15:39
unitsroombookquery.dfm7.81 kB10-09-02|15:59
unitsroombook.pas2.96 kB10-09-02|09:33
unitsroomopen.dcu6.23 kB11-10-02|15:39
unitsroomHquery.dfm8.18 kB10-09-02|15:59
unitsroomHquery.pas3.51 kB09-09-02|08:12
unitsroomstop.dcu6.22 kB11-10-02|15:39
unitsroomopen.dfm1.80 kB10-09-02|15:59
unitsroomopen.pas2.87 kB09-09-02|21:18
unitsuproomstatusquery.dcu7.04 kB11-10-02|15:39
unitsupmanage.ddp51.00 B05-03-03|21:26
unitsupcheck.dfm9.58 kB10-09-02|15:59
unitsupcheck.pas8.41 kB09-09-02|22:34
unitsupmanage.~ddp51.00 B05-03-03|21:26
unitsupconsumedetail_data.~dfm5.26 kB10-09-02|15:59
unitsupconsumedetail_data.~pas5.93 kB09-09-02|08:41
unitsupdetail_data.dcu9.43 kB11-10-02|16:23
unitsupdetail_data.ddp51.00 B11-10-02|16:23
unitsupcheckCquery.dfm6.90 kB10-09-02|15:59
unitsupcheckCquery.pas4.29 kB09-09-02|09:03
unitsupdetail_data.~ddp51.00 B11-10-02|16:22
unitsupmanage.~dfm79.80 kB28-12-02|18:42
unitsupmanage.~pas17.34 kB05-03-03|21:26
unitsupconsumedetail_data.dcu10.30 kB23-12-02|11:41
unitsupconsumedetail_data.ddp51.00 B23-12-02|11:30
unitsupcheckSquery.dfm6.90 kB10-09-02|15:59
unitsupcheckSquery.pas4.29 kB09-09-02|09:03
unitsupdetail_data.~dfm4.67 kB10-09-02|15:59
unitsupdetail_data.~pas6.37 kB11-10-02|16:22
unitsupdetails.dcu9.00 kB11-10-02|15:39
unitsupdetails.dfm8.22 kB10-09-02|15:59
unitsupdetails.pas6.11 kB09-09-02|21:09
unitsysuser_data.dcu6.67 kB11-10-02|15:39
unitsyslog.dfm4.47 kB10-09-02|15:58
unitsyslog.pas1.73 kB17-08-02|10:04
unitsysuser.dcu5.78 kB11-10-02|15:39
unitsysuser.dfm3.00 kB10-09-02|15:58
unitsysuser.pas2.19 kB09-09-02|08:00
unitsyslog.dcu5.50 kB11-10-02|15:39
unitsysuser_data.dfm3.93 kB10-09-02|15:58
unitsysuser_data.pas3.29 kB08-09-02|22:43
help.cnt836.00 B25-12-02|17:28
help.GID10.61 kB28-12-02|16:16
HELP.HLP29.72 kB25-12-02|17:32
help.rtf131.42 kB25-12-02|17:28
系统帮助.HLP28.35 kB24-12-02|17:12
系统帮助.hpj195.00 B25-12-02|17:32
系统帮助0.00 B29-09-07|22:28
Hotel0.00 B29-09-07|22:28
...
Sponsored links

unitsupdetails.pas (1.73 MB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D