コード例 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string s = "";

            if (studentGender.SelectedIndex == 0)
            {
                s = "f";
            }
            if (studentGender.SelectedIndex == 1)
            {
                s = "m";
            }

            /*try
             * {*/
            Common_Functions.fake_AddStudent(globalConnection, studentID.Text.ToString());
            Common_Functions.fake_addOtherLiving(globalConnection, studentID.Text.ToString());
            room_Selection rs = new room_Selection(globalConnection, s, studentID.Text.ToString());

            rs.parentLabel = this.studentRoom;
            rs.ShowDialog();
            rSelect.Visibility     = Visibility.Hidden;
            studentRoom.Visibility = Visibility.Visible;
            RoomClear.Visibility   = System.Windows.Visibility.Visible;

            /*}
             * catch
             * {
             *  MessageBox.Show("Проживающий с таким номером уже есть");
             * }   */
        }
コード例 #2
0
        private void selectRoom_Click(object sender, RoutedEventArgs e)
        {
            string s = "";

            if (gender == "Мужской")
            {
                s = "m";
            }
            if (gender == "Женский")
            {
                s = "f";
            }

            room_Selection rs = new room_Selection(globalConnection, s, studentID);

            rs.parentLabel = this.roomNumber;
            rs.ShowDialog();

            roomNumber.Visibility = Visibility.Visible;
            roomChange.Visibility = Visibility.Visible;
            selectRoom.Visibility = Visibility.Hidden;
            change.IsEnabled      = true;
            Close.IsEnabled       = true;
            evictionBT.IsEnabled  = true;
            evictTill.IsEnabled   = true;
        }