コード例 #1
0
        public List<Rolepermission> RetrieveRolepermissionsPaging(RolepermissionSearch info,int pageIndex, int pageSize,out int count)
        {
            try
            {
                StringBuilder sqlCommand = new StringBuilder(@" SELECT ""ROLEPERMISSION"".""ROLEID"",""ROLEPERMISSION"".""MENUID"",""ROLEPERMISSION"".""REMARK"",""ROLEPERMISSION"".""LASTMODIFIEDDATE"",""ROLEPERMISSION"".""LASTMODIFIEDBY"",
                     ""ROLEPERMISSION"".""RIGHTCODE""
                     FROM ""ROLEPERMISSION""
                     WHERE 1=1");
                #region ��ɫ���
                if (!string.IsNullOrEmpty(info.Roleid))
                {
                    this.Database.AddInParameter(":Roleid",DbType.AnsiString,"%"+info.Roleid+"%");
                    sqlCommand.AppendLine(@" AND ""ROLEPERMISSION"".""ROLEID"" LIKE :Roleid");
                }
                #endregion

                #region �˵����
                if (!string.IsNullOrEmpty(info.Menuid))
                {
                    this.Database.AddInParameter(":Menuid",DbType.AnsiString,"%"+info.Menuid+"%");
                    sqlCommand.AppendLine(@" AND ""ROLEPERMISSION"".""MENUID"" LIKE :Menuid");
                }
                #endregion

                #region ��ע
                if (!string.IsNullOrEmpty(info.Remark))
                {
                    this.Database.AddInParameter(":Remark", "%"+info.Remark+"%");
                    sqlCommand.AppendLine(@" AND ""ROLEPERMISSION"".""REMARK"" LIKE :Remark");
                }
                #endregion

                #region ����޸�ʱ��
                if (info.StartLastmodifieddate.HasValue)
                {
                    this.Database.AddInParameter(":StartLastmodifieddate",info.StartLastmodifieddate.Value.Date);
                    sqlCommand.AppendLine(@" AND ""ROLEPERMISSION"".""LASTMODIFIEDDATE"" >= :StartLastmodifieddate");
                }
                if (info.EndLastmodifieddate.HasValue)
                {
                    this.Database.AddInParameter(":EndLastmodifieddate",info.EndLastmodifieddate.Value.Date.AddDays(1).AddSeconds(-1));
                    sqlCommand.AppendLine(@" AND ""ROLEPERMISSION"".""LASTMODIFIEDDATE"" <= :EndLastmodifieddate");
                }
                #endregion

                #region ����޸���
                if (!string.IsNullOrEmpty(info.Lastmodifiedby))
                {
                    this.Database.AddInParameter(":Lastmodifiedby",DbType.AnsiString,"%"+info.Lastmodifiedby+"%");
                    sqlCommand.AppendLine(@" AND ""ROLEPERMISSION"".""LASTMODIFIEDBY"" LIKE :Lastmodifiedby");
                }
                #endregion

                #region Ȩ�ޱ���(�Զ��ŵķ�ʽ�ָ�)
                if (!string.IsNullOrEmpty(info.Rightcode))
                {
                    this.Database.AddInParameter(":Rightcode",DbType.AnsiString,"%"+info.Rightcode+"%");
                    sqlCommand.AppendLine(@" AND ""ROLEPERMISSION"".""RIGHTCODE"" LIKE :Rightcode");
                }
                #endregion

                sqlCommand.AppendLine(@"  ORDER BY ""ROLEPERMISSION"".""ROLEID"" DESC,""ROLEPERMISSION"".""MENUID"" DESC");
                return this.ExecuteReaderPaging<Rolepermission>(sqlCommand.ToString(), pageIndex, pageSize, out count);
            }
            finally
            {
                this.Database.ClearParameter();
            }
        }
コード例 #2
0
 public List<Rolepermission> RetrieveRolepermissionsPaging(RolepermissionSearch info, int pageIndex, int pageSize, out int count)
 {
     return Management.RetrieveRolepermissionsPaging(info, pageIndex, pageSize, out count);
 }