zzr99
2021-10-20 0c39b5c0ed0f6d01c60bf5e738787ac305270590
WebAPI/Controllers/BLL/Xt_UserController.cs
@@ -18,11 +18,7 @@
        DataSet ds;
        /// <summary>
        /// 返回系统用户列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        #region[用户列表查询]
        [Route("Xt_User/list")]
        [HttpGet]
        public object list(string sWhere)
@@ -65,9 +61,65 @@
                return objJsonResult;
            }
        }
        #endregion
        #region [用户列表删除功能]
        /// <summary>
        /// 用户信息删除功能
        /// </summary>
        /// <returns></returns>
        [Route("Xt_User/DeltetUser")]
        [HttpGet]
        public object DeltetUser(string HCzybm)
        {
            try
            {
                //编辑权限
                //if (!DBUtility.ClsPub.Security_Log("Gy_UserByUserRelation_Delete", 1, true, DBUtility.ClsPub.CurUserName))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无删除权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HCzybm);
                if (lngBillKey == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "用户编码为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                //删除用户信息
                oCN.RunProc("delete from  Gy_Czygl where Czybm='" + HCzybm + "'");
                //删除用户对应的角色信息
                oCN.RunProc("delete from  System_UserGroupInfo where UserId='" + HCzybm + "'");
                DBUtility.ClsPub.Add_Log(DBUtility.ClsPub.CurUserName, "删除用户:" + HCzybm, DBUtility.ClsPub.CurUserName);
                oCN.Commit();
        //
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message ="删除信息成功!";
                objJsonResult.data = null;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.Message;
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
    }
}