/// <summary> /// Sets the data object definition, /// must be set preferably in the constructor of the derived object /// </summary> /// <param name="pCurrentUser"> /// The Current Logged User Object /// </param> /// <param name="pTableName"> /// Table Name of the data object will be using /// </param> /// <param name="pViewName"> /// View Name of the data object /// this will be used in Me.List() and Me.Load() if supplied /// </param> protected virtual void Setup(ClsSysCurrentUser pCurrentUser, string pTableName, string pViewName = "") { this.mCurrentUser = pCurrentUser; this.mHeader_TableName = pTableName; this.mHeader_TableKey = this.mHeader_TableName + "ID"; if (pViewName == "") { pViewName = pTableName; } this.mHeader_ViewName = pViewName; DataTable Dt_Def = this.mDa.GetTableDef(this.mHeader_TableName); DataRow[] ArrDr = Dt_Def.Select("IsPk = 1"); foreach (DataRow Dr in ArrDr) { this.mHeader_Key.Add((string)Dr["ColumnName"]); } this.mException = new ClsCustomException(); }
/// <summary> /// Sets the data object definition, /// must be set preferably in the constructor of the derived object /// </summary> /// <param name="CurrentUser"> /// The Current Logged User Object /// </param> /// <param name="TableName"> /// Table Name of the data object will be using /// </param> /// <param name="ViewName"> /// View Name of the data object /// this will be used in Me.List() and Me.Load() if supplied /// </param> /// <param name="TableKeyName"> /// Predefined Table Key Name, default is TableName + "ID" /// </param> protected virtual void Setup(string TableName, string ViewName = "") { this.mHeader_TableName = TableName; if (ViewName == "") { ViewName = TableName; } this.mHeader_ViewName = ViewName; DataTable Dt_Def = this.mDa.GetTableDef(this.mHeader_TableName); DataRow[] ArrDr = Dt_Def.Select("IsPk = 1"); foreach (DataRow Dr in ArrDr) { this.mHeader_Key.Add((string)Dr["ColumnName"]); } this.mException = new ClsCustomException(); }