Exemple #1
0
        /// <summary>
        /// 获取任务单
        /// </summary>
        /// 作者:王宇昊
        /// 创建时间:2014-09-24
        /// 修改时间:2014-09-24
        private void GetTask()
        {
            try
            {
                dgvTask.Rows.Clear();
                ExecutorBLL          Task         = new ExecutorBLL();
                List <TaskModel>     TaskList     = new List <TaskModel>();
                ConferenceAuditorBLL ResourceName = new ConferenceAuditorBLL();
                List <ResourceModel> Resource     = new List <ResourceModel>();
                TaskList = Task.GetTask(employee);
                int n = 0;
                foreach (TaskModel task in TaskList)
                {
                    if (task.TaskConference.ConIsDone == '0')
                    {
                        dgvTask.Rows.Add();
                        dgvTask.Rows[n].Cells["ColumnConferenceId"].Value = task.TaskConference.ConId;
                        dgvTask.Rows[n].Cells["ColumnConference"].Value   = task.TaskBdrName;
                        dgvTask.Rows[n].Cells["ColumnBoardroom"].Value    = task.TaskConference.ConName;
                        dgvTask.Rows[n].Cells["ColumnStartTime"].Value    = task.TaskConference.ConStartTime;
                        dgvTask.Rows[n].Cells["ColumnResource"].Value     = "";
                        for (int i = 0; i < task.TaskResource.Count; i++)
                        {
                            Resource = ResourceName.GetAllResource();
                            foreach (ResourceModel Res in Resource)
                            {
                                if (Res.ResourceId == Convert.ToInt32(task.TaskResource[i]))
                                {
                                    dgvTask.Rows[n].Cells["ColumnResource"].Value += task.TaskResource[i].ToString() + Res.ResourceClass + "\r\n";
                                }
                            }
                        }
                        n++;
                    }
                }

                //txtResId.Text = this.dgvTask.CurrentRow.Cells["ColumnResourceId"].Value.ToString();
                dgvTask_CellContentClick(null, null);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #2
0
        /// <summary>
        /// 读取资源信息
        /// </summary>
        private void load()
        {
            try
            {
                dgvResource.Rows.Clear();
                ConferenceAuditorBLL Resource     = new ConferenceAuditorBLL();
                List <ResourceModel> ResourceList = new List <ResourceModel>();
                ResourceList = Resource.GetAllResource();
                int n = 0;
                foreach (ResourceModel resource in ResourceList)
                {
                    dgvResource.Rows.Add();

                    dgvResource.Rows[n].Cells["ColumnResourceId"].Value    = resource.ResourceId;
                    dgvResource.Rows[n].Cells["ColumnResourceClass"].Value = resource.ResourceClass;
                    if (resource.ResourceStatus == '0')
                    {
                        dgvResource.Rows[n].Cells["ColumnResourceStatus"].Value = "空闲";
                    }
                    if (resource.ResourceStatus == '1')
                    {
                        dgvResource.Rows[n].Cells["ColumnResourceStatus"].Value = "被预订";
                    }
                    if (resource.ResourceStatus == '2')
                    {
                        dgvResource.Rows[n].Cells["ColumnResourceStatus"].Value = "使用中";
                    }
                    if (resource.ResourceStatus == '3')
                    {
                        dgvResource.Rows[n].Cells["ColumnResourceStatus"].Value = "损坏";
                    }
                    n++;
                }
                txtResId.Text    = this.dgvResource.CurrentRow.Cells["ColumnResourceId"].Value.ToString();
                cmbResClass.Text = this.dgvResource.CurrentRow.Cells["ColumnResourceClass"].Value.ToString();
                cmbStatus.Text   = this.dgvResource.CurrentRow.Cells["ColumnResourceStatus"].Value.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }