public List <RoleWisePermission> RoleWisePermission_GetAll()
        {
            DbDataReader oDbDataReader = null;

            try
            {
                List <RoleWisePermission> lstRoleWisePermission = new List <RoleWisePermission>();
                DbCommand oDbCommand = DbProviderHelper.CreateCommand("RoleWisePermission_GetAll", CommandType.StoredProcedure);
                oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
                while (oDbDataReader.Read())
                {
                    RoleWisePermission oRoleWisePermission = new RoleWisePermission();
                    BuildEntity(oDbDataReader, oRoleWisePermission);
                    lstRoleWisePermission.Add(oRoleWisePermission);
                }
                return(lstRoleWisePermission);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!oDbDataReader.IsClosed)
                {
                    oDbDataReader.Close();
                    oDbDataReader.Dispose();
                }
            }
        }
Пример #2
0
        public List <PageList> PageList_GetAll()
        {
            DbDataReader oDbDataReader = null;

            try
            {
                List <PageList> lstPageList = new List <PageList>();
                DbCommand       oDbCommand  = DbProviderHelper.CreateCommand("PageList_GetAll", CommandType.StoredProcedure);
                oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
                while (oDbDataReader.Read())
                {
                    PageList oPageList = new PageList();
                    BuildEntity(oDbDataReader, oPageList);
                    lstPageList.Add(oPageList);
                }
                return(lstPageList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!oDbDataReader.IsClosed)
                {
                    oDbDataReader.Close();
                    oDbDataReader.Dispose();
                }
            }
        }
        public RoleWisePermission RoleWisePermission_GetById(Int64 PermissionId)
        {
            DbDataReader oDbDataReader = null;

            try
            {
                RoleWisePermission oRoleWisePermission = new RoleWisePermission();
                DbCommand          oDbCommand          = DbProviderHelper.CreateCommand("RoleWisePermission_GetById", CommandType.StoredProcedure);
                AddParameter(oDbCommand, "@PermissionId", DbType.Int64, PermissionId);
                oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
                while (oDbDataReader.Read())
                {
                    BuildEntity(oDbDataReader, oRoleWisePermission);
                }
                return(oRoleWisePermission);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!oDbDataReader.IsClosed)
                {
                    oDbDataReader.Close();
                    oDbDataReader.Dispose();
                }
            }
        }
        public List <RoleWisePermission> RoleWisePermission_GetDynamic(string WhereCondition, string OrderByExpression)
        {
            DbDataReader oDbDataReader = null;

            try
            {
                List <RoleWisePermission> lstRoleWisePermission = new List <RoleWisePermission>();
                DbCommand oDbCommand = DbProviderHelper.CreateCommand("RoleWisePermission_GetDynamic", CommandType.StoredProcedure);
                AddParameter(oDbCommand, "@WhereCondition", DbType.String, WhereCondition);
                AddParameter(oDbCommand, "@OrderByExpression", DbType.String, OrderByExpression);
                oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
                while (oDbDataReader.Read())
                {
                    RoleWisePermission oRoleWisePermission = new RoleWisePermission();
                    BuildEntity(oDbDataReader, oRoleWisePermission);
                    lstRoleWisePermission.Add(oRoleWisePermission);
                }
                return(lstRoleWisePermission);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!oDbDataReader.IsClosed)
                {
                    oDbDataReader.Close();
                    oDbDataReader.Dispose();
                }
            }
        }
Пример #5
0
        public PageList PageList_GetById(Int32 PageId)
        {
            DbDataReader oDbDataReader = null;

            try
            {
                PageList  oPageList  = new PageList();
                DbCommand oDbCommand = DbProviderHelper.CreateCommand("PageList_GetById", CommandType.StoredProcedure);
                AddParameter(oDbCommand, "@PageId", DbType.Int32, PageId);
                oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
                while (oDbDataReader.Read())
                {
                    BuildEntity(oDbDataReader, oPageList);
                }
                return(oPageList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!oDbDataReader.IsClosed)
                {
                    oDbDataReader.Close();
                    oDbDataReader.Dispose();
                }
            }
        }
