Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        ///<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);
        }
Ejemplo n.º 3
0
		///<summary></summary>
		public static void Update(AutoNote autonote) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),autonote);
				return;
			}
			Crud.AutoNoteCrud.Update(autonote);
		}
Ejemplo n.º 4
0
		///<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);
		}
Ejemplo n.º 5
0
 ///<summary></summary>
 public static void Update(AutoNote autonote)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), autonote);
         return;
     }
     Crud.AutoNoteCrud.Update(autonote);
 }
Ejemplo n.º 6
0
 ///<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));
 }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
 public SerializableAutoNote(AutoNote autoNote)
 {
     AutoNoteName = autoNote.AutoNoteName;
     MainText     = autoNote.MainText;
 }