public async Task <Document> saveregistrationinfo(string id, [FromBody] UserInfo u) { UserInfo currentUser = getLoggedInUserInfo(); if (currentUser != null) { currentUser = (UserInfo)(dynamic)await _repository.GetFirstDocAsync("usergoogid='" + currentUser.usergoogid + "'"); currentUser.regStatus = REG_EMAIL_SENT; currentUser.cell1 = u.cell1; currentUser.email2 = u.email2; currentUser.address1 = u.address1; currentUser.address2 = u.address2; currentUser.city = u.city; currentUser.state = u.state; currentUser.zip = u.zip; currentUser.mothersmaidenname = u.mothersmaidenname; currentUser.pet = u.pet; currentUser.phone = u.phone; string token = Guid.NewGuid().ToString(); currentUser.token = token; currentUser = (UserInfo)(dynamic)await _repository.UpdateAsync(currentUser.id, currentUser); string hostName = (HttpContext.Request.IsHttps) ? "https://" : "http://"; hostName += HttpContext.Request.Host.Value; await Utility.Utility.SendConfirmationEmail(hostName, currentUser, token); } return((Document)(dynamic)currentUser); }
public async Task <Document> Put(string id, [FromBody] Contact inObj) { //ContactsRepository contactsRepository = new ContactsRepository(); //Contact obj = contactsRepository.Get("1"); var document = await _repository.UpdateAsync(id, inObj); return(document); }
public async Task <Document> Put(string id) { var product = new Product { Id = id, Model = "IPhone", Description = "9" }; var document = await _repository.UpdateAsync(id, product); return(document); }
public async Task <Document> Put(string id, [FromBody] Contact inObj) { UserInfo u = getLoggedInUserInfo(); if (u != null) { inObj.usergoogid = u.usergoogid; var document = await _repository.UpdateAsync(u.usergoogid, id, inObj); return(document); } return(null); }
public async Task <Document> Put(string id) { UserInfo u = getLoggedInUserInfo(); if (u != null) { var product = new Product { Id = id, Model = "IPhone", Description = "9" }; var document = await _repository.UpdateAsync(u.usergoogid, id, product); return(document); } return(null); }