/// <summary> /// Gets the Keys of the supplied row using the Key Definition of the Data Object /// </summary> /// <param name="Dr"> /// Source datarow, mostly the same definition as from Me.List() /// </param> /// <returns></returns> public ClsKeys GetKeys(DataRow Dr) { ClsKeys Obj = new ClsKeys(); foreach (string Key in this.mHeader_Key) { Int64 ID = (Int64)Layer01_Methods.IsNull(Dr[Key], 0); Obj.Add(Key, ID); } return Obj; }
/// <summary> /// Gets the Keys of the supplier datarow using the supplier Key Definition /// </summary> /// <param name="Dr"> /// Source datarow /// </param> /// <param name="KeyNames"> /// Key definition /// </param> /// <returns></returns> public ClsKeys GetKeys(DataRow Dr, List<string> KeyNames) { bool IsFound = false; ClsKeys Key = new ClsKeys(); foreach (string Inner_Key in KeyNames) { if (!Information.IsDBNull(Dr[Inner_Key])) { Key.Add(Inner_Key, (Int64)Layer01_Methods.IsNull(Dr[Inner_Key], 0)); } else { IsFound = true; break; } } if (IsFound) { Key = null; } return Key; }
//[-] /// <summary> /// Gets the current Keys of the Data Object /// </summary> /// <returns></returns> public ClsKeys GetKeys() { ClsKeys Obj = new ClsKeys(); foreach (string Key in this.mHeader_Key) { Int64 ID = Convert.ToInt64(Layer01_Methods.IsNull(this.mHeader_Dr[Key], 0)); Obj.Add(Key, ID); } return Obj; }