/// <summary> /// 删除checkitem /// </summary> /// <param name="Id"></param> /// <returns></returns> public int DeleteCheckItem(string Id) { var checkItem = _checkItemRepository.GetById(Id); if (checkItem == null) { return(0); } int num = _checkItemRepository.Delete(checkItem); if (num > 0) { //记录日志 var logService = new LogService(); var log = new CILog(); log.Contents = "删除提交物,开发人员:" + checkItem.Developer; log.UserName = (new UserService()).GetUserFromCookie().UserName; log.LogTime = DateTime.Now; log.DemandCode = checkItem.DemandCode; log.CodeFile = checkItem.CodeList; logService.InsertLog(log); } return(num); }
private void deleteCheckItem() { setCheckItemsButtonStates(false); var selected = checklistLv.SelectedIndices; if (selected.Count == 1) { var result = new CustomMessageBox("Varování", "Opravdu chcete úkol smazat?").ShowDialog(); if (result == DialogResult.Yes) { var selectedIndex = selected[0]; var id = _checkItems[selectedIndex].ID; _checkItemRepo.Delete(id); reloadCheckItems(); } } setCheckItemsButtonStates(); }