unitdmhotel.~pas

来自「自己做过的工程」· ~PAS 代码 · 共 1,062 行 · 第 1/4 页

~PAS
1,062
字号

    if (sroomnoCK=true) and (ischeckCK=true) and (checktimeCK=false) then
       begin
           ds_sup_check_query.CommandText:='select * from sup_detail where sroomno='+
                            ''''+ls_sroomno+''''+' and ischeck='+''''+'yes'+''''+
                            ' and issign='+''''+ls_issign+''''+
                            ' and iscancellation='+''''+'0'+'''';
       end;

    if (sroomnoCK=true) and (ischeckCK=false) then
       begin
           ds_sup_check_query.CommandText:='select * from sup_detail where sroomno='+
                            ''''+ls_sroomno+''''+' and ischeck='+''''+'no'+''''+
                            ' and iscancellation='+''''+'0'+'''';
       end;

    if (sroomnoCK=false) and (ischeckCK=true) and (checktimeCK=true) then
       begin
           ds_sup_check_query.CommandText:='select * from sup_detail where ischeck='+
                            ''''+'yes'+''''+
                            ' and checktime>'+''''+datetostr(ls_Bchecktime)+''''+
                            ' and checktime<'+''''+datetostr(ls_Echecktime+1)+''''+
                            ' and issign='+''''+ls_issign+''''+
                            ' and iscancellation='+''''+'0'+'''';
       end;

    if (sroomnoCK=false) and (ischeckCK=true) and (checktimeCK=false) then
       begin
           ds_sup_check_query.CommandText:='select * from sup_detail where ischeck='+
                            ''''+'yes'+''''+
                            ' and issign='+''''+ls_issign+''''+
                            ' and iscancellation='+''''+'0'+'''';
       end;

    if (sroomnoCK=false) and (ischeckCK=false) then
       begin
           ds_sup_check_query.CommandText:='select * from sup_detail where ischeck='+''''+'no'+''''+
                            ' and iscancellation='+''''+'0'+'''';
       end;

    ds_sup_check_query.Prepared:=true;
    ds_sup_check_query.Open;

end;

//包间状态查询
procedure TDMHotel.SroomStatusQuery(ls_sroomstatus:string;ls_sroomno:string;sroomstatusCK:boolean;sroomnoCK:boolean);
begin
    ds_sup_room_status_query.Close;
    ds_sup_room_status_query.Prepared:=false;

    if (sroomstatusCK=false) and (sroomnoCK=true) then
       begin
           ds_sup_room_status_query.CommandText:='select * from sup_room_status where sroomno='+
                            ''''+ls_sroomno+'''';
       end;

    if (sroomstatusCK=true) and (sroomnoCK=false) then
       begin
           ds_sup_room_status_query.CommandText:='select * from sup_room_status where sroomstatus='+
                            ''''+ls_sroomstatus+'''';
       end;

    //如无条件
    if (sroomstatusCK=false) and (sroomnoCK=false) then
       begin
           ds_sup_room_status_query.CommandText:='select * from sup_room_status';
       end;

    ds_sup_room_status_query.Prepared:=true;
    ds_sup_room_status_query.Open;

end;


////////////////////////////////////////////////////////////////////////////
//总台帐务查询



  //客房现金支付查询
