예제 #1
0
        /// <summary>
        /// 物理删除托盘信息
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task <OperationResult> DeleteMatPallets(params Guid[] ids)
        {
            ids.CheckNotNull("ids");
            MatPalletRepository.UnitOfWork.BeginTransaction();
            //
            OperationResult result = new OperationResult();

            //
            foreach (Guid idsCurrent in ids)
            {
                int matwarehouseareaInfoNew2 = MatWareHouseLocationRepository.TrackEntities
                                               .Count(m => m.PalletID != null && m.PalletID == idsCurrent);
                if (matwarehouseareaInfoNew2 == 0)
                {
                    result = await MatPalletRepository.DeleteAsync(ids);
                }
                else
                {
                    result.Message = "托盘已经被使用,不能删除!";
                }
            }
            //
            MatPalletRepository.UnitOfWork.Commit();
            return(result);
        }
예제 #2
0
        /// <summary>
        /// 物理删除托盘信息
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task <OperationResult> DeleteMatPallets(params Guid[] ids)
        {
            ids.CheckNotNull("ids");
            MatPalletRepository.UnitOfWork.BeginTransaction();
            var result = await MatPalletRepository.DeleteAsync(ids);

            MatPalletRepository.UnitOfWork.Commit();
            return(result);
        }