示例#1
0
        static public AhsActiveRecord Find(string id)
        {
            var set = new AhsActiveRecordSet
            {
                Query = "select * from ACCOUNT_HIERARCHY_STEP where ACTIVE_STATUS = 'ACTIVE' AND ACCNT_HRCY_STEP_ID = :ahsId "
            };

            set.AddParameter("ahsId", id);
            return(set.Results().FirstOrDefault());
        }
示例#2
0
        /// <summary>
        /// Gets the ahs active record by upload key.
        /// </summary>
        public static AhsActiveRecord GetAhsActiveRecordByUploadKey(string uploadKey, string instance)
        {
            var records = new AhsActiveRecordSet
            {
                Instance = instance,
                Query    = "select * from ACCOUNT_HIERARCHY_STEP where UPLOAD_KEY = :uploadKey"
            };

            records.AddParameter("uploadKey", uploadKey);

            if (!records.Execute())
            {
                throw new ApplicationException(records.LastError);
            }

            foreach (var record in records)
            {
                return(record);
            }

            return(null);
        }