Beispiel #1
0
        /// <summary>
        /// 获取当前职位可用的父职位 返回Json
        /// </summary>
        /// <param name="id">当前职位的ID</param>
        /// <returns></returns>
        public JsonResult DropDownParent(string id)
        {
            List <Position> positsList;

            if (id == null || id == "" || id == "null")
            {
                positsList = db.GetAllPosition();
            }
            else
            {
                positsList = db.GetParentPosit(int.Parse(id));
            }
            var strResult = "{\"DropList\":" + positsList.ToJsonString() + "}";

            return(Json(strResult, JsonRequestBehavior.AllowGet));
        }