Example #1
0
        internal Attachments GetAttachments(int NoteId)
        {
            string sSQL = "SELECT * FROM tblAttachments WHERE NoteId = " + NoteId +
                " And IsDefault = 0";

            DataSet DS = RF.GetDataSet(sSQL);
            DataTable DT = DS.Tables[0];
            Attachments AS = new Attachments();

            if(DT.Rows.Count == 0)
                return AS;

            foreach(DataRow r in DT.Rows)
            {
                Attachment X = new Attachment();
                X.mvarID = Convert.ToInt32(r[0]);
                X.mvarOriginalName = Convert.ToString(r[1]);
                X.mvarStoredName = Convert.ToString(r[2]);
                X.mvarNoteId = Convert.ToInt32(r[3]);
                X.mvarCreated = Convert.ToDateTime(r[4]);
                X.mvarFileSize = Convert.ToInt32(r[6]);
                AS.Add(X);
            }
            return AS;
        }
Example #2
0
 internal Attachment FillAttachment(DataRow r)
 {
     Attachment X = new Attachment();
     X.mvarID = Convert.ToInt32(r[0]);
     X.mvarOriginalName = Convert.ToString(r[1]);
     X.mvarStoredName = Convert.ToString(r[2]);
     X.mvarNoteId = Convert.ToInt32(r[3]);
     X.mvarCreated = Convert.ToDateTime(r[4]);
     X.mvarFileSize = Convert.ToInt32(r[6]);
     return X;
 }
Example #3
0
        internal Attachment GetAttachment(int AttachmentID)
        {
            string sSQL = "SELECT * FROM tblAttachments WHERE Id = " + AttachmentID;

            DataSet DS = RF.GetDataSet(sSQL);
            DataTable DT = DS.Tables[0];
            Attachment X = new Attachment();

            if(DT.Rows.Count == 0)
                return X;

            foreach(DataRow r in DT.Rows)
            {
                X.mvarID = Convert.ToInt32(r[0]);
                X.mvarStoredName = Convert.ToString(r[1]);
                X.mvarOriginalName = Convert.ToString(r[2]);
                X.mvarNoteId = Convert.ToInt32(r[3]);
                X.mvarCreated = Convert.ToDateTime(r[4]);
                X.mvarFileSize = Convert.ToInt32(r[6]);
            }
            return X;
        }
Example #4
0
 public void Add(Attachment X)
 {
     List.Add(X);
 }