Exemplo n.º 1
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            ObservableCollection <T_OA_VEHICLEUSEAPP> selectItems = GetSelectList();

            if (selectItems == null)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }
            else
            {
                for (int i = 0; i < dg.SelectedItems.Count; i++)
                {
                    vehicleuseappInfo = selectItems[i];
                    if (vehicleuseappInfo.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
                    {
                        string        Result = "";
                        ComfirmWindow com    = new ComfirmWindow();
                        com.OnSelectionBoxClosed += (obj, result) =>
                        {
                            try
                            {
                                vehicleManager.DeleteVehicleUseAppListAsync(selectItems);
                            }
                            catch
                            {
                            }
                        };
                        com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
                    }
                    else
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYDIDNOSUBMITANDREVIEWTHEDATACANBEDELETEDBY"));
                        return;
                    }
                }
            }
        }