// GET: NotesUnderReview public ActionResult NotesUnderReview(int?sellerid) { if (Session["ID"] != null) { int id = Convert.ToInt32(Session["ID"]); int RoleMember = Convert.ToInt32(Enums.UserRoleId.Member); User user = db.Users.Where(x => x.ID == id).FirstOrDefault(); if (user.RoleID != RoleMember) { NotesUnderReviewViewModel Model = new NotesUnderReviewViewModel(); Model.SellerName = db.SellNotes.Select(x => new SelectListItem() { Value = x.SellerID.ToString(), Text = x.User.FirstName + " " + x.User.LastName }).Distinct().ToList(); if (sellerid != null) { Model.Seller = (int)sellerid; } return(View(Model)); } else { return(RedirectToAction("Index", "Home")); } } else { return(RedirectToAction("Login", "Account")); } }
public ActionResult GetFilterSellerNUR(string SellerId = null) { if (string.IsNullOrEmpty(SellerId)) { SellerId = null; } NotesUnderReviewViewModel Model = new NotesUnderReviewViewModel(); List <NewGetNotesUnderReviewData_Result> getdata = db.NewGetNotesUnderReviewData(SellerId).ToList(); Model.getNotesUnderReviewData_Results = getdata; return(PartialView("_NotesUnderReview", Model)); }
public ActionResult NotesUnderReview(string name, string search) { if (name == "" || name == null) { name = "0"; } if (search == "") { search = null; } int sellerid = Convert.ToInt32(name); NotesUnderReviewViewModel model = new NotesUnderReviewViewModel { UnderReviewNotes = _context.GetUnderReviewNotes(name, search), Sellers = _context.GetAllSellers(), Seller = sellerid, Search = search }; return(View(model)); }