public static string GetByTitle(string autoNoteTitle) { //No need to check RemotingRole; no call to db. AutoNote autoNote = GetFirstOrDefault(x => x.AutoNoteName == autoNoteTitle); return(autoNote == null ? "" : autoNote.MainText); }
///<summary>Returns true if there is a valid AutoNote for the passed in AutoNoteName.</summary> public static bool IsValidAutoNote(string autoNoteTitle) { //No need to check RemotingRole; no call to db. AutoNote autoNote = GetFirstOrDefault(x => x.AutoNoteName == autoNoteTitle); return(autoNote != null); }
///<summary></summary> public static void Update(AutoNote autonote) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),autonote); return; } Crud.AutoNoteCrud.Update(autonote); }
///<summary></summary> public static long Insert(AutoNote autonote) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { autonote.AutoNoteNum=Meth.GetLong(MethodBase.GetCurrentMethod(),autonote); return autonote.AutoNoteNum; } return Crud.AutoNoteCrud.Insert(autonote); }
///<summary></summary> public static void Update(AutoNote autonote) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), autonote); return; } Crud.AutoNoteCrud.Update(autonote); }
///<summary></summary> public static long Insert(AutoNote autonote) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { autonote.AutoNoteNum = Meth.GetLong(MethodBase.GetCurrentMethod(), autonote); return(autonote.AutoNoteNum); } return(Crud.AutoNoteCrud.Insert(autonote)); }
public static void InsertBatch(List <SerializableAutoNote> listSerializableAutoNotes) { if (listSerializableAutoNotes == null || listSerializableAutoNotes.Count == 0) { return; } if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), listSerializableAutoNotes); return; } List <AutoNote> listAutoNotes = new List <AutoNote>(); foreach (SerializableAutoNote autoNote in listSerializableAutoNotes) { AutoNote newNote = new AutoNote(); newNote.AutoNoteName = autoNote.AutoNoteName; newNote.Category = 0; //It would be too error-prone trying to select the category, so we'll just leave it as 0. newNote.MainText = autoNote.MainText; listAutoNotes.Add(newNote); } Crud.AutoNoteCrud.InsertMany(listAutoNotes); }
public SerializableAutoNote(AutoNote autoNote) { AutoNoteName = autoNote.AutoNoteName; MainText = autoNote.MainText; }