/*public bool readclientid(Data.Client dc) * { * bool stat = false; * koneksi kon =new koneksi; * try * { * kon.openConnection(); * string query = "select client_id from tb_reservation"; * * } * }*/ public bool loginadmin(string no_identity, string phone) { bool stat = false; koneksi kon = new koneksi(); Data.Client dc = new Data.Client(); kon.openConnection(); string query = "select no_identity, phone from tb_client where no_identity='admin' and phone='admin'"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); return(stat); }
public bool bilpay(Data.Reservation dr) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "update tb_reservation set pembayaran='" + dr.Pembayaran + "',kembalian=@kembalian-'" + dr.Pembayaran + "', keterangan='" + dr.Keterangan + "' where no_reservation='" + dr.No_reservasi + "' "; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { } return(stat); }
public bool deletereservation(Data.Reservation dre) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "delete from tb_reservation where no_reservation='" + dre.No_reservasi + "'"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { } return(stat); }
public bool editreservation(Data.Reservation drv) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "update tb_reservation set client_id='" + drv.Client_id + "',room_type='" + drv.Room_type + "',room_price='" + drv.Room_price + "', no_room='" + drv.No_room + "',booking_date='" + drv.Booking_date + "', date_in='" + drv.Date_in + "',date_out='" + drv.Date_out + "', cara_bayar='" + drv.Carabayar + "' where no_reservation='" + drv.No_reservasi + "'"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { } return(stat); }
public bool deleteroom(Data.Room drm) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "delete from tb_room where room_id='" + drm.Roomid + "'"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { } return(stat); }
public bool editroom(Data.Room dro) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "update tb_room set type_room='" + dro.Roomtype + "',price_room='" + dro.Roomprice + "' where room_id='" + dro.Roomid + "'"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { } return(stat); }
public bool deleteclient(Data.Client dc) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "delete from tb_client where no_identity='" + dc.No_identity + "'"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { } return(stat); }
public bool updateclient(Data.Client dc) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "update tb_client set firstname='" + dc.Firstname + "',lastname='" + dc.Lastname + "',phone='" + dc.Phone + "', country='" + dc.Country + "' where no_identity='" + dc.No_identity + "'"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { } return(stat); }
public bool reservationclient(Data.Reservation drv) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "insert into tb_reservation values('" + drv.No_reservasi + "', '" + drv.Client_id + "', '" + drv.Room_type + "', '" + drv.Room_price + "', '" + drv.No_room + "', '" + drv.Booking_date + "', '" + drv.Date_in + "', '" + drv.Date_out + "', null, null, '" + drv.Room_price + "' * '" + drv.No_room + "','" + drv.Carabayar + "', null, null, 'Belum Lunas')"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(stat); }
public bool addroom(Data.Room dr) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "insert into tb_room values('" + dr.Roomid + "', '" + dr.Roomtype + "', '" + dr.Roomprice + "')"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(stat); }
public bool registrasi(Data.Client dc) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "insert into tb_client values('" + dc.No_identity + "', '" + dc.Firstname + "', '" + dc.Lastname + "', '" + dc.Phone + "', '" + dc.Country + "')"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(stat); }
public bool searchreservid(Data.Reservation dr) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "select * from tb_reservation where no_reservation='" + dr.No_reservasi + "'"; //kon.ExecuteQueries("select * from tb_reservation where no_reservation='" + dr.No_reservasi + "'"); kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { } return(stat); }