Ejemplo n.º 1
0
        public ActionResult DicCreateChildNode(DicCreateChildNode model)
        {
            if (!ModelState.IsValid) { return View(model); }

            string sql = "exec SP_DicCreate @DicID,@DicCode,@DicName,@DicNameEn,@DicProperty,@ParentID,@SortID,@Remark,@isLeaf";
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@DicID", model.ParentID),
                new SqlParameter("@DicCode", model.DicCode),
                new SqlParameter("@DicName", model.DicName),
                new SqlParameter("@DicNameEn", model.DicNameEn),
                new SqlParameter("@DicProperty", model.DicProperty),
                new SqlParameter("@ParentID", model.ParentID),
                new SqlParameter("@SortID", model.SortID),
                new SqlParameter("@Remark", model.Remark),
                new SqlParameter("@isLeaf", true),
            };

            var result = bDic.Add(sql, param);
            if (result.DicID > 0) return RedirectToAction("DicList");
            else return View(model);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加子节点
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult DicCreateChildNode()
        {
            var model = new DicCreateChildNode();
            model.SortID = 0;

            @ViewBag.DicProperty = DicUtil.Instance.DicProperties(0);

            return View();
        }