//--- Constructors ---
 protected AttachmentBL()
 {
     _dekiContext = DekiContext.Current;
     _session     = DbUtils.CurrentSession;
     _resources   = _dekiContext.Resources;
     _resourceBL  = ResourceBL.Instance;
 }
Beispiel #2
0
 //--- Constructors ---
 protected PropertyBL() {
     _resourceBL = ResourceBL.Instance;
 }
Beispiel #3
0
 //--- Constructors ---
 protected AttachmentBL() {
     _dekiContext = DekiContext.Current;
     _session = DbUtils.CurrentSession;
     _resources = _dekiContext.Resources;
     _resourceBL = ResourceBL.Instance;
 }
Beispiel #4
0
 //--- Constructors ---
 protected PropertyBL()
 {
     _resourceBL = ResourceBL.Instance;
 }
        private static AttachmentBE PopulateFile(IDataRecord dr) {
            
            string name = GetUTF8String(dr, "img_name");
            uint size = DbUtils.Convert.To<uint>(dr["img_size"], 0);
            MimeType mimetype = new MimeType(GetUTF8String(dr, "img_major_mime") +"/" + GetUTF8String(dr, "img_minor_mime"));
            string changedescription = GetUTF8String(dr, "img_description");
            uint userId;
            if (MediaWikiConverterContext.Current.Merge) {
                userId = MediaWikiConverterContext.Current.MergeUserId;
            } else {
                userId = DbUtils.Convert.To<uint>(dr["img_user"], 0);
            }
            DateTime timestamp = DbUtils.ToDateTime(GetUTF8String(dr, "img_timestamp"));

            ResourceContentBE rc = new ResourceContentBE(true);
            rc.Size = size;
            rc.MimeType = mimetype;

            AttachmentBE file = new ResourceBL<AttachmentBE>(ResourceBE.Type.FILE).BuildRevForNewResource(0/*parent page defined later*/, ResourceBE.Type.PAGE, name, mimetype, size, changedescription, ResourceBE.Type.FILE, userId, rc);
            file.MetaXml.Elem("physicalfilename", GetUTF8String(dr, "img_filename"));
            return file;
        }