procedure TDMHotel.RoomFeeQuery(ls_username:string;ls_roomid:string;ls_intime:Tdatetime;usernameCK:boolean;roomidCK:boolean;intimeCK:boolean;var totalmoney:extended);
   begin
    ADODataSet_roomfee_requery.Close;
    ADODataSet_roomfee_requery.Prepared:=false;

   if (usernameCK=false) and (roomidCK=false) and (intimeCK=false) then
        begin
                ADODataSet_roomfee_requery.CommandText:='select * from room_fee';
        end;

   if (usernameCK=true) and (roomidCK=true) and (intimeCK=true) then
       begin
           ADODataSet_roomfee_requery.CommandText:='select * from room_fee where username='+
                            ''''+ls_username+''''+' and roomid='+''''+ls_roomid+''''+
                            ' and intime>'+''''+datetostr(ls_intime)+''''+' and intime<'+''''+datetostr(ls_intime+1)+'''';
       end;

    if (usernameCK=true) and (roomidCK=true) and (intimeCK=false) then
       begin
           ADODataSet_roomfee_requery.CommandText:='select * from room_fee where username='+
                            ''''+ls_username+''''+' and roomid='+''''+ls_roomid+'''';
       end;

    if (usernameCK=true) and (roomidCK=false) and (intimeCK=true) then
       begin
           ADODataSet_roomfee_requery.CommandText:='select * from room_fee where username='+
                            ''''+ls_username+''''+
                            ' and intime>'+''''+datetostr(ls_intime)+''''+' and intime<'+''''+datetostr(ls_intime+1)+'''';
       end;

    if (usernameCK=true) and (roomidCK=false) and (intimeCK=false) then
       begin
           ADODataSet_roomfee_requery.CommandText:='select * from room_fee where username='+
                            ''''+ls_username+'''';
       end;

    if (usernameCK=false) and (roomidCK=true) and (intimeCK=true) then
       begin
           ADODataSet_roomfee_requery.CommandText:='select * from room_fee where  roomid='+
                            ''''+ls_roomid+''''+
                            ' and intime>'+''''+datetostr(ls_intime)+''''+' and intime<'+''''+datetostr(ls_intime+1)+'''';
       end;

    if (usernameCK=false) and (roomidCK=true) and (intimeCK=false) then
       begin
           ADODataSet_roomfee_requery.CommandText:='select * from room_fee where roomid='+''''+ls_roomid+'''';
       end;

    if (usernameCK=false) and (roomidCK=false) and (intimeCK=true) then
       begin
           ADODataSet_roomfee_requery.CommandText:='select * from room_fee where intime>'+''''+datetostr(ls_intime)+''''+' and intime<'+''''+datetostr(ls_intime+1)+'''';
       end;

    ADODataSet_roomfee_requery.Prepared:=true;
    ADODataSet_roomfee_requery.Open;

                        //下面要去总的消费金额
                   totalmoney:=0;
               while not  DMHotel.ADODataSet_roomfee_requery.Eof do
                   begin
                       totalmoney:=totalmoney+DMHotel.ADODataSet_roomfee_requery.FieldValues['totalfee'];
                       ADODataSet_roomfee_requery.Next;
                   end;

   end;


     //客房挂帐支付查询
