コード例 #1
0
ファイル: Functions.cs プロジェクト: CarverLab/Oyster
        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;
        }
コード例 #2
0
ファイル: Functions.cs プロジェクト: CarverLab/Oyster
 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;
 }
コード例 #3
0
ファイル: Functions.cs プロジェクト: CarverLab/Oyster
        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;
        }
コード例 #4
0
ファイル: Attachments.cs プロジェクト: CarverLab/Oyster
 public void Add(Attachment X)
 {
     List.Add(X);
 }