コード例 #1
0
        public string Clear()
        {
            Guid idOwner    = new Guid("156c2cde-2c19-46c3-bcba-a27f9d1e4998");
            Guid idCustomer = new Guid("54612b5e-611f-4b71-9dbd-ed35b6f2976b");

            Business.Infrastructure.FilterInfo filters = new Business.Infrastructure.FilterInfo
            {
                Filters = new List <Business.Infrastructure.FilterInfo>
                {
                    new Business.Infrastructure.FilterInfo {
                        Field = "id_owner", Operator = "eq", Value = idOwner.ToString()
                    },
                    new Business.Infrastructure.FilterInfo {
                        Field = "id_customer", Operator = "eq", Value = idCustomer.ToString()
                    },
                    new Business.Infrastructure.FilterInfo {
                        Field = "created_by", Operator = "eq", Value = "dummy"
                    }
                },
                Logic = "and"
            };

            List <rent> rents = RepoRent.FindAll(null, null, null, filters);
            int         count = rents.Count();

            foreach (rent row in rents)
            {
                RepoRent.Delete(row);
            }

            return(count.ToString() + " dihapus");
        }
コード例 #2
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                var response = await _repository.Delete(id);

                if (response != 0)
                {
                    return(Ok("Deleted successfully"));
                }
                else
                {
                    return(BadRequest("An error ocurred, contact IT Staff"));
                }
            }
            catch (Exception e)
            {
                //Log error
                Log.Error(e.Message);
                Log.Error(e.StackTrace);
                return(BadRequest("An error ocurred, contact IT Staff"));
            }
        }
コード例 #3
0
 public void DeleteRent(int id) => _rentRepository.Delete(id);
コード例 #4
0
ファイル: RentService.cs プロジェクト: cadupaesleme/alugase
 public void Delete(Guid id)
 {
     _RentRepository.Delete(id);
 }
コード例 #5
0
 public IActionResult Delete([FromBody] Rent rent)
 {
     _repository.Delete(rent);
     return(new JsonResult(new { delete = true }));
 }
コード例 #6
0
 public void Delete(Rent rent)
 {
     _rentRepository.Delete(rent);
 }
コード例 #7
0
 public void Delete(Rent entity)
 {
     _rentRepository.Delete(entity);
 }
コード例 #8
0
 public Task Delete(int id)
 {
     return(rentRepository.Delete(id));
 }