Пример #1
0
        public void TablesUpload(string name)
        {
            switch (name)
            {
            case "client":
                ConectionDB.Connection(@"SELECT clients_id, surname as ""Фамилия"", first_name as ""Имя"", last_name as ""Отчество"", identify as ""Документ"", email as ""E-mail"", phone as ""Телефон"" from clients", dgv);
                dgv.Columns[0].Visible = false;
                break;

            case "rooms":
                ConectionDB.Connection(@"select hotel_room.room_id, hotel_room.number_of_room as ""Номер комнаты"", type_of_number.type as ""Тип номера"", hotel_room.amount_of_sleeppoint as ""Количество спальных мест"", hotel_room.floor_of_room as ""Этаж"", hotel_room.state as ""Статус"", type_of_bed.name_type as ""Спальное место"" from hotel_room, type_of_number, type_of_bed where type_of_number.type_id = hotel_room.type_id and type_of_bed.type_id = hotel_room.type_of_bed_id", dgv);
                dgv.Columns[0].Visible = false;
                dgv.Columns[5].Visible = false;
                break;

            case "services":
                ConectionDB.Connection("Select service_id, service_name as Услуга, price_of_service as Цена from services", dgvList);
                dgvList.Columns[0].Visible = false;
                break;

            case "type":
                ConectionDB.Connection("Select type_id, type_of_number.type as Тип, price as Стоимость from type_of_number", dgv);
                dgv.Columns[0].Visible = false;
                break;

            case "bills":
                ConectionDB.Connection("Select * final_bill", dgv);
                dgv.Columns[0].Visible = false;
                break;

            default:
                break;
            }
        }
Пример #2
0
 private void btShowBills_Click(object sender, EventArgs e)
 {
     dgvControl1.Controls["btNew"].Visible  = false;
     dgvControl1.Controls["btEdit"].Visible = true;
     dgvControl1.Show();
     dgvControl1.BringToFront();
     mainLabel.Text = "Квитанции";
     ConectionDB.Connection(@"SELECT final_bill.final_bill_id, clients.surname as ""Клиент"", hotel_room.number_of_room as ""Номер гостиницы"", final_bill.number_of_days as ""Количество дней"", final_bill.final_summa as ""Стоимость""  FROM final_bill, clients, hotel_room where final_bill.clients_id = clients.clients_id and final_bill.room_id = hotel_room.room_id", dgv);
     dgv.Columns[0].Visible = false;
     dgvControl1.selectedId = 0;
 }
Пример #3
0
 private void btShowRequests_Click(object sender, EventArgs e)
 {
     dgvControl1.Controls["btEdit"].Visible = false;
     dgvControl1.Show();
     dgvControl1.BringToFront();
     dgvControl1.Controls["btNew"].Visible = false;
     mainLabel.Text = "Текущие заявки";
     ConectionDB.Connection(@"select card_of_registration.card_id, clients.surname as ""Клиент"", hotel_room.number_of_room as ""Номер комнаты"", card_of_registration.data_set as ""Заселение"", card_of_registration.data_out as ""Выселение"", type_of_pay.name_type as ""Тип оплаты"" from card_of_registration, clients, hotel_room, type_of_pay where card_of_registration.clients_id = clients.clients_id and card_of_registration.room_id = hotel_room.room_id and card_of_registration.type_pay_id = type_of_pay.type_id", dgv);
     dgvControl1.selectedId = 0;
     dgv.Columns[0].Visible = false;
 }