Example #1
0
        public JsonResult CreateAndEditer(string positionId, string posName, string parentId, string remark)
        {
            Position posit;

            if (string.IsNullOrEmpty(positionId))
            {
                posit = new Position();
            }
            else
            {
                posit = db.GetModel(int.Parse(positionId));
            }
            posit.PosName = posName;
            if (string.IsNullOrEmpty(parentId))
            {
                posit.ParentId = null;
            }
            else
            {
                posit.ParentId = int.Parse(parentId);
            }
            posit.Remark         = remark;
            posit.LastChangeTime = DateTime.Now;
            db.Save(posit);
            return(Json("OK"));
        }