Example #1
0
        private void btn确定_Click(object sender, EventArgs e)
        {
            if (m_cm.SaveCurrent())
            {
                m_zjrw.时间要求始 = (DateTime)m_cm.DisplayManager.DataControls["时间要求始"].SelectedDataValue;
                m_zjrw.时间要求止 = (DateTime)m_cm.DisplayManager.DataControls["时间要求止"].SelectedDataValue;
                m_zjrw.区域编号  = (string)m_cm.DisplayManager.DataControls["区域编号"].SelectedDataValue;
                m_zjrw.缓急程度  = (int)m_cm.DisplayManager.DataControls["缓急程度"].SelectedDataValue;

                // 静态紧急下达
                if (m_rw == null)
                {
                    m_专家任务Dao.达专家任务(m_zjrw, System.DateTime.Now);
                }
                // 动态调度
                else
                {
                    m_zjrw = m_专家任务Dao.生成专家任务(m_zjrw, m_rw, m_xz);
                }
            }
            else
            {
                this.DialogResult = System.Windows.Forms.DialogResult.None;
            }
        }
        void 已优化任务_DoubleClick(object sender, EventArgs e)
        {
            Xceed.Grid.Cell srcCell = sender as Xceed.Grid.Cell;
            if (srcCell == null)
            {
                return;
            }
            srcCell.ParentRow.EndEdit();

            if (srcCell.ParentColumn.FieldName == "移出")
            {
                if (srcCell.ParentRow.ForeColor == m_disableColor)
                {
                    srcCell.ParentGrid.DataRows.Remove(srcCell.ParentRow as Xceed.Grid.DataRow);
                }
            }
            else if (srcCell.ParentColumn.FieldName == "确认")
            {
                if (srcCell.ParentRow.ForeColor == m_disableColor)
                {
                    return;
                }

                if (专家任务下达Validation(srcCell.ParentRow))
                {
                    专家任务 entity = srcCell.ParentRow.Tag as 专家任务;
                    //entity.时间要求始 = (DateTime)srcCell.ParentRow.Cells["时间要求始"].Value;
                    //entity.时间要求止 = (DateTime)srcCell.ParentRow.Cells["时间要求止"].Value;
                    entity.时间要求始 = entity.时间要求始;
                    entity.时间要求止 = entity.时间要求止;
                    entity.区域编号  = (string)srcCell.ParentRow.Cells["区域名称"].Value;
                    entity.缓急程度  = (int)srcCell.ParentRow.Cells["缓急程度"].Value;
                    if (m_dao.达专家任务(entity, System.DateTime.Now))
                    {
                        srcCell.ParentRow.ForeColor = m_disableColor;
                        srcCell.ParentRow.ReadOnly  = true;
                    }
                }
            }
        }