public static Lib.Data.UserList GetMyFormsAndDocumentsList() { var profile = Security.GetCurrentProfile(); var lists = Lib.Data.UserList.FindByUserProfile( profile, "drug-link", true ); if( lists.Count > 0 ) { for( int i = 0; i < lists.Count; i++ ) if( lists[i].Name == "Forms and Documents" ) return lists[i]; } var ret = new Data.UserList(); ret.DataType = "drug-link"; ret.DateCreated = DateTime.Now; ret.DateModified = DateTime.Now; ret.Name = "Forms and Documents"; ret.System = true; ret.UserProfileID = profile.ID; ret.Save(); return ret; }
public static Lib.Data.UserList GetUsersDrugList( long profile_id ) { var profile = new Data.UserProfile( profile_id ); var lists = Lib.Data.UserList.FindByUserProfile( profile, "drug", true ); if( lists.Count > 0 ) { for( int i = 0; i < lists.Count; i++ ) if( lists[i].Name == "My Drugs" ) return lists[i]; } var ret = new Data.UserList(); ret.DataType = "drug"; ret.DateCreated = DateTime.Now; ret.DateModified = DateTime.Now; ret.Name = "My Drugs"; ret.System = true; ret.UserProfileID = profile.ID; ret.Save(); return ret; }