Exemplo n.º 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;
            }
        }
Exemplo n.º 2
0
        internal static void 专家调度一级静态优化_DoubleClick(Xceed.Grid.Cell srcCell, 专家任务性质?zjrwxz)
        {
            if (srcCell == null)
            {
                return;
            }

            if (srcCell.ParentColumn.FieldName == "移出")
            {
                if (srcCell.ParentRow.Cells["新任务号"].Value != null)
                {
                    Xceed.Grid.Cell srcCell2 = srcCell.ParentRow.Cells[m_topGridDragFildeName].Tag as Xceed.Grid.Cell;
                    srcCell.ParentGrid.DataRows.Remove(srcCell.ParentRow as Xceed.Grid.DataRow);
                    srcCell2.ParentGrid.DataRows.Remove(srcCell2.ParentRow as Xceed.Grid.DataRow);
                }
            }
            else if (srcCell.ParentColumn.FieldName == "取消")
            {
                任务 x = null, y = null;
                if (srcCell.ParentRow.Cells["新任务号"].Value != null)
                {
                    //x = srcCell.ParentRow.Tag as 任务;
                    return;
                }
                if (srcCell.ParentRow.Cells[m_topGridDragFildeName].Value != null)
                {
                    if (srcCell.ParentRow.Cells[m_topGridDragFildeName].Tag != null)
                    {
                        y = (srcCell.ParentRow.Cells[m_topGridDragFildeName].Tag as Xceed.Grid.Cell).ParentRow.Tag as 任务;
                    }
                }
                if (m_dao.撤销专家任务(x, y))
                {
                    if (srcCell.ParentRow.Cells[m_topGridDragFildeName].Tag != null)
                    {
                        (srcCell.ParentRow.Cells[m_topGridDragFildeName].Tag as Xceed.Grid.Cell).ParentRow.ResetForeColor();
                    }
                    srcCell.ParentRow.ResetForeColor();
                    srcCell.ParentRow.Cells[m_topGridDragFildeName].Value = null;
                    srcCell.ParentRow.Cells[m_topGridDragFildeName].Tag   = null;
                    srcCell.ParentRow.Cells["新任务号"].Value = null;
                }
                else
                {
                    Feng.MessageForm.ShowWarning("无法移出任务!", "操作失败");
                }
            }
            else if (srcCell.ParentColumn.FieldName == "确认")
            {
                if (srcCell.ParentRow.Cells["新任务号"].Value != null)
                {
                    return;
                }

                Xceed.Grid.Cell destCell = srcCell.ParentRow.Cells[m_topGridDragFildeName].Tag as Xceed.Grid.Cell;
                if (destCell == null)
                {
                    return;
                }

                任务   x    = srcCell.ParentRow.Tag as 任务;
                任务   y    = destCell.ParentRow.Tag as 任务;
                专家任务 zjrw = null;

                string bz = null;
                if (srcCell.ParentRow.Cells["备注"].Value != null)
                {
                    bz = (string)srcCell.ParentRow.Cells["备注"].Value;
                }

                zjrw = m_dao.生成专家任务(x, y, zjrwxz, bz);

                if (zjrw != null)
                {
                    srcCell.ParentRow.Cells["新任务号"].Value = zjrw.新任务号;
                    srcCell.ParentRow.Cells["新任务号"].Tag   = zjrw;
                }
            }
            else if (srcCell.ParentColumn.FieldName == "紧急下达")
            {
                if (srcCell.ParentRow.Cells["新任务号"].Tag != null)
                {
                    var zjrw = srcCell.ParentRow.Cells["新任务号"].Tag as 专家任务;
                    if (!zjrw.达时间.HasValue)
                    {
                        using (var form = new 紧急下达(zjrw))
                        {
                            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                            {
                                srcCell.ParentRow.Cells["新任务号"].Tag = form.专家任务;
                            }
                        }
                    }
                }
            }
        }