Exemplo n.º 1
0
        void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            WelfareProvisionID = new ObservableCollection <string>();
            if (DaGr.SelectedItems.Count > 0)
            {
                for (int i = 0; i < DaGr.SelectedItems.Count; i++)
                {
                    V_WelfarePaymentWithdrawal ent = DaGr.SelectedItems[i] as V_WelfarePaymentWithdrawal;
                    if (ent.beingWithdrawn.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
                    {
                        WelfareProvisionID.Add((DaGr.SelectedItems[i] as V_WelfarePaymentWithdrawal).beingWithdrawn.WELFAREDISTRIBUTEUNDOID);

                        string        Result = "";
                        ComfirmWindow com    = new ComfirmWindow();
                        com.OnSelectionBoxClosed += (obj, result) =>
                        {
                            BenefitsAdministration.DeletePaymentWithdrawalAsync(WelfareProvisionID);
                            LoadData();
                        };
                        com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
                    }
                    else
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYDIDNOSUBMITANDREVIEWTHEDATACANBEDELETEDBY"));
                        return;
                    }
                }
            }
            else
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }
        }