//private async void DeleteFromNew(int datasendID) //{ // Address address = new Address(); // PutRest putrest = new PutRest(); // string endpoint3; // endpoint3 = address.Endpoint + "DataSenders/" + datasendID; // var uri = new Uri(endpoint3); // NewMessages newmessages = new NewMessages(); // newmessages.DataSenderID = datasendID; // newmessages.Seen = true; // string output = JsonConvert.SerializeObject(newmessages); // var StrRespPost = await PutRest.Put(output, uri); //} private string PersonalData(int?PersonID) { ConsumeRest cRest = new ConsumeRest(); Address address = new Address(); string endpoint = address.Endpoint + "Demographics/" + PersonID; object strResponse = cRest.makeRequest(endpoint); demographics demogra = JsonConvert.DeserializeObject <demographics>(strResponse.ToString()); string info = "FirstName : " + demogra.FirstName + "\n" + "LastName : " + demogra.LastName + "\n" + "Gender : " + demogra.Sex + "\n" + "Living place : " + demogra.Country + " " + demogra.City + "\n" + "Dieuthinsh : " + demogra.StreetName + " " + demogra.StreetNumber + "\n" + "Birthday : " + demogra.Birthday; return(info); }
public IActionResult addDemograph([FromBody] demographics demographics) { try { _db.Demographics.Add(demographics); _db.SaveChanges(); return(Ok("Se Guardo Correctamente la Demografía")); } catch (Exception e) { return(BadRequest("Error.....Intente más Tarde" + e)); } }
public IActionResult AddDemograph([FromBody] demographics demographics) { try { _db.demographics.Add(demographics); _db.SaveChanges(); return(Ok("Se Guardo Correctamente la Demografía")); } catch (Exception e) { _logger.LogError(e, "Demografico no agregado, demographics:{demographics}", demographics); return(BadRequest("Error.....Intente más Tarde" + e)); } }
public DemographicModel(demographics dbElement) { sourcedId = dbElement.sourcedId; status = dbElement.status; dateLastModified = dbElement.dateLastModified; birthDate = dbElement.birthDate.Value.ToString("yyyy-MM-dd"); sex = dbElement.sex; americanIndianOrAlaskaNative = dbElement.americanIndianOrAlaskaNative; asian = dbElement.asian; blackOrAfricanAmerican = dbElement.blackOrAfricanAmerican; nativeHawaiianOrOtherPacificIslander = dbElement.nativeHawaiianOrOtherPacificIslander; white = dbElement.white; demographicRaceTwoOrMoreRaces = dbElement.demographicRaceTwoOrMoreRaces; hispanicOrLatinoEthnicity = dbElement.hispanicOrLatinoEthnicity; }