Ejemplo n.º 1
0
        void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            ApplicationsID = new ObservableCollection <string>();
            if (DaGr.SelectedItems.Count > 0)
            {
                for (int i = 0; i < DaGr.SelectedItems.Count; i++)
                {
                    V_ContractApplications ent = DaGr.SelectedItems[i] as V_ContractApplications;
                    if (ent.contractApp.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
                    {
                        ApplicationsID.Add((DaGr.SelectedItems[i] as V_ContractApplications).contractApp.CONTRACTAPPID);

                        string        Result = "";
                        ComfirmWindow com    = new ComfirmWindow();
                        com.OnSelectionBoxClosed += (obj, result) =>
                        {
                            caswsc.DeleteContraApprovalAsync(ApplicationsID);
                            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"));
            }
        }