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()); }
/// <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); }