public async Task <IHttpActionResult> PutInkeyUserQuestion(int id, InkeyUserQuestion inkeyUserQuestion) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != inkeyUserQuestion.InkeyUserQuestionsId) { return(BadRequest()); } db.Entry(inkeyUserQuestion).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InkeyUserQuestionExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult EditProduct(InkeyProduct inkProduct) { try { using (var db = new BePreferencesEntities()) { db.Entry(inkProduct).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("ProductManager")); } catch (Exception) { throw; } }
private void ReInstateMemberToDatabase(BEMemberList member) { try { using (var db = new BePreferencesEntities()) { member.Archived = false; db.Entry(member).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } } catch (Exception) { throw; } }
public ActionResult EditQuestion(InkeyAnswer inkAnswer) { try { using (var db = new BePreferencesEntities()) { inkAnswer.ProductName = db.InkeyProducts.FirstOrDefault(p => p.InkeyProductsId == inkAnswer.ProductId).ProductName; db.Entry(inkAnswer).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("InkeyAnswerForm")); } catch (Exception) { throw; } }
private void RemoveMemberToDatabase(BEMemberList member, string newListId) { try { using (var db = new BePreferencesEntities()) { member.ListId = newListId; member.Archived = true; db.Entry(member).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } } catch (Exception) { throw; } }