Пример #1
0
        public async Task <ResultObj <int> > Delete(int keyId)
        {
            ResultObj <int> reObj = new ResultObj <int>();

            dbHelper.TranscationBegin();
            try
            {
                await dbHelper.Exec("delete from sys_user_role where user_id = " + keyId);

                await dbHelper.Exec("DELETE sys_login FROM sys_login ,sys_user where sys_login.login_name=sys_user.login_name and sys_user.id=" + keyId);

                reObj.data = await dbHelper.Delete(i => i.id == keyId);

                reObj.success = reObj.data > 0;
                dbHelper.TranscationCommit();
            }
            catch (Exception e)
            {
                reObj.success = false;
                reObj.msg     = e.Message;
                dbHelper.TranscationRollback();
            }

            return(reObj);
        }
Пример #2
0
        public async Task <ResultObj <int> > Delete(int key)
        {
            ResultObj <int> reObj = new ResultObj <int>();

            reObj.data = await dbHelper.Delete(i => i.id == key);

            reObj.success = reObj.data > 0;
            return(reObj);
        }
Пример #3
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <ResultObj <int> > Delete(int id)
        {
            var reObj = new ResultObj <int>();

            reObj.data = await dbHelper.Delete(x => x.id == id);

            reObj.success = reObj.data > 0;
            return(reObj);
        }
Пример #4
0
 public async Task <int> Delete(Expression <Func <SysQueryEntity, bool> > where)
 {
     return(await dal.Delete(where));
 }