示例#1
0
        /// <summary>
        /// Initializes the extension attributes.
        /// </summary>
        private void InitializeExtensionAttributes()
        {
            if (_lazyExtensionAttributes == null)
            {
                _lazyExtensionAttributes = new Dictionary <string, string>();
            }
            else
            {
                _lazyExtensionAttributes.Clear();
            }

            var results = new ActiveRecordSet
            {
                Instance = Instance,
                Query    = "select * from employee_ext where employee_id = :employee_id",
            };

            results.AddParameter(":employee_id", EmployeeId);
            if (results.Execute())
            {
                foreach (ActiveRecord record in results)
                {
                    _lazyExtensionAttributes.Add(record.GetColumnValue("FIELD_NAME"), record.GetColumnValue("FIELD_VALUE"));
                }
            }
        }
示例#2
0
        /// <summary>
        /// Gets the lob codes associated with an internet user.
        /// </summary>
        static public string GetLobCodes(string userId, string accountNumber)
        {
            var records = new ActiveRecordSet
            {
                Query = string.Format(
                    "SELECT DISTINCT LU.LOB_CD || ' - ' || L.LOB_NAME AS LOB_DESC " +
                    "FROM LOB L, LOCATIONS_USER LU, ACCOUNT_USER AU ,USERS U " +
                    "WHERE LU.LOB_CD=L.LOB_CD  and LU.ACCOUNT_USER_ID = AU.USER_ID AND AU.USER_ID = U.USER_ID " +
                    "AND U.USER_ID = {0} AND LU.ACCOUNT_LOCATION_CODE = '{1}'", userId, accountNumber)
            };

            var results = string.Empty;

            if (!records.Execute())
            {
                return(results);
            }
            var first = true;

            foreach (ActiveRecord record in records)
            {
                if (!first)
                {
                    results += ";";
                }
                else
                {
                    first = false;
                }
                results += record.GetColumnValue("LOB_DESC").Trim();
            }
            return(results);
        }
示例#3
0
        //protected override void AddQueryParameters()
        //{
        //  AddParameter("code_type", CodeTypeId);
        //}

        /// <summary>
        /// Gets LU_TYPE_ID by name.
        /// </summary>
        static public string GetLookupTypeIdByName(string name)
        {
            var results = new ActiveRecordSet
            {
                Query = string.Format("select LU_TYPE_ID from LU_TYPE where NAME = '{0}'", name)
            };

            return((results.Execute() && results.MoveNext()) ? results[0].ToString(): string.Empty);
        }
示例#4
0
        /// <summary>
        /// Users the in group.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="groupName">Name of the group.</param>
        /// <returns></returns>
        public static bool UserInGroup(int userId, string groupName)
        {
            var records = new ActiveRecordSet {
                Query = "select COUNT(*) AS COUNT from groups G, user_group U where G.GROUP_ID = U.GROUP_ID AND U.USER_ID = :user_id AND G.GROUP_NM = :group_name "
            };

            records.AddParameter("user_id", userId);
            records.AddParameter("group_name", groupName);
            return(records.Execute() && records.GetRecord(0).GetColumnValue("COUNT") != "0");
        }
示例#5
0
        public void TestHtml()
        {
            // var results = new ActiveRecordSet { Instance = DbBaseClass.SENQA, Query = "select * from claim_submission_log where created_dt > (sysdate - 1) order by 1 desc" };
            var results = new ActiveRecordSet {
                Instance = DbBaseClass.SENQA, Query = "select * from mercury order by 1 desc"
            };

            Assert.IsTrue(results.Execute());
            Console.WriteLine(results.ToXml());
        }
示例#6
0
        public void TestGetTemplateName()
        {
            var templates = new ActiveRecordSet {
                Instance = "FNSBA", Query = "SELECT FILE_NAME FROM OUTPUT_XMLTEMPLATE"
            };

            Assert.IsTrue(templates.Execute(), templates.LastError);
            foreach (ActiveRecord rec in templates)
            {
                Console.WriteLine(rec.GetColumnValue("FILE_NAME"));
            }
        }
示例#7
0
        private List <AccessPermission> BuildPermissions(string sql)
        {
            var permissions = new List <AccessPermission>();
            var records     = new ActiveRecordSet {
                Query = sql, Instance = Instance
            };

            records.AddParameter(UserId);
            if (records.Execute())
            {
                foreach (ActiveRecord rec in records)
                {
                    permissions.Add(new AccessPermission(rec.GetColumnValue("FUNCTION_NAME"), rec.GetColumnValue("ACCESS_TYPE")));
                }
            }
            return(permissions);
        }
示例#8
0
        /// <summary>
        /// Builds the extensions.
        /// </summary>
        /// <returns></returns>
        private Dictionary <string, string> BuildExtensions()
        {
            var results = new Dictionary <string, string>();
            var records = new ActiveRecordSet {
                Query = "select FIELD_NAME, FIELD_VALUE from USER_EXT where USER_ID = :user_id", Instance = Instance
            };

            records.AddParameter("user_id", UserId);
            if (!records.Execute())
            {
                return(results);
            }
            foreach (ActiveRecord rec in records)
            {
                results.Add(rec.GetColumnValue("FIELD_NAME"), rec.GetColumnValue("FIELD_VALUE"));
            }
            return(results);
        }
示例#9
0
        public void TestEstarAppraiserRecord()
        {
            var appraisers = new ActiveRecordSet {
                Instance = "ESUBA", Query = "select * from estar_appraiser"
            };

            Assert.IsTrue(appraisers.Execute(), appraisers.LastError);
            {
                foreach (ActiveRecord rec in appraisers)
                {
                    var index = 0;
                    foreach (var c in rec.Columns)
                    {
                        Console.WriteLine("COLUMN{0}: {1}, {2}", index++, c.Name, c.Value);
                    }
                }
            }
        }