Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }