public TaskAssociationsViewItemProxy GetProxy() { TaskAssociationsViewItemProxy result = new TaskAssociationsViewItemProxy(); result.Contact = this.Contact; result.Product = this.Product; result.Group = this.Group; result.Company = this.Company; result.User = this.User; result.TicketName = this.TicketName; result.TicketNumber = this.TicketNumber; result.RefType = this.RefType; result.RefID = this.RefID; result.TaskID = this.TaskID; if (result.RefType == (int)ReferenceType.CompanyActivity || result.RefType == (int)ReferenceType.ContactActivity) { Notes notes = new Notes(BaseCollection.LoginUser); notes.LoadByNoteID(result.RefID); //check if note even exist if (notes.Count > 0) { var notesProxy = notes[0].GetProxy(); result.Activity = notesProxy.Title; result.ActivityID = notesProxy.NoteID; result.ActivityRefID = notesProxy.RefID; } else { return(null); } } return(result); }
public static Note GetNote(LoginUser loginUser, int noteID) { Notes notes = new Notes(loginUser); notes.LoadByNoteID(noteID); if (notes.IsEmpty) { return(null); } else { return(notes[0]); } }