/// <summary> /// Returns a new blank document should only be used for the copy document method /// </summary> /// <param name="TypeId">Document Type Id</param> /// <returns>The will return a new document of the type specified</returns> public static DB.SYS_DOC_Header New(SYS_DOC_Type type) { DB.SYS_DOC_Header document = SYS_DOC_Header.New; document.TypeId = (byte)type; //Tried to do this here but the server cant save for some reason //document.SYS_Tracking = SYS.SYS_Tracking.New; //document.ORG_TRX_Header.Add(BL.ORG.ORG_TRX_Header.New); return(document); }
public static DB.SYS_DOC_Header LoadByTrackId(Int64 trackId, SYS_DOC_Type type, DataContext dataContext, List <string> includes) { var query = dataContext.EntitySystemContext.SYS_DOC_Header.AsQueryable(); if (includes != null) { foreach (string include in includes) { query = query.Include(include); } } return(query.FirstOrDefault(n => n.TrackId == trackId && n.TypeId == (byte)type && n.SiteId == ApplicationDataContext.Instance.LoggedInUser.DefaultSiteId)); }
public static DB.SYS_DOC_Header LoadByTrackId(Int64 Id, SYS_DOC_Type type, DataContext dataContext) { return(LoadByTrackId(Id, type, dataContext, null)); }