Beispiel #1
0
        public async Task <BaseResponse <bool> > Delete(Guid cityId)
        {
            City city = await _db.Cities.FirstOrDefaultAsync(x => x.CityGuid == cityId);

            _db.Remove(city);
            var result = await _db.SaveChangesAsync();

            if (result == 1)
            {
                return(new BaseResponse <bool>
                {
                    Code = RsponseCode.Success,
                    Message = "تم حذف المدينة بنجاح",
                    Data = true
                });
            }
            return(new BaseResponse <bool>
            {
                Code = RsponseCode.DataBaseError,
                Message = "حدث خطأ ",
                Data = false
            });
        }
Beispiel #2
0
        public async Task <BaseResponse <bool> > Delete(int areaId)
        {
            Area area = await _db.Areas.FirstOrDefaultAsync(x => x.Id == areaId);

            _db.Remove(area);
            var result = await _db.SaveChangesAsync();

            if (result == 1)
            {
                return(new BaseResponse <bool>
                {
                    Code = RsponseCode.Success,
                    Message = "تم حذف العميل بنجاح",
                    Data = true
                });
            }
            return(new BaseResponse <bool>
            {
                Code = RsponseCode.DataBaseError,
                Message = "حدث خطأ ",
                Data = false
            });
        }
        public async Task <BaseResponse <bool> > Delete(int OrderStatusId)
        {
            OrderStatus OrderStatus = await _db.OrderStatuses.FirstOrDefaultAsync(x => x.Id == OrderStatusId);

            _db.Remove(OrderStatus);
            var result = await _db.SaveChangesAsync();

            if (result == 1)
            {
                return(new BaseResponse <bool>
                {
                    Code = RsponseCode.Success,
                    Message = "تم حذف نوع الطلب بنجاح",
                    Data = true
                });
            }
            return(new BaseResponse <bool>
            {
                Code = RsponseCode.DataBaseError,
                Message = "حدث خطأ ",
                Data = false
            });
        }