Esempio n. 1
0
        private void workers_modify_button_Click(object sender, EventArgs e)
        {
            if (workers_dataGridView.SelectedRows.Count == 0)
            {
                Common.ErrAlert("请选择一行再修改!");
                return;
            }
            WorkerListData worker = workerListData.ToList()[workers_dataGridView.SelectedRows[0].Index];

            if (null == worker)
            {
                Common.ErrAlert("加载选择的工人数据发生错误!");
                return;
            }
            if (null == WorkerProjectInfo)
            {
                Common.ErrAlert("请选择项目后再操作!");
                return;
            }
            WorkerInfoForm workerInfoForm = new WorkerInfoForm(db, worker, WorkerProjectInfo, loginUser, workerTypes, nations);

            if (workerInfoForm.ShowDialog() == DialogResult.OK)
            {
                LoadWorkersData(workers_projects_comboBox);
            }
        }
Esempio n. 2
0
        private void worker_add_button_Click(object sender, EventArgs e)
        {
            if (null == WorkerProjectInfo)
            {
                Common.ErrAlert("请选择项目后再操作!");
                return;
            }
            WorkerInfoForm workerInfoForm = new WorkerInfoForm(db, null, WorkerProjectInfo, loginUser, workerTypes, nations);

            if (workerInfoForm.ShowDialog() == DialogResult.OK)
            {
                LoadWorkersData(workers_projects_comboBox);
            }
        }