コード例 #1
0
        private void OrganizationsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OrganizationsForm organizationsForm = new OrganizationsForm(sqlConnectionString);

            organizationsForm.ShowDialog();
            LoadTabs();
        }
コード例 #2
0
ファイル: ResidentForm.cs プロジェクト: Glazic/Dormitory
        // Открытие окна оргранизаций для выбора организации
        private void organizationButton_Click(object sender, EventArgs e)
        {
            string value = OrganizationsForm.ShowDialog(sqlConnectionString, residentId);

            if (value != null)
            {
                Int32.TryParse(value, out int organizationId);
                Organization organization = db.GetTable <Organization>().SingleOrDefault(o => o.OrganizationId == organizationId);
                if (organization != null)
                {
                    organizationIdLabel.Text = organizationId.ToString();
                    organizationTextBox.Text = organization.Name;
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Открытие окна организаций для выбора
        /// </summary>
        /// <param name="sqlConnection">Подключение пользователя</param>
        /// <param name="residentId">Идентификатор пользователя</param>
        /// <returns></returns>
        public static string ShowDialog(SqlConnectionStringBuilder sqlConnectionString, int residentId)
        {
            OrganizationsForm residentForm = new OrganizationsForm(sqlConnectionString, residentId);

            return(residentForm.ShowDialog() == DialogResult.OK ? residentForm.organizationIdLabel.Text : null);
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: UserManName/Dormitory
        private void OrganizationsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OrganizationsForm organizationsForm = new OrganizationsForm();

            organizationsForm.Show();
        }