public void NegativeVote(t_tip tip, int idPatientVoted) { int valNegInit = tip.disliked; tip.disliked = valNegInit + 1; utwk.TipRepository.Update(tip); utwk.Commit(); }
public void PositiveVote(t_tip tipFound, int idPatientVoted) { // t_tip tipFound =utwk.TipRepository.GetById(idTip); // if(tipFound.idPatientVoted) int valPosInit = tipFound.liked; tipFound.liked = valPosInit + 1; utwk.TipRepository.Update(tipFound); utwk.Commit(); }
public ActionResult Create(t_tip tip) { //tip.idPatientVoted = 0; tip.administrator_userId = adminId; tip.liked = 0; tip.disliked = 0; if (ModelState.IsValid) { tipService.AddTip(tip); return RedirectToAction("Index"); } return View(); }
public ActionResult Appreciate(t_tip tip) { return RedirectToAction("Index"); }
public ActionResult Edit(t_tip tip) { if (ModelState.IsValid) { tipService.UpdateTip(tip); return RedirectToAction("Index"); } else { return View(); } }
public ActionResult Dislike(t_tip tip) { return RedirectToAction("Index"); }
public void UpdateTip(t_tip tip) { utwk.TipRepository.Update(tip); utwk.Commit(); }
public void DeleteTip(t_tip tip) { utwk.TipRepository.Delete(tip); utwk.Commit(); }
public void AddTip(t_tip tip) { utwk.TipRepository.Add(tip); utwk.Commit(); }