private void btn退回_Click(object sender, EventArgs e)
        {
            车辆作业 clzy = m_clzy;

            using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <车辆作业>())
            {
                rep.Attach(clzy);

                foreach (var i in clzy.专家任务.任务)
                {
                    if (i.任务号 == clzy.最新作业状态.异常参数)
                    {
                        m_dao2.撤销专家任务(clzy.专家任务, i);
                        break;
                    }
                }
            }

            m_处理 = 1;
            DateTime?通知时间 = System.DateTime.Now;
            string   msg  = "动态任务追加失败";

            if (m_dm.DataControls["理由"].SelectedDataValue != null)
            {
                msg += ":" + m_dm.DataControls["理由"].SelectedDataValue.ToString();
            }
            m_dao.处理作业异常(m_clzy, msg, 通知时间, true);

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Beispiel #2
0
        private static void 撤销任务的专家任务(任务 entity)
        {
            if (entity.专家任务 == null)
            {
                return;
            }

            if (撤销Validation(entity, 撤销任务.撤销专家任务))
            {
                m_专家任务dao.撤销专家任务(entity);
            }
        }
Beispiel #3
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.专家任务;
                            }
                        }
                    }
                }
            }
        }