-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomersManager.cs
50 lines (43 loc) · 1.41 KB
/
CustomersManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using Business.Abstract;
using Business.Constants;
using Core.Utilities.Results;
using DataAccess.Abstract;
using Entities.Concrete;
using Entities.DTOs;
using System;
using System.Collections.Generic;
using System.Text;
namespace Business.Concrete
{
public class CustomersManager : ICustomersService
{
ICustomersDal _customersDal;
public CustomersManager(ICustomersDal customersDal)
{
_customersDal = customersDal;
}
public IResult AddCustomer(Customers customer)
{
_customersDal.Add(customer);
return new SuccessResult(Messages.SuccessMessage);
}
public IResult DeleteCustomer(Customers customer)
{
_customersDal.Delete(customer);
return new SuccessResult(Messages.SuccessMessage);
}
public IDataResult<List<Customers>> GetAll()
{
return new SuccessDataResult<List<Customers>>(_customersDal.GetAll(), Messages.SuccessMessage);
}
public IDataResult<List<CustomerDetailDto>> GetCustomersDetails()
{
return new SuccessDataResult<List<CustomerDetailDto>>(_customersDal.GetCustomerDetailDtos(),Messages.SuccessMessage);
}
public IResult UpdateCustomer(Customers customer)
{
_customersDal.Update(customer);
return new SuccessResult(Messages.SuccessMessage);
}
}
}