Example #1
0
        public static void DeleteRoleRightByRoleId(CBE.RoleModuleRightCBE roleModuleRight)
        {
            try
            {
                string    spName  = Constants.oraclePackagePrefix + "rolemodright_deletebyroleid";
                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, roleModuleRight.RoleId, ParameterDirection.Input));
                VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.ExecuteNonQuery(command);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public static void Insert(CBE.RoleModuleRightCBE roleModuleRight)
        {
            try
            {
                string    spName  = Constants.oraclePackagePrefix + "rolemodright_insert";
                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, roleModuleRight.RoleId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "p_module_activity_entry_id", DbType.Int32, roleModuleRight.ModuleActivityEntryId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "p_transfer_status", DbType.Int32, (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.TransferStatus.NotTransferred, ParameterDirection.Input));

                VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.ExecuteNonQuery(command);
            }
            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;
            }
        }