Example #1
0
 public static CBE.RoleModuleRightCollection GetAll()
 {
     try
     {
         //Stored procedure must have cur_out parameter.
         //There is no need to add ref cursor for oracle in code.
         CBE.RoleModuleRightCollection roleRights = new CBE.RoleModuleRightCollection();
         string    spName  = Constants.oraclePackagePrefix + "rolemodright_getall";
         DbCommand command = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.GetStoredProcCommand(spName);
         roleRights = ConvertDataTableToCollection(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.LoadDataSet(command, tableName).Tables[tableName]);
         return(roleRights);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #2
0
        public static IEnumerable <VaaaN.MLFF.Libraries.CommonLibrary.CBE.RoleModuleRightActivityCBE> GetRoleModuleRightByRoleId(Int32 role_Id)
        {
            IEnumerable <VaaaN.MLFF.Libraries.CommonLibrary.CBE.RoleModuleRightActivityCBE> modules;

            try
            {
                //Stored procedure must have cur_out parameter.
                //There is no need to add ref cursor for oracle in code.
                CBE.RoleModuleRightCollection roleRights = new CBE.RoleModuleRightCollection();
                string    spName  = Constants.oraclePackagePrefix + "MODULEACTIVITY_BYROLEID";
                DbCommand command = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.GetStoredProcCommand(spName);
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "p_role_id", DbType.Int32, role_Id, ParameterDirection.Input));
                modules = ConvertTableToIEnurable(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.LoadDataSet(command, tableName).Tables[tableName]);
                return(modules);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        private static CBE.RoleModuleRightCollection ConvertDataTableToCollection(DataTable dt)
        {
            try
            {
                CBE.RoleModuleRightCollection roleModuleRights = new CBE.RoleModuleRightCollection();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    CBE.RoleModuleRightCBE roleModuleRight = new CBE.RoleModuleRightCBE();

                    if (dt.Rows[i]["ROLE_ID"] != DBNull.Value)
                    {
                        roleModuleRight.RoleId = Convert.ToInt32(dt.Rows[i]["ROLE_ID"]);
                    }



                    if (dt.Rows[i]["MODULE_ACTIVITY_ENTRY_ID"] != DBNull.Value)
                    {
                        roleModuleRight.ModuleActivityEntryId = Convert.ToInt32(dt.Rows[i]["MODULE_ACTIVITY_ENTRY_ID"]);
                    }

                    if (dt.Rows[i]["TRANSFER_STATUS"] != DBNull.Value)
                    {
                        roleModuleRight.TransferStatus = Convert.ToInt32(dt.Rows[i]["TRANSFER_STATUS"]);
                    }

                    roleModuleRights.Add(roleModuleRight);
                }
                return(roleModuleRights);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }