Exemple #1
0
        public DataSet SelectObjectForDisplay(IGenericEntity ent)
        {
            this.storedProcedures.Clear();
            InitializeObject(ent);

            if (!storedProcedures.ContainsKey("SelectObjectForDisplay"))
            {
                throw new NotImplementedException(ApplicationMessages.EXCEPTION_IMPLEMENT_SELECTOBJECT);
            }

            DBStoredProcedure selectSP = storedProcedures["SelectObjectForDisplay"];
            SqlCommand        cmd      = selectSP.GetSqlCommand();

            DataSet returnDS = null;

            try
            {
                returnDS = CurrentConnectionManager.GetDataSet(cmd);
            }
            catch (SqlException exc)
            {
                throw new IndException(exc);
            }

            return(returnDS);
        }
        /// <summary>
        /// Gets the permissions of the current user
        /// </summary>
        /// <param name="idCurrentUser">the id of the current user</param>
        /// <returns>a dataset containing information about the permissions of the user</returns>
        public DataSet GetUserPermissions(int idCurrentUser, int idCountry)
        {
            SqlCommand command = new SqlCommand();

            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "authSelectUserPermissions";

            SqlParameter idCurrentUserParameter = new SqlParameter("@IdUser", idCurrentUser);

            idCurrentUserParameter.DbType    = DbType.Int32;
            idCurrentUserParameter.Direction = ParameterDirection.Input;
            command.Parameters.Add(idCurrentUserParameter);

            return(CurrentConnectionManager.GetDataSet(command));
        }