コード例 #1
0
        public ActionResult Details(int id, Details de)
        {
            string role = null;

            ViewData["Role"] = "";
            IEnumerable <string> roles = new List <string>();

            roles = ((ClaimsIdentity)User.Identity).Claims
                    .Where(ca => ca.Type == ClaimTypes.Role)
                    .Select(ca => ca.Value);
            foreach (var x in roles)
            {
                role = x;
            }

            if (role != null)
            {
                ViewData["Role"] = role;
            }
            Details d = new Models.Details();

            commentaire c = new commentaire();

            c         = de.Commentaire;
            c.idUser  = User.Identity.GetUserId();
            c.idForum = id;
            comnService.Add(c);
            comnService.Commit();

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        // GET: Detail
        public ActionResult Detail(string id)
        {
            var model = new Models.Details()
            {
                data = CatalogBLL.ListOfOrderDetails(Convert.ToInt32(id))
            };

            return(View(model));
        }
コード例 #3
0
        public ActionResult Input(string id = "")
        {
            ViewBag.Title = "Add products";
            var model = new Models.Details()
            {
                data    = CatalogBLL.ListOfOrderDetails(Convert.ToInt32(id)),
                orderID = Convert.ToInt32(id)
            };

            return(View(model));
        }