Ejemplo n.º 1
0
        private void attachmentsGrid_CellClick(object sender, GridViewCellEventArgs e)
        {
            Guid        attachID     = Guid.Parse(e.Row.Cells["ID"].Value.ToString());
            attachments attachedFile = _attachCollection.Where(t => t.ID == attachID).First();

            NewPrioritizer.openAttachment(attachedFile.bin, attachedFile.fileName);
        }
Ejemplo n.º 2
0
 static void AddFile(attachments attachment, XDoc doc, bool wrap)
 {
     if (wrap)
     {
         doc.Start("file");
     }
     doc
     .Attr("id", attachment.ID.ToString())
     .Attr("page", attachment.From.ToString())
     .Start("full-name").Value(attachment.GetFullName()).End()
     .Start("name").Value(attachment.Name).End()
     .Start("extension").Value(attachment.Extension).End()
     .Start("filename").Value(attachment.FileName).End()
     .Start("description").Value(attachment.Description).End()
     .Start("size").Value(attachment.FileSize.ToString()).End()
     .Start("type").Value(attachment.FileType).End()
     .Start("timestamp").Value(attachment.TimeStamp).End()
     .Start("user").Value(attachment.UserText).End();
     if (attachment.Removed != DateTime.MinValue)
     {
         doc.Start("removed").Value(attachment.Removed).End()
         .Start("removed-by").Value(attachment.RemovedByText).End();
     }
     if (wrap)
     {
         doc.End();
     }
 }
 public void applyChangesAttachments(attachments a)
 {
     using (PrioritizerUnitOfWork uow = UnitOfWork)
     {
         uow.Context.attachments.ApplyChanges(a);
         uow.Commit();
     }
 }
 public void deleteAttachment(attachments a)
 {
     using (PrioritizerUnitOfWork uow = UnitOfWork)
     {
         uow.Context.attachments.DeleteObject(a);
         uow.Commit();
     }
 }
Ejemplo n.º 5
0
        private void openSelectedAttachment()
        {
            attachments attch        = gridView1.GetRow(gridView1.GetSelectedRows().FirstOrDefault()) as attachments;
            Guid        attachID     = attch.ID;
            attachments attachedFile = _attachCollection.Where(t => t.ID == attachID).First();

            frmMain.openAttachment(attachedFile.bin, attachedFile.fileName);
        }
Ejemplo n.º 6
0
        void repositoryDeleteAttachButton_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Delete Selected Attachments ?", "Delete Attachment", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No)
            {
                return;
            }

            attachments a = gridView1.GetRow(gridView1.GetSelectedRows().FirstOrDefault()) as attachments;

            ConnectionManager.Proxy.deleteAttachment(a, frmMain.loggedInUserID);
        }
        public void addAttachment(attachments a, Guid userID)
        {
            using (PrioritizerUnitOfWork uow = UnitOfWork)
            {
                try
                {
                    uow.Context.attachments.AddObject(a);

                    Tasks task = getTaskByID(a.taskID.Value);
                    task.StartTracking();
                    task.hasAttachment = true;
                    applyChangesTasks(task, userID, null);
                    uow.Commit();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
Ejemplo n.º 8
0
 static void AddFile(attachments attachment, XDoc doc, bool wrap) {
     if (wrap)
         doc.Start("file");
     doc
         .Attr("id", attachment.ID.ToString())
         .Attr("page", attachment.From.ToString())
         .Start("full-name").Value(attachment.GetFullName()).End()
         .Start("name").Value(attachment.Name).End()
         .Start("extension").Value(attachment.Extension).End()
         .Start("filename").Value(attachment.FileName).End()
         .Start("description").Value(attachment.Description).End()
         .Start("size").Value(attachment.FileSize.ToString()).End()
         .Start("type").Value(attachment.FileType).End()
         .Start("timestamp").Value(attachment.TimeStamp).End()
         .Start("user").Value(attachment.UserText).End();
     if (attachment.Removed != DateTime.MinValue) {
         doc.Start("removed").Value(attachment.Removed).End()
         .Start("removed-by").Value(attachment.RemovedByText).End();
     }
     if (wrap)
         doc.End();
 }
Ejemplo n.º 9
0
 static void AddFile(attachments attachment, XDoc doc) {
     AddFile(attachment, doc, true);
 }
Ejemplo n.º 10
0
 static void AddFile(attachments attachment, XDoc doc)
 {
     AddFile(attachment, doc, true);
 }