コード例 #1
0
        //GET: Categories/Category/Edit
        public ActionResult Edit(int id)
        {
            var cp        = new ASF.UI.Process.CategoryProcess();
            var categoria = cp.Find(id);

            return(View(categoria));
        }
コード例 #2
0
        // GET: Categories/Category
        public ActionResult Index()
        {
            var cp    = new ASF.UI.Process.CategoryProcess();
            var lista = cp.SelectList();

            return(View(lista));
        }
コード例 #3
0
 public ActionResult Delete(ASF.Entities.Category model)
 {
     if (ModelState.IsValid)
     {
         var cp = new ASF.UI.Process.CategoryProcess();
         cp.Delete(model.Id);
     }
     return(RedirectToAction("Index"));
 }
コード例 #4
0
 public ActionResult Create(ASF.Entities.Category model)
 {
     if (ModelState.IsValid)
     {
         var cp = new ASF.UI.Process.CategoryProcess();
         model.CreatedOn = DateTime.Now;
         model.ChangedOn = DateTime.Now;
         cp.Create(model);
     }
     return(RedirectToAction("Index"));
 }