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); }
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); } }
public DataSet GetCustomer(string customerid) { try { CustomerDA cda = new CustomerDA(); return cda.GetCustomer(customerid); } catch (Exception ex) { } return null; }
public Customer GetCustomers() { CustomerDA customerDA = new CustomerDA(); return(customerDA.GetCustomer()); }
public Customer Get(string nummer) { ClaimsPrincipal p = RequestContext.Principal as ClaimsPrincipal; return(CustomerDA.GetCustomer(nummer, p.Claims)); }