Пример #1
0
        public bool BeforeChamberSelection()
        {
            if (ic_Reserv.tb_noClient.Text != "" && ic_Reserv.tb_noClient.Text != "-1")
            {
                if (ir_Reserv.DTP_Debut.Enabled && ir_Reserv.DTP_Fin.Enabled)
                {
                    TA_BK_CHAMBRE.FillBy(DS_Master.BK_CHAMBRE, ir_Reserv.DTP_Debut.Value, ir_Reserv.DTP_Fin.Value);
                }

                ic_Reserv.bt_list.Enabled   = false;
                ir_Reserv.DTP_Debut.Enabled = false;
                ir_Reserv.DTP_Fin.Enabled   = false;

                errorProvider.SetError(ic_Reserv.bt_list, "");
                return(true);
            }
            else
            {
                errorProvider.SetError(ic_Reserv.bt_list, "Choisissez un client avant d'ajouter des chambres.");
            }

            return(false);
        }
Пример #2
0
        private void NewReserv()
        {
            TA_DE.FillBy(DS_Master.DE);
            TA_BK_CHAMBRE.Fill(DS_Master.BK_CHAMBRE);

            BS_RESERVATION.Position = BS_RESERVATION.Count - 1;
            BS_BK_CHAMBRE.Position  = BS_BK_CHAMBRE.Count - 1;
            DS_Master.RESERVATION.Columns["IdReser"].AutoIncrementSeed = (int)DS_Master.RESERVATION.Rows[BS_RESERVATION.Position]["IdReser"] + 1;

            DTR_RESERV              = DS_Master.Tables["Reservation"].NewRow();
            DTR_RESERV["IdReser"]   = (int)DS_Master.RESERVATION.Columns["IdReser"].AutoIncrementSeed;
            DTR_RESERV["IdCli"]     = -1;
            DTR_RESERV["DateReser"] = DateTime.Today;
            DTR_RESERV["DateDebut"] = DateTime.Today;
            DTR_RESERV["DateFin"]   = DateTime.Today.AddDays(3);
            DS_Master.Tables["Reservation"].Rows.Add(DTR_RESERV);

            BS_RESERVATION.Position = BS_RESERVATION.Count - 1;

            Link_All(false);
            Link_Reservation(true);

            EmptyFields();
        }