Example #1
0
        public bool ThemBangThuePhong(BangThuePhongDTO bangThuePhong)
        {
            string[] param  = { "@IDPhong", "@IDNhanVien", "@IDKhachHang", "@CheckIn", "@CheckOut", "@TienDatCoc", "@TrangThai" };
            object[] values = { bangThuePhong.IdPhong, bangThuePhong.IdNhanVien, bangThuePhong.IdKhachHang, bangThuePhong.CheckIn, bangThuePhong.CheckOut, bangThuePhong.TienDatCoc, bangThuePhong.TrangThai };
            string   query  = "Insert Into BangThuePhong Values(@IDPhong,@IDNhanVien,@IDKhachHang,convert(date,@CheckIn,105),convert(date,@CheckOut,105),@TienDatCoc,@TrangThai)";

            return(DataProvider.Instance.ExecuteNonQueryPara(query, param, values));
        }
Example #2
0
        public bool ThemBangThuePhong(string IDNhanVien, string IDKhachHang, string TenPhong, DateTime CheckIn, DateTime CheckOut, string TienDatCoc)
        {
            BangThuePhongDTO BangThuePhong = new BangThuePhongDTO();

            try
            {
                BangThuePhong.IdNhanVien  = IDNhanVien;
                BangThuePhong.IdKhachHang = IDKhachHang;
                BangThuePhong.IdPhong     = DatPhongDAO.Instance.IdPhong(TenPhong);
                BangThuePhong.CheckIn     = CheckIn;
                BangThuePhong.CheckOut    = CheckOut;
                BangThuePhong.TienDatCoc  = int.Parse(TienDatCoc);
                BangThuePhong.TrangThai   = 0;
            }
            catch (Exception)
            {
                return(false);
            }
            return(DatPhongDAO.Instance.ThemBangThuePhong(BangThuePhong));
        }