예제 #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);
        }
예제 #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);
        }
예제 #3
0
파일: AutoNotes.cs 프로젝트: mnisl/OD
		///<summary></summary>
		public static void Update(AutoNote autonote) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),autonote);
				return;
			}
			Crud.AutoNoteCrud.Update(autonote);
		}
예제 #4
0
파일: AutoNotes.cs 프로젝트: mnisl/OD
		///<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);
		}
예제 #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);
 }
예제 #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));
 }
예제 #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);
        }
예제 #8
0
 public SerializableAutoNote(AutoNote autoNote)
 {
     AutoNoteName = autoNote.AutoNoteName;
     MainText     = autoNote.MainText;
 }