Exemplo n.º 1
0
        public HttpResponseMessage Get(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return new HttpResponseMessage()
                       {
                           StatusCode = HttpStatusCode.BadRequest
                       }
            }
            ;
            ClaimsPrincipal p    = RequestContext.Principal as ClaimsPrincipal;
            Customer        cust = CustomerDA.GetCustomer(Convert.ToInt32(id), p.Claims);

            if (cust == null)
            {
                return new HttpResponseMessage()
                       {
                           StatusCode = HttpStatusCode.NotFound
                       }
            }
            ;

            HttpResponseMessage response = new HttpResponseMessage();
            HttpContent         content  = new ObjectContent(typeof(Customer), cust, new JsonMediaTypeFormatter());

            response.Content    = content;
            response.StatusCode = HttpStatusCode.OK;
            return(response);
        }
Exemplo n.º 2
0
        private void TBCustomerIDSearch_TextChanged(object sender, EventArgs e)
        {
            string txt = TBCustomerIDSearch.Text.Trim();

            if ((!String.IsNullOrEmpty(txt)) && (txt.Length >= 3))
            {
                List <CustomerModel> lm = CustomerDA.GetCustomer(Config.VBR4000Connection, txt);
                BindList(lm);
            }
        }
Exemplo n.º 3
0
        public DataSet GetCustomer(string customerid)
        {
            try
            {
                CustomerDA cda = new CustomerDA();
                return cda.GetCustomer(customerid);

            }
            catch (Exception ex)
            {

            }

            return null;
        }
Exemplo n.º 4
0
        public Customer GetCustomers()
        {
            CustomerDA customerDA = new CustomerDA();

            return(customerDA.GetCustomer());
        }
Exemplo n.º 5
0
        public Customer Get(string nummer)
        {
            ClaimsPrincipal p = RequestContext.Principal as ClaimsPrincipal;

            return(CustomerDA.GetCustomer(nummer, p.Claims));
        }