public override string EvaluateExpressions(string url, string arg, bool bEncrypt, bool includeSession) { HonourContactLinksRecord rec = null; try { rec = this.GetRecord(); } catch (Exception) { // Do Nothing } if (rec == null && url.IndexOf("{") >= 0) { // Localization. throw new Exception(Page.GetResourceValue("Err:RecDataSrcNotInitialized", "OLR")); } if (includeSession) { return(EvaluateExpressions(url, arg, rec, bEncrypt)); } else { return(EvaluateExpressions(url, arg, rec, bEncrypt, includeSession)); } }
//Audit Trail methods //Evaluates Initialize when->Reading record formulas specified at the data access layer protected virtual void HonourContactLinksRecord_ReadRecord(Object sender, System.EventArgs e) { //Apply Initialize->Reading record formula only if validation is successful. HonourContactLinksRecord HonourContactLinksRec = (HonourContactLinksRecord)sender; if (HonourContactLinksRec != null && !HonourContactLinksRec.IsReadOnly) { } }
//Evaluates Initialize when->Updating formulas specified at the data access layer protected virtual void HonourContactLinksRecord_UpdatingRecord(Object sender, System.ComponentModel.CancelEventArgs e) { //Apply Initialize->Updating formula only if validation is successful. HonourContactLinksRecord HonourContactLinksRec = (HonourContactLinksRecord)sender; Validate_Updating(); if (HonourContactLinksRec != null && !HonourContactLinksRec.IsReadOnly) { } }
//Evaluates Initialize when->Inserting formulas specified at the data access layer protected virtual void HonourContactLinksRecord_InsertingRecord(Object sender, System.ComponentModel.CancelEventArgs e) { //Apply Initialize->Inserting formula only if validation is successful. HonourContactLinksRecord HonourContactLinksRec = (HonourContactLinksRecord)sender; Validate_Inserting(); if (HonourContactLinksRec != null && !HonourContactLinksRec.IsReadOnly) { HonourContactLinksRec.Parse(EvaluateFormula("\"false\"", this, null), HonourContactLinksTable.RecordDeleted); } }
public virtual void LoadData() { // Load the data from the database into the DataSource DatabaseOLR_db%dbo.HonourContactLinks record. // It is better to make changes to functions called by LoadData such as // CreateWhereClause, rather than making changes here. // The RecordUniqueId is set the first time a record is loaded, and is // used during a PostBack to load the record. if (this.RecordUniqueId != null && this.RecordUniqueId.Length > 0) { this.DataSource = HonourContactLinksTable.GetRecord(this.RecordUniqueId, true); return; } // This is the first time a record is being retrieved from the database. // So create a Where Clause based on the staic Where clause specified // on the Query wizard and the dynamic part specified by the end user // on the search and filter controls (if any). WhereClause wc = this.CreateWhereClause(); // If there is no Where clause, then simply create a new, blank record. if (wc == null || !(wc.RunQuery)) { this.DataSource = new HonourContactLinksRecord(); return; } // Retrieve the record from the database. It is possible HonourContactLinksRecord[] recList = HonourContactLinksTable.GetRecords(wc, null, 0, 2); if (recList.Length == 0) { // There is no data for this Where clause. wc.RunQuery = false; return; } // Set DataSource based on record retrieved from the database. this.DataSource = (HonourContactLinksRecord)HonourContactLinksRecord.Copy(recList[0], false); }
/// <summary> /// This is a shared function that can be used to get a HonourContactLinksRecord record using a where and order by clause. /// </summary> public static HonourContactLinksRecord GetRecord(BaseFilter join, string where, OrderBy orderBy) { SqlFilter whereFilter = null; if (where != null && where.Trim() != "") { whereFilter = new SqlFilter(where); } ArrayList recList = HonourContactLinksTable.Instance.GetRecordList(join, whereFilter, null, orderBy, BaseTable.MIN_PAGE_NUMBER, BaseTable.MIN_BATCH_SIZE); HonourContactLinksRecord rec = null; if (recList.Count > 0) { rec = (HonourContactLinksRecord)recList[0]; } return(rec); }