private void UpdateAttachmentURL(IfbaApi.ResourceTable ifbaResource, AttachmentTable at)
        {
            if (ifbaResource.Type == (int)IfbaApi.ResourceType.Link)
            {
                at.URL = ifbaResource.Filename;
            }
            else
            {
                string path = string.Format("{0}", BbicDir + "/Uploads");

                string fullName = ifbaResource.Filename.ToLower();

                var ifbaPath = OrgPaths + "/" + ifbaResource.MemberID.ToString() + "/Resources/" + ifbaResource.Path + "/" + ifbaResource.Filename;

                var files = Directory.GetFiles(path, ifbaResource.Filename, SearchOption.TopDirectoryOnly);

                if (files.Length == 0)
                {
                    var result = this.CopyFile(ifbaResource.Filename, ifbaPath, path);

                    if (string.IsNullOrEmpty(result) == true)
                    {
                        logger.WarnFormat("{0} file cannot be found", fullName);
                    }
                    else
                    {
                        at.URL = path.Replace(BbicDir, "~/");
                    }
                }
                else
                {
                    at.URL = path.Replace(BbicDir, "~");
                }
            }
        }
Exemple #2
0
 partial void DeleteAttachmentTable(AttachmentTable instance);
Exemple #3
0
 partial void InsertAttachmentTable(AttachmentTable instance);
Exemple #4
0
 partial void UpdateAttachmentTable(AttachmentTable instance);
Exemple #5
0
		private void detach_AttachmentTable(AttachmentTable entity)
		{
			this.SendPropertyChanging();
			entity.FileTable = null;
		}