Exemplo n.º 1
0
 // POST api/values
 public HttpResponseMessage Post(AgencyModel model)
 {
     if (HttpContext.Current.Request.Headers["Authorization"] == null)
     {
         throw new HttpResponseException(HttpStatusCode.Unauthorized);
     }
     string token = HttpContext.Current.Request.Headers["Authorization"];
     AGENCY objBdd = new AGENCY();
     objBdd.NAME = model.Name;
     objBdd.LATITUDE = model.Latitude;
     objBdd.LONGITUDE = model.Longitude;
     manager.add(objBdd);
     return new HttpResponseMessage()
     {
         Content = new JsonContent(new
         {
             Success = true, //error
             Message = "Success" //return exception
         })
     };
 }
Exemplo n.º 2
0
 // PUT api/values/5
 public string Put(int id, AgencyModel model)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 3
0
 // POST api/values
 public string Post(AgencyModel model)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 public UserModel(ConnextBusinessLayer.Bdd.USER objBdd)
 {
     Id = objBdd.ID_USER;
     FirstName = objBdd.FIRST_NAME;
     Lastname = objBdd.LAST_NAME;
     Email = objBdd.EMAIL;
     Password = objBdd.PASSWORD;
     var agency = objBdd.AGENCY;
     Agency = new AgencyModel(agency);
 }