procedure TDMHotel.RoomDebtQuery(ls_checkedornot:string;ls_username:string;ls_roomid:string;ls_intime:Tdatetime;usernameCK:boolean;roomidCK:boolean;intimeCK:boolean;var totalmoney:extended);
   begin
    ADODataSet_roomDebt_requery.Close;
    ADODataSet_roomDebt_requery.Prepared:=false;

   if (usernameCK=false) and (roomidCK=false) and (intimeCK=false) then
        begin
              ADODataSet_roomDebt_requery.CommandText:='select * from room_debt where '+
              'checkornot='+''''+ls_checkedornot+'''';
           //   showmessage(ADODataSet_roomDebt_requery.CommandText) ;
        end;

   if (usernameCK=true) and (roomidCK=true) and (intimeCK=true) then
       begin
           ADODataSet_roomDebt_requery.CommandText:='select * from room_debt where username='+
                            ''''+ls_username+''''+' and roomid='+''''+ls_roomid+''''+
                            ' and intime>'+''''+datetostr(ls_intime)+''''+' and intime<'+''''+datetostr(ls_intime+1)+''''
                            + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

    if (usernameCK=true) and (roomidCK=true) and (intimeCK=false) then
       begin
           ADODataSet_roomdebt_requery.CommandText:='select * from room_debt where username='+
                            ''''+ls_username+''''+' and roomid='+''''+ls_roomid+''''
                            + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

    if (usernameCK=true) and (roomidCK=false) and (intimeCK=true) then
       begin
           ADODataSet_roomDebt_requery.CommandText:='select * from room_debt where username='+
                            ''''+ls_username+''''+
                            ' and intime>'+''''+datetostr(ls_intime)+''''+' and intime<'+''''+datetostr(ls_intime+1)+''''
                            + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

    if (usernameCK=true) and (roomidCK=false) and (intimeCK=false) then
       begin
           ADODataSet_roomDebt_requery.CommandText:='select * from room_debt where username='+
                            ''''+ls_username+''''
                            + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

    if (usernameCK=false) and (roomidCK=true) and (intimeCK=true) then
       begin
           ADODataSet_roomDebt_requery.CommandText:='select * from room_debt where  roomid='+
                            ''''+ls_roomid+''''+
                            ' and intime>'+''''+datetostr(ls_intime)+''''+' and intime<'+''''+datetostr(ls_intime+1)+''''
                            + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

    if (usernameCK=false) and (roomidCK=true) and (intimeCK=false) then
       begin
           ADODataSet_roomDebt_requery.CommandText:='select * from room_debt where roomid='+''''+ls_roomid+''''
           + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

    if (usernameCK=false) and (roomidCK=false) and (intimeCK=true) then
       begin
           ADODataSet_roomDebt_requery.CommandText:='select * from room_debt where intime>'+''''+datetostr(ls_intime)+''''+' and intime<'+''''+datetostr(ls_intime+1)+''''
           + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

    ADODataSet_roomDebt_requery.Prepared:=true;
    ADODataSet_roomDebt_requery.Open;
       //计算总金额
                       totalmoney:=0;
               while not  DMHotel.ADODataSet_roomDebt_requery.Eof do
                   begin
                       totalmoney:=totalmoney+DMHotel.ADODataSet_roomDebt_requery.FieldValues['totalfee'];
                       ADODataSet_roomDebt_requery.Next;
                   end;

   end;


        //客房挂帐支付查询
procedure TDMHotel.RoomreDebtQuery(ls_checkedornot:string;ls_username:string;ls_roomid:string;ls_intime:Tdatetime;usernameCK:boolean;roomidCK:boolean;intimeCK:boolean;var totalmoney:extended);
   begin
    ADODataSet_roomreDebt_requery.Close;
    ADODataSet_roomreDebt_requery.Prepared:=false;

   if (usernameCK=false) and (roomidCK=false) and (intimeCK=false) then
        begin
              ADODataSet_roomreDebt_requery.CommandText:='select * from room_debt where '+
              'checkornot='+''''+ls_checkedornot+'''';
        end;

   if (usernameCK=true) and (roomidCK=true) and (intimeCK=true) then
       begin
           ADODataSet_roomreDebt_requery.CommandText:='select * from room_debt where username='+
                            ''''+ls_username+''''+' and roomid='+''''+ls_roomid+''''+
                            ' and intime>'+''''+datetostr(ls_intime)+''''+' and intime<'+''''+datetostr(ls_intime+1)+''''
                            + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

    if (usernameCK=true) and (roomidCK=true) and (intimeCK=false) then
       begin
           ADODataSet_roomredebt_requery.CommandText:='select * from room_debt where username='+
                            ''''+ls_username+''''+' and roomid='+''''+ls_roomid+''''
                            + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

    if (usernameCK=true) and (roomidCK=false) and (intimeCK=true) then
       begin
           ADODataSet_roomreDebt_requery.CommandText:='select * from room_debt where username='+
                            ''''+ls_username+''''+
                            ' and intime>'+''''+datetostr(ls_intime)+''''+' and intime<'+''''+datetostr(ls_intime+1)+''''
                            + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

    if (usernameCK=true) and (roomidCK=false) and (intimeCK=false) then
       begin
           ADODataSet_roomreDebt_requery.CommandText:='select * from room_debt where username='+
                            ''''+ls_username+''''
                            + ' and checkornot='+''''+ls_checkedornot+'''';
       end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?