protected T FindObjectByItemID <T>(T Obj, SBMObjectList <T> ObjLst, int nID) where T : SBMObject, new() { //--- Check object exists if (Obj == null) { //--- Find the object imn the objects if ((Obj = (T)ObjLst.FindByItemID(nID)) == null) { throw new Exception(ErrMsg_ObjNotExi.Replace("%cls%", GetType().Name).Replace("%id%", nID.ToString())); } } return(Obj); }
protected SBMObjectList <T> ReadObjects <T>(SBMObjectList <T> ObjLst, string sTabName, string sSQLWhere = null) where T : SBMObject, new() { ItemList ItemLst = null; //--- Check object list exists if (ObjLst == null) { //--- Read the item list ItemLst = GetTable(sTabName).NewItemList(); ItemLst.ReadBySQL(String.IsNullOrEmpty(sSQLWhere) ? SQLWhere_All : sSQLWhere); //--- Init the objects ObjLst = new SBMObjectList <T>(this, ItemLst); } return(ObjLst); }
public SBMObjectList <Project> GetProjects() { return(Projects = ReadObjects(Projects, Project.TabName_Prj)); }
public SBMObjectList <Planning> GetPlannings() { return(Plannings = ReadObjects(Plannings, Planning.TabName_Pln, SQLWhere_Plns.Replace("%id%", GetID().ToString()))); }