Example #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            AdministratorTaskAdd addAdministratorTask = new AdministratorTaskAdd(new AdministratorTask());

            if (addAdministratorTask.ShowDialog() == DialogResult.OK)
            {
                AdministratorTaskService.Add(addAdministratorTask.AdministratorTask);
                QueryAll();
            }
        }
Example #2
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            AdministratorTask administratorTask = AdministratorTaskBindingSource.Current as AdministratorTask;

            if (administratorTask == null)
            {
                MessageBox.Show("请选择要删除的任务");
                return;
            }
            else
            {
                AdministratorTaskService.Remove(administratorTask.AdministratorTaskId);
                QueryAll();
            }
        }
Example #3
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            AdministratorTask administratorTask = AdministratorTaskBindingSource.Current as AdministratorTask;

            if (administratorTask == null)
            {
                MessageBox.Show("请选择一项任务进行修改");
                return;
            }
            else
            {
                AdministratorTaskAdd addAdministratorTask = new AdministratorTaskAdd(administratorTask);
                if (addAdministratorTask.ShowDialog() == DialogResult.OK)
                {
                    AdministratorTaskService.Update(addAdministratorTask.AdministratorTask);
                    QueryAll();
                }
            }
        }
Example #4
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            switch (cmbQuery.SelectedIndex)
            {
            case 0:    // 全部
                WorkerTaskBindingSource.DataSource = AdministratorTaskService.QueryFinishedTaskByServer(CurrentWorker);
                break;

            case 1:    //按编号查询
                WorkerTaskBindingSource.DataSource = AdministratorTaskService.GetFinishedByID(txtQuery.Text, CurrentWorker);
                break;

            case 2:    //按创建日期查询

                WorkerTaskBindingSource.DataSource = AdministratorTaskService.QueryFinishedTaskByCreateDate(DateTime.Parse(txtQuery.Text), CurrentWorker);
                break;

            case 3:    //按截止日期查询
                WorkerTaskBindingSource.DataSource = AdministratorTaskService.QueryFinshedTaskByDDLDate(DateTime.Parse(txtQuery.Text), CurrentWorker);
                break;
            }
        }
Example #5
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            switch (cmbQuery.SelectedIndex)
            {
            case 0:    //全部
                AdministratorTaskBindingSource.DataSource = AdministratorTaskService.GetAll();
                break;

            case 1:    //按任务编号查询
                AdministratorTaskBindingSource.DataSource = AdministratorTaskService.Get(txtQuery.Text);
                break;

            case 2:    //按工作人员姓名查询
                AdministratorTaskBindingSource.DataSource = AdministratorTaskService.QueryTaskByServerName(txtQuery.Text);
                break;

            case 3:    //按工作人员ID查询
                AdministratorTaskBindingSource.DataSource = AdministratorTaskService.QueryTaskByServerID(txtQuery.Text);
                break;
            }
            AdministratorTaskBindingSource.ResetBindings(true);
        }
Example #6
0
 private void QueryUnFinished(Worker worker)
 {
     WorkerTaskBindingSource.DataSource = AdministratorTaskService.QueryUnFinishedTaskByServer(worker);
     WorkerTaskBindingSource.ResetBindings(false);
 }
Example #7
0
 public void QueryAll()
 {
     AdministratorTaskBindingSource.DataSource = AdministratorTaskService.GetAll();
     AdministratorTaskBindingSource.ResetBindings(false);
 }