public static void SqlDelete(int id) { var curr = LemHeader.GetLogHeader(id); if (curr.MatchId != -1) { string sql = $"update LemHeader set deleted=1 where id={id}"; MobileCommon.ExecuteNonQuery(sql); DeleteHistory.SqlInsert(DeleteHistory.LemHeader, curr.MatchId); var labourList = LabourTimeEntry.GetLabourEntryList(id); labourList.ForEach(x => LabourTimeEntry.DeleteEntry(x.Id)); var equipList = EquipTimeEntry.GetEquipEntryList(id); equipList.ForEach(x => EquipTimeEntry.DeleteEntry(x.Id)); var attachList = Attachment.GetAttachList(Attachment.LemHeaderId, id); attachList.ForEach(x => Attachment.DeleteAttach(DeleteHistory.LemHeaderAttach, x.RepositoryId)); } else { SqlForceDelete(id); } }
public static void DeleteEntry(int id) { var curr = EquipTimeEntry.GetEquipEntry(id); if (curr.MatchId != -1) { MobileCommon.ExecuteNonQuery($"update EquipTimeEntry set Deleted=1 where id={id}"); DeleteHistory.SqlInsert(DeleteHistory.EquipTimeEntry, curr.MatchId); } else { SqlForceDelete(id); } }