public MaintainPlanViewModel() { Task.Run(() => { MaintainPlanList = GetMaintainPlanData(); MaintainPlanList.Insert(0, new MaintainPlanModel() { EquipmentName = @"", MaintainInfo = @" 返 回", PlanedContent = @" ******************* ", PlanDate = @"" }); }); SelectCommand = new DelegateCommand(obj => Select(obj)); }
public void Select(object obj) { if (MaintainPlanIndex.Equals(-1)) { return; } if (MaintainPlanIndex.Equals(0)) { WindowHelper.ShowPageProducePlan(); } else { MaintainPlanList.RemoveAt(MaintainPlanIndex); /*StoreInfoModel.EquipmentInfo = StoreInfoModel.EquipmentInfos[MaintainPlanIndex - 1]; * * //是否正在保养,是将结束 * if (StoreInfoModel.EquipmentInfo.GetEquipmentMaintenancePlan.ActualStartTime != null) * { * ResultModel result = new BLL.ExtraBLL.EquipmentInfoBLL().EQPMaintenancePlan(1); * //结束保养成功 * if (result.Result) * { * StoreInfoModel.EquipmentInfos.RemoveAt(MaintainPlanIndex - 1); * } * else * { * MessageBox.Show(result.Msg, "提示", MessageBoxButton.OK, MessageBoxImage.Warning); * } * } * //是否正在保养,否将开始 * else * { * ResultModel result = new BLL.ExtraBLL.EquipmentInfoBLL().EQPMaintenancePlan(0); * //开始保养成功 * if (result.Result) * { * * } * else * { * MessageBox.Show(result.Msg, "提示", MessageBoxButton.OK, MessageBoxImage.Warning); * } * }*/ } }