Example #1
0
 //删除按钮事件
 private void btnDelete_Click(object sender, RoutedEventArgs e)
 {
     if (dgArchives.SelectedItems.Count > 0)
     {
         string Result   = "";
         string errorMsg = "";
         lendingDelID = new ObservableCollection <string>();
         ComfirmWindow com = new ComfirmWindow();
         com.OnSelectionBoxClosed += (obj, result) =>
         {
             for (int i = 0; i < dgArchives.SelectedItems.Count; i++)
             {
                 string LendArchivesID = "";
                 LendArchivesID = (dgArchives.SelectedItems[i] as T_OA_LENDARCHIVES).LENDARCHIVESID;
                 if ((dgArchives.SelectedItems[i] as T_OA_LENDARCHIVES).CHECKSTATE == "0" || (dgArchives.SelectedItems[i] as T_OA_LENDARCHIVES).CHECKSTATE == "3")
                 {
                     if (!(lendingDelID.IndexOf(LendArchivesID) > -1))
                     {
                         lendingDelID.Add(LendArchivesID);
                     }
                 }
             }
             if (lendingDelID.Count > 0)
             {
                 client.DeleteArchivesLendingAsync(lendingDelID);
             }
             else
             {
                 Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("SELECTITEMSNOTDELETE"));
             }
         };
         com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
     }
     else
     {
         ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
     }
 }