public IActionResult CheckDelete(IEnumerable <int> ids)
        {
            List <SerializedFileDto> dtoCheckedFileList = _context.SerializedFile.Where(x => ids.Contains(x.Id)).ToList();
            List <SerializedFile>    checkedFileList    = new List <SerializedFile>();

            foreach (SerializedFileDto serializedFileDto in dtoCheckedFileList)
            {
                SerializedFile serializedFile = SerializedFileDto.MapTo(serializedFileDto);
                checkedFileList.Add(serializedFile);
            }

            _fileDbService.FileDelete(checkedFileList);

            return(View());
        }
Esempio n. 2
0
        private void BtnDelete(object sender, EventArgs e)
        {
            var checkedItemsList = GetCheckedItemsList();

            bool isDeleted = _fileDbService.FileDelete(checkedItemsList);

            if (isDeleted)
            {
                MessageBox.Show(@"File Deleted");
            }
            else
            {
                MessageBox.Show(@"Please select a file");
            }

            DbGridDataLoading();
        }