コード例 #1
0
        // GET: Ratings/Delete
        public ActionResult Delete(int id)
        {
            var rp = new RatingProcess();

            rp.Delete(id);
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        // POST: Ratings/Edit
        public ActionResult Edit(Rating rating)
        {
            var rp = new RatingProcess();

            rp.Edit(rating);
            return(RedirectToAction("Index"));
        }
コード例 #3
0
        // POST: Ratings/Create
        public ActionResult Create(Rating rating)
        {
            var rp = new RatingProcess();

            rp.Insert(rating);
            return(RedirectToAction("Index"));
        }
コード例 #4
0
        // GET: Ratings/Rating
        public ActionResult Index()
        {
            var rp    = new RatingProcess();
            var lista = rp.SelectList();

            return(View(lista));
        }
コード例 #5
0
        // GET: Ratings/Edit
        public ActionResult Edit(int id)
        {
            var rp   = new RatingProcess();
            var rtng = rp.Find(id);

            return(View(rtng));
        }
コード例 #6
0
        // GET: Ratings/Edit
        public ActionResult Edit(int id)
        {
            var rp   = new RatingProcess();
            var rtng = rp.Find(id);

            var cp          = new ClientProcess();
            var listaClient = cp.SelectList();

            ViewData["Client"] = listaClient;

            var pp        = new ProductProcess();
            var listaProd = pp.SelectList();

            ViewData["Product"] = listaProd;

            return(View(rtng));
        }
コード例 #7
0
        // GET: Ratings/Details
        public ActionResult Details(int id)
        {
            var rp   = new RatingProcess();
            var rtng = rp.Find(id);

            var cp         = new ClientProcess();
            var descClient = cp.Find(rtng.ClientId);

            ViewData["Client"] = descClient.FirstName + " " + descClient.LastName;

            var pp       = new ProductProcess();
            var descProd = pp.Find(rtng.ProductId);

            ViewData["Product"] = descProd.Description;

            return(View(rtng));
        }