Ejemplo n.º 1
0
        public ActionResult CategoryView(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                TempData["Error"] = "Data has already been deleted by other user!";
                return(RedirectToAction("CategorySearch"));
            }

            CategoryModel Model      = new CategoryModel();
            int           returnCode = _categoryBL.GetByID(long.Parse(id), out Model);

            if (Model == null)
            {
                TempData["Error"] = "Data has already been deleted by other user!";
                return(RedirectToAction("CategorySearch"));
            }
            if (!((int)Common.ReturnCode.Succeed == returnCode))
            {
                Model = new CategoryModel();
            }
            ViewBag.Parent = new SelectList(_categoryBL.GetListParent(true), "id", "name");
            return(View(Model));
        }