Example #1
0
        public virtual HttpResponseMessage Delete(int id)
        {
            var cusDLL = new CusDLL();

            if (id != 0)
            {
                cusDLL.Delete(id);
            }
            HttpResponseMessage response = Request.CreateResponse <int>(System.Net.HttpStatusCode.Created, id);

            return(response);
        }
Example #2
0
        public HttpResponseMessage Post(Customer customer)
        {
            var cusDLL = new CusDLL();

            if (customer.ID == 0)
            {
                cusDLL.Insert(customer);
            }
            else
            {
                cusDLL.Update(customer, customer.ID);
            }
            HttpResponseMessage response = Request.CreateResponse <Customer>(System.Net.HttpStatusCode.Created, customer);

            return(response);
        }
Example #3
0
        public Customer[] Get()
        {
            var cusDLL = new CusDLL();

            return(cusDLL.GetAll());
        }