Esempio n. 1
0
        private void cardatagrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (sender != null)
            {
                if (e.ChangedButton == MouseButton.Left)
                {
                    int equcount = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA_PlanDatabase, int>(channel =>
                    {
                        return(channel.GetMonitorEquCount(VehicleSelected.GUID));
                    });

                    VehicleEditDialog dialog = new VehicleEditDialog(VehicleSelected, true);
                    dialog.Title = "修改车辆信息";

                    if (equcount > 0)
                    {
                        MessageBox.Show("车辆在监测实施中,已经存在设备。不可以修改'车牌号码'和是否是'监测车'属性");
                        dialog.ModifyMonitorProperty = false;
                    }
                    else
                    {
                        dialog.ModifyMonitorProperty = true;
                    }
                    dialog.AfterSaveEvent += () =>
                    {
                        GetVehicleInfos();
                    };
                    dialog.ShowDialog(this);
                }
            }
        }
Esempio n. 2
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            VehicleInfo vechicleinfo = new VehicleInfo();

            VehicleEditDialog dialog = new VehicleEditDialog(vechicleinfo, false);

            dialog.ModifyMonitorProperty = true;
            dialog.Title           = "添加车辆信息";
            dialog.AfterSaveEvent += () =>
            {
                GetVehicleInfos();
            };
            dialog.ShowDialog(this);
        }