public int AddDateBooking(int dateAvaliableId, int userId, DateTime startDateBooking, DateTime endDateBooking, decimal paid, decimal totalCostByRoom)
 {
     ChannelManagerDataSet.DateAvaliableRow dateAvaliableRow  = _dataSet.DateAvaliable.FindByid(dateAvaliableId);
     ChannelManagerDataSet.UsersRow         usersRow          = _dataSet.Users.FindByid(userId);
     ChannelManagerDataSet.DateBookingRow   newDateBookingRow = _dataSet.DateBooking.AddDateBookingRow(dateAvaliableRow, usersRow, startDateBooking, endDateBooking, paid, totalCostByRoom);
     return(_dateBookingTableAdapter.Update(newDateBookingRow));
 }
        public String GetIpAddrByNewBooking(int bookingId)
        {
            ChannelManagerDataSet.DateBookingRow          bookingRow    = _dataSet.DateBooking.FindByid(bookingId);
            ChannelManagerDataSet.DateAvaliableRow        dateAvaliable = bookingRow.DateAvaliableRow;
            ChannelManagerDataSet.HotelRoomsRow           hotelRoomRow  = dateAvaliable.HotelRoomsRow;
            ChannelManagerDataSet.HotelRoomsCategoriesRow catRow        = hotelRoomRow.HotelRoomsCategoriesRow;
            ChannelManagerDataSet.HotelsRow      hotelRow = catRow.HotelsRow;
            ChannelManagerDataSet.ARIIpAddrRow[] ipRows   = hotelRow.GetARIIpAddrRows();
            String resultString = "";

            foreach (ChannelManagerDataSet.ARIIpAddrRow ip in ipRows)
            {
                resultString += ip.ipAddr + ';';
            }
            return(resultString);
        }
        public int AddBooking(int dateAvaliableId, String firstName, String surName, String patronymic, int passportSeries, int passportNum, DateTime startDateRate, DateTime endDateRate, decimal paid, decimal totalCostByRoom)
        {
            ChannelManagerDataSet.DateAvaliableRow dateAvaliableRow = _dataSet.DateAvaliable.FindByid(dateAvaliableId);
            int newUserId = AddUser(firstName, surName, patronymic, passportSeries, passportNum);

            if (newUserId >= 0)
            {
                ChannelManagerDataSet.UsersRow       userRow           = _dataSet.Users.FindByid(newUserId);
                ChannelManagerDataSet.DateBookingRow newDateBookingRow = _dataSet.DateBooking.AddDateBookingRow(dateAvaliableRow, userRow, startDateRate, endDateRate, paid, totalCostByRoom);
                _usersTableAdapter.Update(newDateBookingRow);
                return(newDateBookingRow.id);
            }
            else
            {
                return(-1); //Ошибка добавления пользователя в БД.
            }
        }