Exemple #1
0
        //Thêm chi tiết thuê phòng
        public void insertChiTietThuePhong(ChiTietThuePhongDTO cttpDTO)
        {
            chitietthuephong cttp = new chitietthuephong();

            cttp.maphieuthue = cttpDTO.Maphieuthue;
            cttp.maphong     = cttpDTO.Maphong;
            cttp.ngay        = (DateTime)cttpDTO.Ngay;
            cttp.madichvu    = cttpDTO.Madichvu;
            cttp.soluong     = (int)cttpDTO.Soluong;
            htDataContext.chitietthuephongs.InsertOnSubmit(cttp);
            htDataContext.SubmitChanges();
        }
        public int insertChiTietThuePhong(ChiTietThuePhongDTO cttpDTO)
        {
            try
            {
                chitietthuephong cttp = new chitietthuephong();
                cttp.maphieuthue = cttpDTO.Maphieuthue;
                cttp.maphong = cttpDTO.Maphong;
                cttp.ngay = (DateTime)cttpDTO.Ngay;
                cttp.madichvu = cttpDTO.Madichvu;
                cttp.soluong = (int)cttpDTO.Soluong;
                htDataContext.chitietthuephongs.InsertOnSubmit(cttp);
                htDataContext.SubmitChanges();
                return 1;
            }
            catch
            {

                return 0;
            }
        }