public ActionResult Edit(int?id) { if (id == null) { return(HttpNotFound()); } var Feedback = FeedbackRepo.Find(id); vmFeedbackProperty objFeedbackProperty = new vmFeedbackProperty(); var Inductee = InducteeRepo.Find(Feedback.InducteeID); objFeedbackProperty.TrainerName = Inductee.Batch.trainer.Name; objFeedbackProperty.BatchName = Inductee.Batch.Name; objFeedbackProperty.InducteeID = Inductee.Id; objFeedbackProperty.InducteeName = Inductee.Name; var feedbacks = FeedbackRepo.GetFeedbacksForTrainee(Inductee.Id); var datesWithFeedback = feedbacks.Select(p => p.FeedbackDate).ToList(); var allDates = Inductee.Batch.BatchDates.Select((p, i) => new { date = p.BatchDate, Text = "Day " + (i + 1) + " - " + p.BatchDate.ToString("dd MMM yyyy - ddd") }).ToList(); objFeedbackProperty.BatchDates = allDates.Where(p => p.date == Feedback.FeedbackDate || !datesWithFeedback.Contains(p.date)).Select((p, i) => new SelectListItem { Value = p.date.ToString("MM/dd/yyyy"), Text = p.Text }).ToList(); objFeedbackProperty.BatchID = Inductee.BatchID; objFeedbackProperty.TrainerID = Inductee.Batch.TrainerId; objFeedbackProperty.FeedBackID = Feedback.ID; objFeedbackProperty.Date = Feedback.FeedbackDate.ToString("MM/dd/yyyy"); objFeedbackProperty.Property = Feedback.Property; return(View(objFeedbackProperty)); }
public IHttpActionResult HrTicket(string id) { var quer1 = from n in feedInterface.getCOmments(id) select n; var quer = quer1.OrderByDescending(x => x.Id).ToList(); var f = feedInterface.Find(id); if (f != null) { return(Ok(new { f.id, f.checkStatus, f.title, f.attachment, f.description, f.user.EmployeeId, f.user.Email, f.user.FirstName, f.type.name, quer })); } else { return(BadRequest("hr Ticket not found")); } }
public ActionResult view(string id) { var user = UserManager.FindById(User.Identity.GetUserId()); ViewData["user"] = user; if (id == null) { ViewBag.ErrorMsg = "FeedBack not found"; return(RedirectToAction("list")); } else { Feedback f = feedInterface.Find(id); return(View("view", f)); } }
public ActionResult view(string name, string id) { ViewBag.viewlink = name; var user = UserManager.FindById(User.Identity.GetUserId()); ViewData["user"] = user; if (id == null) { ViewBag.ErrorMsg = "This Ticket is not found,Try with proper data"; return(RedirectToAction("list")); } else { getAttributeList(); Feedback f = feedInterface.Find(id); return(View(f)); } }