Пример #6
0
        public Store Store_GetById(int StoreId)
        {
            DbDataReader oDbDataReader = null;

            try
            {
                Store     oStore     = new Store();
                DbCommand oDbCommand = DbProviderHelper.CreateCommand("Store_GetById", CommandType.StoredProcedure);
                AddParameter(oDbCommand, "@StoreId", DbType.Int32, StoreId);
                oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
                while (oDbDataReader.Read())
                {
                    BuildEntity(oDbDataReader, oStore);
                }
                return(oStore);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!oDbDataReader.IsClosed)
                {
                    oDbDataReader.Close();
                    oDbDataReader.Dispose();
                }
            }
        }
Пример #7
0
        public List <Store> Store_GetAll()
        {
            DbDataReader oDbDataReader = null;

            try
            {
                List <Store> lstStore   = new List <Store>();
                DbCommand    oDbCommand = DbProviderHelper.CreateCommand("Store_GetAll", CommandType.StoredProcedure);
                oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
                while (oDbDataReader.Read())
                {
                    Store oStore = new Store();
                    BuildEntity(oDbDataReader, oStore);
                    lstStore.Add(oStore);
                }
                return(lstStore);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!oDbDataReader.IsClosed)
                {
                    oDbDataReader.Close();
                    oDbDataReader.Dispose();
                }
            }
        }
Пример #8
0
        public DataTable Store_GetById(int storeId)
        {
            DbDataReader oDbDataReader = null;
            DataTable    dt            = new DataTable();

            try
            {
                DbCommand oDbCommand = DbProviderHelper.CreateCommand("Store_GetById", CommandType.StoredProcedure);
                AddParameter(oDbCommand, "@StoreId", DbType.Int32, storeId);
                oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
                dt.Load(oDbDataReader);
                return(dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!oDbDataReader.IsClosed)
                {
                    oDbDataReader.Close();
                    oDbDataReader.Dispose();
                }
            }
        }
Пример #9
0
        public List <Roles> Roles_GetByCompanyId(Int32 CompanyId)
        {
            DbDataReader oDbDataReader = null;

            try
            {
                List <Roles> lstRoless  = new List <Roles>();
                DbCommand    oDbCommand = DbProviderHelper.CreateCommand("Roles_GetByCompanyId", CommandType.StoredProcedure);
                AddParameter(oDbCommand, "@CompanyId", DbType.Int32, CompanyId);
                oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
                while (oDbDataReader.Read())
                {
                    Roles oRoles = new Roles();
                    BuildEntity(oDbDataReader, oRoles);
                    lstRoless.Add(oRoles);
                }
                return(lstRoless);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!oDbDataReader.IsClosed)
                {
                    oDbDataReader.Close();
                    oDbDataReader.Dispose();
                }
            }
        }
        public List <RoleWisePermission> RoleWisePermission_GetPaged(int StartRowIndex, int RowPerPage, string WhereClause, string SortColumn, string SortOrder, ref int rows)
        {
            DbDataReader oDbDataReader = null;

            try
            {
                List <RoleWisePermission> lstRoleWisePermission = new List <RoleWisePermission>();
                DbCommand oDbCommand = DbProviderHelper.CreateCommand("RoleWisePermission_GetPaged", CommandType.StoredProcedure);
                AddParameter(oDbCommand, "@StartRowIndex", DbType.Int32, StartRowIndex);
                AddParameter(oDbCommand, "@RowPerPage", DbType.Int32, RowPerPage);
                AddParameter(oDbCommand, "@WhereClause", DbType.String, WhereClause);
                AddParameter(oDbCommand, "@SortColumn", DbType.String, SortColumn);
                AddParameter(oDbCommand, "@SortOrder", DbType.String, SortOrder);
                oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
                while (oDbDataReader.Read())
                {
                    RoleWisePermission oRoleWisePermission = new RoleWisePermission();
                    BuildEntity(oDbDataReader, oRoleWisePermission);
                    lstRoleWisePermission.Add(oRoleWisePermission);
                }
                if ((oDbDataReader.NextResult()) && (oDbDataReader.Read()))
                {
                    rows = oDbDataReader.GetInt32(0);
                }
                return(lstRoleWisePermission);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (!oDbDataReader.IsClosed)
                {
                    oDbDataReader.Close();
                    oDbDataReader.Dispose();
                }
            }
        }