Пример #1
0
        public static FormAccessRights GetFormAccessRightsByUserCodeAndFormName(string userCode, string formName)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
            IDataReader       reader     = null;

            FormAccessRights newFormAccessRights = new FormAccessRights();

            conManager.OpenDataReader(out reader, "spWebGetFormAccessRights", userCode, formName);
            try
            {
                while (reader.Read())
                {
                    newFormAccessRights.SetData(reader);
                }

                return(newFormAccessRights);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (conManager != null)
                {
                    conManager.CloseConnection();
                    conManager.Dispose();
                }

                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Пример #2
0
        public static CustomList <FormAccessRights> GetAllFormAccessRights()
        {
            ConnectionManager             conManager = new ConnectionManager(ConnectionName.SysMan);
            CustomList <FormAccessRights> FormAccessRightsCollection = new CustomList <FormAccessRights>();
            IDataReader  reader = null;
            const String sql    = "select *from SecurityRule_Object";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    FormAccessRights newFormAccessRights = new FormAccessRights();
                    newFormAccessRights.SetData(reader);
                    FormAccessRightsCollection.Add(newFormAccessRights);
                }
                FormAccessRightsCollection.InsertSpName = "spInsertFormAccessRights";
                FormAccessRightsCollection.UpdateSpName = "spUpdateFormAccessRights";
                FormAccessRightsCollection.DeleteSpName = "spDeleteFormAccessRights";
                return(FormAccessRightsCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }