コード例 #1
0
        public async Task <IEnumerable <ESysRoleMenu> > GetMenuByRoleAsync(string sWhere, Dapper.DynamicParameters param)
        {
            string sql = "select RoleID,MenuID from Sys_RoleMenu where 1=1 {0}";

            sql = string.Format(sql, sWhere);
            return(await _context.QueryAsync <ESysRoleMenu>(sql, param));
        }
コード例 #2
0
 public async Task <IEnumerable <Product> > GetAllAsync()
 {
     return(await _context.QueryAsync <Product>(@"SELECT Id
                                     ,Name
                                     ,Quantity
                                     ,Price
                                     ,CategoryId
                                 FROM Product"));
 }
コード例 #3
0
 public async Task <IEnumerable <UserAddress> > GetAllAsync()
 {
     return(await _context.QueryAsync <UserAddress>("SELECT * FROM UserAddress"));
 }
コード例 #4
0
        public async Task <IEnumerable <ESysRoleAlarmLevel> > GetAlarmLevelByRoleID(int RoleID, enAlarmLevelType alarmType)
        {
            string sql = "select RoleID,AlarmLevel,AlarmType from Sys_RoleAlarmLevel where RoleID=@RoleID and  AlarmType=@AlarmType";

            return(await _context.QueryAsync <ESysRoleAlarmLevel>(sql, new { RoleID = RoleID, AlarmType = (int)alarmType }));
        }
コード例 #5
0
        public async Task <IEnumerable <ESysAlarmLevel> > GetAlarmLevel(int AlarmLevelType)
        {
            string sql = "select ID,AlarmLevel,AlarmType,iAlarmLevel from Sys_AlarmLevel where AlarmType=@AlarmType";

            return(await _context.QueryAsync <ESysAlarmLevel>(sql, new { AlarmType = AlarmLevelType }));
        }
コード例 #6
0
 public async Task <IEnumerable <ESysUserRole> > GetAllAsync()
 {
     return(await _context.QueryAsync <ESysUserRole>("select ID,RoleID,UserID,UserName from Sys_UserRole"));
 }
コード例 #7
0
 public async Task <IEnumerable <ESysKeywords> > GetAllAsync()
 {
     return(await _context.QueryAsync <ESysKeywords>("select ID,Keyword,ReplaceValue,Status from Sys_Keywords"));
 }
コード例 #8
0
 public async Task <IEnumerable <ESysMenu> > GetMenuByParentIDAsync(int ParentID)
 {
     return(await _context.QueryAsync <ESysMenu>(
                "select MenuID,MenuTitle,MenuUrl,ParentID,Sort,Status from Sys_Menu where Status=1 and ParentID=@ParentID order by Sort",
                new { ParentID = ParentID }));
 }
コード例 #9
0
 public async Task <IEnumerable <Category> > GetAllAsync()
 {
     return(await _context.QueryAsync <Category>(@"SELECT Id
                                     ,Name
                                 FROM category"));
 }
コード例 #10
0
 public async Task <IEnumerable <EMessageBox> > GetAllAsync()
 {
     return(await _context.QueryAsync <EMessageBox>("select ID,Sender,SenderID,Receiver,ReceiverID,SendTime,CreateTime,Title,Content,Type,Status from MessageBox"));
 }
コード例 #11
0
 public async Task <IEnumerable <ESysUserInfo> > GetAllAsync()
 {
     return(await _context.QueryAsync <ESysUserInfo>("select UserID,UserName,RealName,Pwd,Mobile,Wechat,OpenId,Dept,Position,Status from Sys_UserInfo"));
 }
コード例 #12
0
 public async Task <IEnumerable <Product> > GetAllAsync()
 {
     return(await _context.QueryAsync <Product>("SELECT * FROM Product"));
 }
コード例 #13
0
 public async Task <IEnumerable <ESysRole> > GetAllAsync()
 {
     return(await _context.QueryAsync <ESysRole>("select RoleID,RoleName,Status,Mark from Sys_Role"));
 }
コード例 #14
0
 /// <summary>
 /// 列表查询-sql通用查询
 /// </summary>
 /// <typeparam name="TEnity"> 根据sql定义Model</typeparam>
 /// <param name="sql"></param>
 /// <param name="param"></param>
 /// <param name="isCommandTypeText"></param>
 /// <returns></returns>
 public Task <IEnumerable <TEnity> > SQLQueryAsync <TEnity>(string sql, object param = null, bool isCommandTypeText = true)
 {
     return(_context.QueryAsync <TEnity>(sql, param, isCommandTypeText ? CommandType.Text: CommandType.StoredProcedure));
 }