public async Task <bool> DecliceReceive(string receiveID) { var receiveModel = await _repoReceive.GetAll().Where(x => x.ID.Trim() == receiveID.Trim()).FirstOrDefaultAsync(); if (receiveModel != null) { _repoReceive.Remove(receiveModel); return(await _repoReceive.SaveAll()); } else { return(false); } }
public async Task <bool> DecliceReceive(string receiveID) { var receiveModel = _repoReceive.FindSingle(x => x.ID.Trim() == receiveID.Trim()); if (receiveModel != null) { _repoReceive.Remove(receiveModel); try { return(await _repoReceive.SaveAll()); } catch (Exception) { return(false); } } else { return(false); } }
public async Task <bool> DecliceReceive(string receiveID) { var receive = _repoReceive.FindSingle(x => x.ID.Trim() == receiveID.Trim()); var receiveDetail = await _repoReceiveDetail.FindAll(x => x.ReceiveID.Trim() == receiveID.Trim()).ToListAsync(); if (receive != null) { _repoReceive.Remove(receive); _repoReceiveDetail.RemoveMultiple(receiveDetail); try { return(await _repoReceive.SaveAll()); } catch (Exception) { return(false); } } else { return(false); } }