Click or drag to resize

RemFileImport Method (ObjectID, String, String, Boolean, String, Boolean, Int32)

Paperwork .Net Kütüphanesi
İstemciden sunucuya dosya gönderimi için kullanılır.

Namespace:  Paperwork.Connect
Assembly:  Paperwork.Connect (in Paperwork.Connect.dll) Version: 5.0.0.0
Syntax
C#
public a_GenericResult Import(
	ObjectID objectId,
	string fileName,
	string aOriginalFormat,
	bool isCompress,
	string compressFormat,
	bool aIsBitonal,
	int aDpi
)

Parameters

objectId
Type: ObjectID
Gönderilen dosyanın bağlı olduğu doküman nesne numarası
fileName
Type: SystemString
Dosyanın diskte bulunduğu yer (path ve dosya ismi ile birlikte)
aOriginalFormat
Type: SystemString
Dosyanın formatı. Dosya Formatı büyük harf olmalı, nokta ve türkçe karakter içermemeli (örn: TIF, GIF, JPG vs).
isCompress
Type: SystemBoolean
İçerik Sıkıştırılacak mı bilgisi.
compressFormat
Type: SystemString
Sıkıştırma formatı (internal kullanım içindir)
aIsBitonal
Type: SystemBoolean
Siyah beyaz belge olup olmadığı.(imaj değil ise false değeri verilir.)
aDpi
Type: SystemInt32
Belge çözünürlüğü. (Belge imaj değil ise 0 geçilir. imaj ise minimum 96 değeri verilir.)

Return Value

Type: a_GenericResult
a_GenericResult nesesi içinde , ErrorCode=0 ise işlem başarılıdır. Aksi taktirde Result ve Message alanları kontrol ediniz.
Examples
Dokümanı içeri aktarma
 

                 ObservableCollection<LookupItem> acls  = p.rLookup.GetACLs(string.Empty);
                 ObservableCollection<LookupItem> types = p.rLookup.GetTypes(string.Empty, string.Empty);
                 ObservableCollection<LookupItem> forms = p.rLookup.GetForms(false, string.Empty);


                 public LookupItem getACLByName(string name)
                 {
                     foreach (LookupItem acl in acls)
                         if (acl.Title == name)
                             return acl;
                     return null;
                 }

                 public LookupItem getTypeByTitle(string title)
                 {
                     foreach (LookupItem typ in types)
                         if (typ.Title == title)
                             return typ;
                     return null;
                 }

                 public LookupItem getFormByTitle(string title)
                 {
                     foreach (LookupItem frm in forms)
                         if (frm.Title == title)
                             return frm;
                     return null;
                 }

                 public string createFolder(string path, string acl_id)
                 {
                     a_PathInfo pth = p.rNavigation.CreateFolderByPath(path, new ObjectID(acl_id), false);
                     return pth.ObjectList[pth.ObjectList.Count - 1];
                 }

                 public void Import()
                 {
                     foreach (string filename in Directory.GetFiles(@"C:\"))  
                     {
                         string type_name    = getTypeByTitle("Egitim").Name;
                         string form_name    = getFormByTitle("Egitim").Name;
                         string acl_id       = getACLByName("Default Acl").ObjectId;
                         string save_path    = @"TR_CABINETS\Deneme\Egitim";
                         string folder_id    = createFolder(save_path, acl_id);
                         string object_name  = Path.GetFileName(filename);
                         string file_ext     = Path.GetExtension(filename).Replace(".", "").ToUpper().Replace("İ", "I");

                         ITypes fobject = p.rDocument.getDocument(ObjectID.Empty, type_name);
                         fobject.setAttribute("ACL_ID", acl_id);
                         fobject.setAttribute("OBJECT_TYPE", type_name);
                         fobject.setAttribute("FOLDER_ID", folder_id);
                         fobject.setAttribute("FORM_NAME", form_name);
                         fobject.setAttribute("FORM_VERSION", "1");
                         fobject.setAttribute("OBJECT_NAME", object_name);
                         fobject.setAttribute("FILE_FORMAT", file_ext);
                         fobject.setAttribute("DENEME", "12345");

                         a_GenericResult res = p.rDocument.SetDocument(fobject);
                         if (res.ErrorCode != 0)
                             throw new Exception(res.Message);
                         string obj_id = res.Result;

                         Console.WriteLine("Dosya kaydedildi. ObjectID:{0}", obj_id);

                         byte[] content = System.IO.File.ReadAllBytes(filename);

                         a_GenericResult ires = p.rFile.Import(new ObjectID(obj_id), filename, file_ext, false, "ZIP", false, 0);
                         if (ires.ErrorCode != 0)
                             throw new Exception(ires.Message);
                     }
                     Console.WriteLine("Dosya içerigi kaydedildi.");
            }
See Also