예제 #1
0
        private void EditBtn_Click(object sender, EventArgs e)
        {
            DateTime      onlyDate = DateTime.Parse(dataGridView1.CurrentRow.Cells[4].Value.ToString());
            WorkerAddForm a        = new WorkerAddForm("Редактирование данных о сотруднике",
                                                       dataGridView1.CurrentRow.Cells[3].Value.ToString(),
                                                       dataGridView1.CurrentRow.Cells[0].Value.ToString(),
                                                       dataGridView1.CurrentRow.Cells[1].Value.ToString(),
                                                       dataGridView1.CurrentRow.Cells[2].Value.ToString(),
                                                       onlyDate, true);

            a.ShowDialog();
        }
예제 #2
0
파일: Form1.cs 프로젝트: RusTNT/-
        private void pictureBox6_Click(object sender, EventArgs e)
        {
            DataSet1 newDataSet1 = new DataSet1();

            DataSet1TableAdapters.workerTableAdapter workerTA = new DataSet1TableAdapters.workerTableAdapter();
            workerTA.Fill(newDataSet1.worker);
            workerTA.Adapter.SelectCommand.CommandText = "SELECT * FROM worker WHERE worker_login='******' and worker_password ='******'" + " and worker_type = 'Администратор'";
            workerTA.Fill(newDataSet1.worker);
            if (newDataSet1.worker.Rows.Count == 1)
            {
                WorkerAddForm a = new WorkerAddForm("Добавление нового сотрудника", "", "", "", "", DateTime.Now, false);
                a.ShowDialog();
            }
            else
            {
                MessageBox.Show("Действие доступно только администратору");
            }
        }