Beispiel #1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string Save(Sys_FunctionM model)
        {
            if (model.Function_ID.ToGuid().Equals(Guid.Empty))
            {
                model.Function_ID = db.Add(model, li).ToGuid();
                if (model.Function_ID.ToGuid().Equals(Guid.Empty))
                {
                    throw new MessageBox(db.ErrorMessge);
                }
            }
            else
            {
                if (!db.EditById <Sys_FunctionM>(model, li))
                {
                    throw new MessageBox(db.ErrorMessge);
                }
            }
            if (!db.Commit(li))
            {
                throw new MessageBox(db.ErrorMessge);
            }

            return(model.Function_ID.ToGuidStr());
        }
 public IActionResult Save(Sys_FunctionM model)
 {
     this.KeyID = _Sys_FunctionBL.Save(model);
     return(Json(new { status = 1, ID = KeyID }));
 }