public async Task <bool> RemoveWhereAsync(int changeId, int rowId)
        {
            var rowChange = await RepoDbSet
                            .FirstOrDefaultAsync(change => change.ChangeId == changeId && change.ReceiptRowId == rowId);

            if (rowChange == null)
            {
                return(false);
            }
            RepoDbSet.Remove(rowChange);
            return(true);
        }
        /// <summary>
        /// Removes row if 1)Row is found, 2)UserId matches ManagerId, 3)Receipt is not finalized
        /// </summary>
        /// <param name="rowId"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task <bool> RemoveRowAsync(int rowId, int userId)
        {
            var receiptRow = await RepoDbSet
                             .Include(row => row.Receipt)
                             .FirstOrDefaultAsync(row => row.Id == rowId);

            if (receiptRow == null)
            {
                return(false);
            }
            if (receiptRow.Receipt.ReceiptManagerId != userId || receiptRow.Receipt.IsFinalized)
            {
                return(false);
            }
            RepoDbSet.Remove(receiptRow);
            return(true);
        }
예제 #3
0
 public void RemoveNoReturnAsync(TestTypeMinimal dalTestTypeMinimal)
 {
     RepoDbSet.Remove(_mapper.MapToDomain(dalTestTypeMinimal));
 }
예제 #4
0
 public void RemoveNoReturnAsync(ComponentMinimal dalComponentMinimal)
 {
     RepoDbSet.Remove(_mapper.MapToDomain(dalComponentMinimal));
 }
예제 #5
0
 public void RemoveNoReturnAsync(UnitOfMeasureMinimal dalUnitOfMeasureMinimal)
 {
     RepoDbSet.Remove(_mapper.MapToDomain(dalUnitOfMeasureMinimal));
 }
 public void RemoveNoReturnAsync(SpecificationMinimal dalSpecificationMinimal)
 {
     RepoDbSet.Remove(_mapper.MapToDomain(dalSpecificationMinimal));
 }
예제 #7
0
 public void RemoveNoReturnAsync(ManufacturerMinimal dalManufacturerMinimal)
 {
     RepoDbSet.Remove(_mapper.MapToDomain(dalManufacturerMinimal));
 }