private Note convertNote(NOTE note) { // find parent element ElementView parentElement = null; foreach (RequestView request in this.requestList.Data) { foreach (ElementView element in request.ElementList) if (element.ID == note.ELEMENT_ID) parentElement = element; } if (parentElement == null) throw new NullReferenceException("Unable to find the parent element of the note: " + note.NOTE_TEXT); UserMgr userMgr = new UserMgr(MainFactory.getUserSvc()); return new Note(note, userMgr.getUser(note.UPDATED_BY_ID), parentElement); }
private void detach_NOTEs(NOTE entity) { this.SendPropertyChanging(); entity.EMPLOYEE = null; }
public NOTE saveNote(Note note) { try { using (ConsoleDataContext db = (ConsoleDataContext)MainFactory.getDb("Console", false)) { NOTE newNote = new NOTE { ELEMENT_ID = note.Parent.ID, NOTE_DATE = note.Date, NOTE_TEXT = note.Text, UPDATED_BY_ID = note.UpdatedBy.EmployeeID }; db.NOTEs.InsertOnSubmit(newNote); db.SubmitChanges(); return newNote; } } catch (Exception se) { throw new Exception("Unable to add a new note due to " + se.Message); } }
private void attach_NOTEs(NOTE entity) { this.SendPropertyChanging(); entity.EMPLOYEE = this; }
partial void DeleteNOTE(NOTE instance);
partial void UpdateNOTE(NOTE instance);
partial void InsertNOTE(NOTE instance);
private void attach_NOTEs(NOTE entity) { this.SendPropertyChanging(); entity.ELEMENT = this; }