/// <summary> /// Returns a Hashtable with the fields that have been updated since the previous request. /// The Hashtable key is the fieldname and the value is a string description of the change /// for this order /// </summary> /// <param name="keyAttribute"></param> /// <returns>Hashtable</returns> /// <returns></returns> public Hashtable GetDifference(string keyAttribute) { Affinity.Request prev = this.GetPreviousRequest(); Hashtable ht = new Hashtable(); if (prev != null) { Hashtable cHt = this.GetTranslatedHashTable(keyAttribute, true, true); Hashtable pHt = prev.GetTranslatedHashTable(keyAttribute, true, true); foreach (string key in cHt.Keys) { if (pHt.ContainsKey(key)) { if (!pHt[key].Equals(cHt[key])) { ht.Add(key, "CHANGED FROM: '" + pHt[key].ToString() + "' TO: '" + cHt[key].ToString() + "'"); } } else { ht.Add(key, "NEW: '" + cHt[key].ToString() + "'"); } } } return(ht); }
/// <summary> /// If this is a change request, returns the previous request of the same type. This /// is useful for comparing the difference when a change is submitted. If no previous /// request exists, then null is returned /// </summary> /// <returns>Affinity.Request || null</returns> public Affinity.Request GetPreviousRequest() { RequestCriteria rc = new RequestCriteria(); rc.RequestTypeCode = this.RequestTypeCode; rc.IdLessThan = this.Id; rc.AppendToOrderBy("Id", true); Affinity.Requests rs = this.Order.GetOrderRequests(rc); Affinity.Request prev = null; if (rs.Count > 0) { prev = (Affinity.Request)rs[0]; } return(prev); }
/// <summary> /// Returns a Hashtable with the fields that have been updated since the previous request. /// The Hashtable key is the fieldname and the value is an array where item[0] is the /// original value and item[1] is the new value /// </summary> /// <param name="keyAttribute"></param> /// <returns>Hashtable</returns> public Hashtable GetChangePairs(string keyAttribute) { Affinity.Request prev = this.GetPreviousRequest(); Hashtable ht = new Hashtable(); if (prev != null) { Hashtable cHt = this.GetTranslatedHashTable(keyAttribute, true, true); Hashtable pHt = prev.GetTranslatedHashTable(keyAttribute, true, true); foreach (string key in cHt.Keys) { if (pHt.ContainsKey(key)) { if (!pHt[key].Equals(cHt[key])) { // changed value string[] pair = new string[2] { pHt[key].ToString(), cHt[key].ToString() }; ht.Add(key, pair); } } else { // new value that didn't exist before string[] pair = new string[2] { "", cHt[key].ToString() }; ht.Add(key, pair); } } } return(ht); }
// use the base constructor public TPSServicePFTRenderer(Affinity.Request req, Hashtable sys) : base(req, sys) { }
// use the base constructor public PFTChangeRenderer(Affinity.Request req, Hashtable sys) : base(req, sys) { }
// use the base constructor public XmlREIRenderer(Affinity.Request req, Hashtable sys) : base(req, sys) { }
public BaseRenderer(Affinity.Request req, Hashtable sys) { this.request = req; this.settings = sys; }
// use the base constructor public PFTSecondMortgageRenderer(Affinity.Request req, Hashtable sys) : base(req, sys) { }