Exemplo n.º 1
0
        public static string ShowDialog(int residentId)
        {
            ResidentForm residentForm = new ResidentForm(residentId);

            //	this.Show();
            return(residentForm.ShowDialog() == DialogResult.OK ? residentForm.nameLabel.Text : "");
        }
Exemplo n.º 2
0
        // Открывает окно для добавления нового жителя
        private void addButton_Click(object sender, EventArgs e)
        {
            ResidentForm residentForm = new ResidentForm(sqlConnectionString);

            residentForm.ShowDialog();
            LoadDataGrid();
        }
Exemplo n.º 3
0
 // Открывает окно для редактирования выбранного жителя
 private void changeButton_Click(object sender, EventArgs e)
 {
     Int32.TryParse(residentIdLabel.Text, out int residentId);
     if (residentId == 0)
     {
         MessageBox.Show("Выберите жителя");
     }
     else
     {
         ResidentForm.ShowDialog(sqlConnectionString, residentId);
         LoadDataGrid();
     }
 }
Exemplo n.º 4
0
        private void linkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            int residentId = ((LinkLabelModified)sender).residentId;
            int roomId     = ((LinkLabelModified)sender).roomId;

            if (residentId != 0)
            {
                ResidentForm.ShowDialog(residentId);
                //MessageBox.Show("residentId:" + residentId.ToString());
            }
            else if (roomId != 0)
            {
                //MessageBox.Show("roomId:" + roomId.ToString());
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Открывает окно с информацией о выбранном жителе с возможностью выселить из комнаты
        /// </summary>
        /// <param name="sqlConnection">Подключение пользователя</param>
        /// <param name="residentId">Идентификатор жителя</param>
        /// <param name="roomId">Идентификатор коматы</param>
        /// <returns></returns>
        public static string ShowDialogForOldResident(SqlConnectionStringBuilder sqlConnectionString, int residentId, int roomId)
        {
            ResidentForm residentForm = new ResidentForm(sqlConnectionString, residentId, roomId);

            return(residentForm.ShowDialog() == DialogResult.OK ? residentForm.nameLabel.Text : "");
        }