【正文】
ount(*) INTO :countRec FROM pwd WHERE pwd_username = :gs_usernameInput AND pwd_password = :gs_passwordInput USING sqlca。 //保存登錄用戶名 INSERT INTO cookie(cookie_username) VALUES(:gs_usernameInput) using sqlca。 //關閉登錄窗口,打開登錄窗口 open(w_main) close(w_login) 課程設計說明書 沈 陽 大 學 else messagebox(提示 , 你輸入的用戶名或密碼不對,請再次輸入 ) = = () end if 入住登記代碼: string ls_name string ls_id string ls_address string ls_sex string ls_pany string ls_room int li_deposit int li_amount int li_price int li_days int li_ecard int li_keycard //獲取性別 if = true then ls_sex = else ls_sex = end if //獲取 account if = true then li_amount = dec() else if = true then li_amount = dec() else li_amount = dec() end if end if 課程設計說明書 沈 陽 大 學 //獲取電卡 if = true then li_ecard = dec() else if = true then li_ecard = dec() else li_ecard = dec() end if end if //獲取鑰匙 if = true then li_keycard = dec() else if = true then li_keycard = dec() else li_keycard = dec() end if end if li_deposit = dec() ls_name = Trim() ls_id = Trim() ls_address = Trim() ls_pany = li_price = dec() li_days = dec() ls_room = //信息完整性檢查 if ls_name = then messagebox(提示 , 請輸入姓名 ) return 0 end if if len(ls_id) 16 or len(ls_id) 18 then messagebox(39。, 39。) 課程設計說明書 沈 陽 大 學 () return 0 end if if ls_address = then messagebox(提示 , 請輸入家庭地 址 ) return 0 end if if = then messagebox(提示 , 請輸入房間價格 ) return 0 end if if = then messagebox(提示 , 請輸入預住天數 ) return 0 end if if = then messagebox(提示 , 請輸入押金 ) return 0 end if //獲取當前時間,用 于存入數據庫 currentTime = DateTime(today(), now()) //更新 rooms 表中的信息 UPDATE rooms SET rooms_used = 39。, rooms_time = :currentTime WHERE rooms_num = :ls_room USING sqlca。入住 39。 //將信息存入 customer 表中 課程設計說明書 沈 陽 大 學 INSERT INTO customer(customer_name, customer_sex, customer_id, customer_address, customer_pany, customer_amount, customer_roomnum, customer_price, customer_day, customer_ecard, customer_keycard, customer_deposit, customer_operator, customer_isin, customer_intime) VALUES(:ls_name, :ls_sex, :ls_id, :ls_address, :ls_pany, :li_amount, :ls_room, :li_price, :li_days, :li_ecard, :li_keycard, :li_deposit, :gs_operator, 39。, :currentTime) USING SQLCA。否 39。 return end if //更新 main 窗口中數據窗口的顯示 (customer_isin = 39。) () (customer_indate D, customer_intime D) () 退房代碼: int bill bill = dec() UPDATE customer SET customer_outtime = :idt_currentTime, customer_bill = :bill, customer_isin = 39。 課程設計說明書 沈 陽 大 學 WHERE customer_roomnum = : AND customer_isin = 39。 USING sqlca。否 39。 //存入操作信息 INSERT INTO operation VALUES(:gs_operator, :ldt_intime, :idt_currentTime, 39。)。是 39。否 39。+string(ld_start, 39。)+39。+string(ld_end, 39。)+39。+string(ld_start, 39。)+39。+string(ld_end, 39。)+39。+string(ld_start, 39。)+39。+string(ld_end, 39。)+39。+string(ld_start, 39。)+39。+string(ld_end, 39。)+39。是 39。 if = 0 then MessageBox(成功 , 記帳成功 ) //保存操作信息 INSERT INTO operation VALUES(:gs_operator, :ldt_intime, :ldt_currentTime, 39。)。是 39。39。39。39。39。是 39。39。 if = 0 then () () close(parent) MessageBox(成功 , 續(xù)費成功 ) else MessageBox(失敗 , 續(xù)費失敗,請稍后嘗試 ) end if //保存操作信息 INSERT INTO operation VALUES(:gs_operator, :ldt_intime, :ldt_currentTime, 39。