示例#1
0
        public static void CreateClinic(string[] input, List <Clinic> listOfClinics)
        {
            ListOfRooms <Room> rooms = new ListOfRooms <Room>();

            int numberOfRooms = int.Parse(input[2]);

            for (int i = 0; i < numberOfRooms; i++)
            {
                Room room = new Room();
                room.Number = i + 1;
                rooms.Add(room);
            }

            Clinic clinic = new Clinic(input[1], numberOfRooms, rooms);

            listOfClinics.Add(clinic);
        }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            name = Name.Text;

            id = getNextid();


            if (name == "")
            {
                MessageBox.Show("Please, fill all fields!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            List <ModelEquipment> oprema    = new List <ModelEquipment>();
            List <ModelMedicine>  medicines = new List <ModelMedicine>();

            Room med = new Room(id, name, oprema, medicines, true);

            RoomController EqContr = new RoomController();

            List <Room> lista = new List <Room>();

            lista = EqContr.GetAll();

            Boolean valid = EqContr.isNameValid(name);


            if (!valid)
            {
                MessageBox.Show("Room with this name already exists!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            EqContr.New(med);



            GridMain.Children.Clear();
            UserControl usc = new ListOfRooms();

            GridMain.Children.Add(usc);
        }