void m_车载ID当前使用情况集合_CurrentRowChanged(object sender, EventArgs e) { if (m_车载ID当前使用情况集合.CurrentRow == null) { LoadData(null); } else { 车辆作业 clzy = m_车载ID当前使用情况集合.CurrentRow.Tag as 车辆作业; if (clzy != null) { m_truckId = clzy.车载Id号; if (!string.IsNullOrEmpty(m_truckId)) { m_currentWorkIdx = 0; LoadData(clzy.ID.ToString()); } } } }
private void 实时监控异常处理_Load(object sender, EventArgs e) { AssociateDataControls(new Control[] { pnl异常情况, pnl处理时间, pnl处理结果 }, m_cm.DisplayManager, "实时监控_车辆作业_异常处理"); m_cm.AllowInsert = true; m_cm.AddNew(); 车辆作业 clzy = m_clzy; using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <车辆作业>()) { rep.Initialize(clzy.最新作业状态, clzy); } m_cm.DisplayManager.DataControls["异常情况"].ReadOnly = true; m_cm.DisplayManager.DataControls["异常情况"].SelectedDataValue = clzy.最新作业状态.异常情况; m_cm.DisplayManager.DataControls["处理时间"].SelectedDataValue = DateTime.Now; m_dao.处理作业异常(m_clzy, null, null, true); }
void 车队调度静态任务下达_DoubleClick(object sender, EventArgs e) { Xceed.Grid.Cell srcCell = sender as Xceed.Grid.Cell; if (srcCell == null) { return; } srcCell.ParentRow.EndEdit(); if (srcCell.GridControl == m_待命车辆_单车单任务Grid) { 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); srcCell.ParentRow.Cells["作业号"].Value = null; srcCell.ParentRow.Cells["作业号"].Tag = null; srcCell.ParentRow.Cells["中心新任务号"].Value = null; srcCell.ParentRow.Cells["中心新任务号"].Tag = null; } } else if (srcCell.ParentColumn.FieldName == "确认") { if (srcCell.ParentRow.Cells["作业号"].Value != null) { return; } Xceed.Grid.Cell destCell = srcCell.ParentRow.Cells["中心新任务号"].Tag as Xceed.Grid.Cell; if (destCell == null) { return; } 车辆 cl = srcCell.ParentRow.Tag as 车辆; 专家任务 zjrw = destCell.ParentRow.Tag as 专家任务; 车辆作业 clzy = m_clzyDao.生成车辆作业(cl, zjrw, (string)srcCell.ParentRow.Cells["作业备注"].Value); srcCell.ParentRow.Cells["作业号"].Value = clzy.作业号; srcCell.ParentRow.Cells["作业号"].Tag = clzy; srcCell.ParentRow.Cells["中心新任务号"].ForeColor = 专家调度一级静态优化.优化DisableColor; m_待命车辆_单车单任务Grid.ResetRowData(srcCell.ParentRow as Xceed.Grid.DataRow); srcCell.ParentRow.Cells["作业号"].Value = clzy.作业号; } else if (srcCell.ParentColumn.FieldName == "撤销") { if (srcCell.ParentRow.Cells["作业号"].Value != null) { //m_clzyDao.撤销车辆作业(srcCell.ParentRow.Cells["作业号"].Tag as 车辆作业); //srcCell.ParentRow.Cells["作业号"].Value = null; //srcCell.ParentRow.Cells["作业号"].Tag = null; return; } if (srcCell.ParentRow.Cells["中心新任务号"].Value != null) { if (srcCell.ParentRow.Cells["中心新任务号"].Tag == null) { return; } (srcCell.ParentRow.Cells["中心新任务号"].Tag as Xceed.Grid.Cell).ParentRow.ResetForeColor(); srcCell.ParentRow.Cells["中心新任务号"].Value = null; srcCell.ParentRow.Cells["中心新任务号"].Tag = null; } } } if (srcCell.ParentColumn.FieldName == "后续作业计划") { 车辆 cl = srcCell.ParentRow.Tag as 车辆; if (cl != null) { new 单车后续作业计划(cl).ShowDialog(); } } else if (srcCell.ParentColumn.FieldName == "车牌号") { new 车辆详细信息(srcCell.ParentRow.Tag as 车辆).ShowDialog(); } }
void 车队调度静态任务下达_DoubleClick(object sender, EventArgs e) { Xceed.Grid.Cell srcCell = sender as Xceed.Grid.Cell; if (srcCell == null) { return; } srcCell.ParentRow.EndEdit(); if (srcCell.GridControl == m_待命车辆_单车多任务Grid) { if (srcCell.ParentColumn.FieldName == "确认") { for (int i = 1; i <= m_multiTaskCnt; ++i) { string si = i.ToString(); if (srcCell.ParentRow.Cells["中心新任务号" + si].Value != null) { Xceed.Grid.Cell destCell = srcCell.ParentRow.Cells["中心新任务号" + si].Tag as Xceed.Grid.Cell; if (destCell == null) { continue; } if (srcCell.ParentRow.Cells["作业号" + si].Value != null) { continue; } 车辆 cl = srcCell.ParentRow.Tag as 车辆; 专家任务 zjrw = destCell.ParentRow.Tag as 专家任务; 车辆作业 clzy = m_clzyDao.生成车辆作业(cl, zjrw, (string)srcCell.ParentRow.Cells["作业备注"].Value); srcCell.ParentRow.Cells["作业号" + si].Value = clzy.作业号; srcCell.ParentRow.Cells["作业号" + si].Tag = clzy; srcCell.ParentRow.Cells["作业号Any"].Value = clzy.作业号; srcCell.ParentRow.Cells["作业号Any"].Tag = clzy; srcCell.ParentRow.Cells["中心新任务号" + si].ForeColor = 专家调度一级静态优化.优化DisableColor; } } m_待命车辆_单车多任务Grid.ResetRowData(srcCell.ParentRow as Xceed.Grid.DataRow); } else if (srcCell.ParentColumn.FieldName == "撤销") { if (srcCell.ParentRow.Cells["作业号Any"].Value != null) { return; } for (int i = 1; i <= m_multiTaskCnt; ++i) { string si = i.ToString(); if (srcCell.ParentRow.Cells["中心新任务号" + si].Value != null) { if (srcCell.ParentRow.Cells["中心新任务号" + si].Tag == null) { continue; } (srcCell.ParentRow.Cells["中心新任务号" + si].Tag as Xceed.Grid.Cell).ParentRow.ResetForeColor(); srcCell.ParentRow.Cells["中心新任务号" + si].Value = null; srcCell.ParentRow.Cells["中心新任务号" + si].Tag = null; } } } } if (srcCell.ParentColumn.FieldName == "后续作业计划") { 车辆 cl = srcCell.ParentRow.Tag as 车辆; if (cl != null) { new 单车后续作业计划(cl).ShowDialog(); } } else if (srcCell.ParentColumn.FieldName == "车牌号") { new 车辆详细信息(srcCell.ParentRow.Tag as 车辆).ShowDialog(); } }
public 实时监控异常处理(车辆作业 clzy) { InitializeComponent(); m_clzy = clzy; }
public 实时监控作业退回申请(车辆作业 clzy) { InitializeComponent(); m_clzy = clzy; }
public 实时监控经过地名时间(车辆作业 clzy, string areas) { InitializeComponent(); m_clzy = clzy; m_areas = areas.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);; }
private void 实时监控异常处理_Load(object sender, EventArgs e) { AssociateDataControls(new Control[] { pnl异常情况, pnl追加后任务性质, pnl作业号, pnl承运车辆, pnl任务号1, pnl任务性质1, pnl箱型1, pnl监管箱1, pnl货物特征1, pnl时间要求1, pnl起始地途经地终止地1, pnl当前位置1, pnl备注1, pnl任务号2, pnl任务性质2, pnl箱型2, pnl货物特征2, pnl时间要求2, pnl起始地途经地终止地2, pnl备注2, pnl通知驾驶员时间, pnl理由 }, m_dm, "实时监控_车辆作业_动态任务追加"); 车辆作业 clzy = m_clzy; 任务 rw1 = null, rw2 = null; using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <车辆作业>()) { rep.Initialize(clzy.车辆, clzy); rep.Initialize(clzy.专家任务, clzy); rep.Initialize(clzy.专家任务.任务, clzy.专家任务); rw1 = clzy.专家任务.任务[0]; var list = rep.List <任务>("from 任务 where 任务号 = :任务号", new Dictionary <string, object> { { "任务号", clzy.最新作业状态.异常参数 } }); if (list.Count > 0) { rw2 = list[0]; } } m_dm.SetDataBinding(new List <车辆作业> { m_clzy }, string.Empty); m_dm.Position = 0; m_dm.DisplayCurrent(); m_dm.DataControls["作业号"].SelectedDataValue = clzy.作业号; m_dm.DataControls["承运车辆"].SelectedDataValue = clzy.车辆.车牌号; m_dm.DataControls["异常情况"].SelectedDataValue = clzy.最新作业状态.异常情况; // "动态任务追加"; m_dm.DataControls["追加后任务性质"].SelectedDataValue = clzy.专家任务.任务性质; if (rw2 != null) { m_dm.DataControls["任务号1"].SelectedDataValue = rw2.任务号; m_dm.DataControls["任务性质1"].SelectedDataValue = rw2.任务性质; m_dm.DataControls["箱型1"].SelectedDataValue = rw2.箱型; m_dm.DataControls["货物特征1"].SelectedDataValue = rw2.货物特征; m_dm.DataControls["时间要求1"].SelectedDataValue = Helper.DateTime2String(rw2.时间要求始, rw2.时间要求止); m_dm.DataControls["起始地途经地终止地1"].SelectedDataValue = Feng.Utils.NameValueControlHelper.GetMultiString("人员单位_装卸货地_全部", rw2.起始地编号 + "," + rw2.途径地编号 + "," + rw2.终止地编号); m_dm.DataControls["备注1"].SelectedDataValue = rw2.备注; m_dm.DataControls["监管箱1"].SelectedDataValue = rw2.备注; m_dm.DataControls["当前位置1"].SelectedDataValue = clzy.最新作业状态.车辆位置; } if (rw1 != null) { m_dm.DataControls["任务号2"].SelectedDataValue = rw1.任务号; m_dm.DataControls["任务性质2"].SelectedDataValue = rw1.任务性质; m_dm.DataControls["箱型2"].SelectedDataValue = rw1.箱型; m_dm.DataControls["货物特征2"].SelectedDataValue = rw1.货物特征; m_dm.DataControls["时间要求2"].SelectedDataValue = Helper.DateTime2String(rw1.时间要求始, rw1.时间要求止); m_dm.DataControls["起始地途经地终止地2"].SelectedDataValue = Feng.Utils.NameValueControlHelper.GetMultiString("人员单位_装卸货地_全部", rw1.起始地编号 + "," + rw1.途径地编号 + "," + rw1.终止地编号); m_dm.DataControls["备注2"].SelectedDataValue = rw1.备注; } m_dm.DataControls["通知驾驶员时间"].SelectedDataValue = DateTime.Now; m_dm.DataControls["通知驾驶员时间"].ReadOnly = false; m_dm.DataControls["理由"].ReadOnly = false; m_dao.处理作业异常(m_clzy, null, null, true); }
public static void OnCellDoubleClick(object sender, EventArgs e) { Xceed.Grid.Cell srcCell = sender as Xceed.Grid.Cell; if (srcCell == null) { return; } System.Windows.Forms.DialogResult ret = System.Windows.Forms.DialogResult.None; var row = srcCell.ParentRow as Xceed.Grid.DataRow; (srcCell.GridControl as IBoundGrid).DisplayManager.SearchManager.ReloadItem(row.Index); (srcCell.GridControl as IBoundGrid).ResetRowData(row); 车辆作业 entity = srcCell.ParentRow.Tag as 车辆作业; if (entity == null) { return; } if (srcCell.ParentColumn.FieldName == "作业号") { using (var form = new 单个作业监控详情(entity)) { form.ShowDialog(); } } else if (srcCell.ParentColumn.FieldName == "箱型编号") { using (var form = new 电子作业单(entity)) { form.ShowDialog(); } } else if (srcCell.ParentColumn.FieldName == "车辆位置") { if (m_mapForm == null) { m_mapForm = new Feng.Map.MapForm(); m_mapForm.FormClosing += new System.Windows.Forms.FormClosingEventHandler((sender2, e2) => { if (e2.CloseReason == System.Windows.Forms.CloseReason.UserClosing) { e2.Cancel = true; m_mapForm.Visible = false; } }); } m_mapForm.ClearMap(); if (!m_mapForm.Visible) { m_mapForm.WindowState = System.Windows.Forms.FormWindowState.Maximized; m_mapForm.Show(); } if (entity.Track.HasValue) { m_mapForm.LoadTrack(entity.Track.Value); } //if (entity.Track.HasValue) //{ // using (WebForm form = new WebForm("车辆轨迹", "http://17haha8.oicp.net/CarTrackService/TrackAnimation.aspx?TrackId=" + entity.Track.Value.ToString())) // { // form.ShowDialog(); // } //} } else if (srcCell.ParentColumn.FieldName == "车牌号") { using (var form = new 车辆详细信息(entity.车辆)) { form.ShowDialog(); } //using (var form = Feng.ServiceProvider.GetService<IWindowFactory>().CreateWindow(ADInfoBll.Instance.GetWindowInfo("实时监控_车辆作业_车辆详细信息")) as System.Windows.Forms.Form) //{ // form.ShowDialog(); //} } else if (srcCell.ParentColumn.FieldName == "承运时间要求") { using (var form = new 承运时间要求详情(entity)) { form.ShowDialog(); } } else if (srcCell.ParentColumn.FieldName == "开始") { if (entity.开始时间.HasValue) { return; } using (var form = new 电子作业单(entity)) { ret = form.ShowDialog(); } } else if (srcCell.ParentColumn.FieldName == "结束") { if (entity.结束时间.HasValue || !entity.开始时间.HasValue) { return; } //if (entity.最新作业状态 != null && entity.最新作业状态.处理状态 == "待处理") //{ // MessageForm.ShowWarning("请先处理异常情况!"); // return; //} if ((string)srcCell.ParentRow.Cells["作业状态"].Value != "已完成") { MessageForm.ShowWarning("还有未完成任务!"); return; } using (var form = new 实时监控结束(entity)) { ret = form.ShowDialog(); } } else if (srcCell.ParentColumn.FieldName == "退回") { if (entity.开始时间.HasValue) { return; } using (var form = new 实时监控作业退回申请(entity)) { form.ShowDialog(); } } else if (srcCell.ParentColumn.FieldName == "处理状态") { if (entity.最新作业状态 != null && entity.最新作业状态.处理状态 == "待处理") { if (entity.最新作业状态.异常情况 == "动态任务追加") { using (var form = new 实时监控异常处理动态任务追加(entity)) { ret = form.ShowDialog(); } } else { using (var form = new 实时监控异常处理(entity)) { ret = form.ShowDialog(); } } } } else if (srcCell.ParentColumn.FieldName == "异常报警") { using (var form = new 实时监控异常报警(entity)) { ret = form.ShowDialog(); } } if (ret == System.Windows.Forms.DialogResult.OK) { //(srcCell.GridControl as IBoundGrid).DisplayManager.SearchManager.ReloadItem(row.Index); (srcCell.GridControl as Feng.Grid.IBoundGrid).ResetRowData(row); } }