private void Delete_Click(object sender, RoutedEventArgs e)
        {
            dg.ItemsSource = null;
            ObservableCollection <string> o = new ObservableCollection <string>();
            T_OA_VEHICLEUSEAPP            i = ((Button)sender).DataContext as T_OA_VEHICLEUSEAPP;

            o.Add(i.VEHICLEUSEAPPID);

            if (_lstVUseApp_Add.Contains(i))
            {
                _lstVUseApp_Add.Remove(i);
                _lstVUseApp.Remove(i);
            }
            else if (_lstVUseApp.Contains(i))
            {
                ComfirmWindow com = new ComfirmWindow();
                if (_lstVUseApp.Count > 1) //不能为空
                {
                    string Result = "";

                    com.OnSelectionBoxClosed += (obj, result) =>
                    {
                        _VM.Del_VDDetailsAsync(o);
                        _lstVUseApp.Remove(i);
                    };
                    com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
                }
                else
                {
                    ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("ERROR_VDUSEAPP"), Utility.GetResourceStr("CONFIRMBUTTON"));
                }
            }
            dg.ItemsSource = _lstVUseApp;
        }
Example #2
0
        //删除子表
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            if (_lstVRecord.Count > 1) //必须有派车单,司机才能根据派车单提交费用 单
            {
                T_OA_VEHICLEDISPATCHRECORD i = ((Button)sender).DataContext as T_OA_VEHICLEDISPATCHRECORD;
                _lstVRecord.Remove(i);
                dg.ItemsSource = null;
                dg.ItemsSource = _lstVRecord;

                if (i.VEHICLEDISPATCHRECORDID != null) //删除已经保存到服务器中的数据
                {
                    ObservableCollection <string> o = new ObservableCollection <string>();
                    o.Add(i.VEHICLEDISPATCHRECORDID);
                    _VM.Del_VDDetailsAsync(o);
                    RefreshUI(RefreshedTypes.HideProgressBar);
                }
            }
        }
        //删除子表
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            dg.ItemsSource = null;
            ObservableCollection <string> o = new ObservableCollection <string>();
            T_OA_VEHICLEUSEAPP            i = ((Button)sender).DataContext as T_OA_VEHICLEUSEAPP;

            o.Add(i.VEHICLEUSEAPPID);

            if (_lstVUseApp_Add.Contains(i))
            {
                _lstVUseApp_Add.Remove(i);
            }
            else
            {
                _VM.Del_VDDetailsAsync(o);
            }
            dg.ItemsSource = _lstVUseApp_Add;
        }