Esempio n. 1
0
 public ActionResult RejectedNotes(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)
         {
             RejectedNotesViewModel Model = new RejectedNotesViewModel();
             Model.SellerName = db.SellNotes.Where(x => x.IsActive == true).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"));
     }
 }
Esempio n. 2
0
        public ActionResult GetFilterSellerRejectedNotes(string SellerId = null)
        {
            if (string.IsNullOrEmpty(SellerId))
            {
                SellerId = null;
            }
            RejectedNotesViewModel             Model   = new RejectedNotesViewModel();
            List <GetRejectedNotesData_Result> getData = db.GetRejectedNotesData(SellerId).ToList();

            Model.getRejectedNotesData_Results = getData;
            return(PartialView("_RejectedNotes", Model));
        }