예제 #1
0
 public SalesController()
 {
     categoriesB        = new CategoriesB();
     subCategoriesB     = new SubCategoriesB();
     accountB           = new AccountsB();
     userB              = new UsersB();
     saleB              = new SalesB();
     assetsLiabilitiesB = new AssetsLiabilitiesB();
     clientsB           = new ClientsB();
     productsB          = new ProductsB();
     detailsB           = new DetailsB();
     invoicesB          = new InvoicesB();
     providersB         = new ProvidersB();
 }
예제 #2
0
        public IHttpActionResult GetName(String name)
        {
            IList <All_Clients> clients = null;

            ClientsB clientB = new ClientsB();

            clients = clientB.GetByName(name);

            if (clients == null)
            {
                return(Ok(false));
            }

            return(Ok(clients));
        }
예제 #3
0
        // GET: api/Client/5
        public IHttpActionResult Get(int id)
        {
            All_Clients clients = null;

            ClientsB clientB = new ClientsB();

            clients = clientB.GetById(id);

            if (clients == null)
            {
                return(Ok(false));
            }

            return(Ok(clients));
        }
예제 #4
0
        // GET: api/Client
        public IHttpActionResult Get()
        {
            IList <All_Clients> clients = null;

            ClientsB clientB = new ClientsB();

            clients = clientB.GetAll();

            if (clients == null)
            {
                return(Ok(false));
            }

            return(Ok(clients));
        }
예제 #5
0
        public IHttpActionResult Post(Persons persons)
        {
            int clients;

            ClientsB clientB = new ClientsB();

            clients = clientB.Create(persons);

            switch (clients)
            {
            case 200:
                return(Ok(200));

            case 400:
                return(Ok(400));

            case 500:
                return(Ok(500));

            default:
                return(Ok(false));
            }
        }
예제 #6
0
 public ClientsController()
 {
     clientsB   = new ClientsB();
     providersB = new ProvidersB();
     personsB   = new PersonsB();
 }