private void buttonAttachment_Click(object sender, EventArgs e)
        {
            var temp = new List <AttachHelp>();

            if (curr?.Attach != null)
            {
                foreach (var att in curr.Attach)
                {
                    var atthelp = new AttachHelp()
                    {
                        Attach = att,
                        Todo   = AttachHelp.State.NA,
                    };
                    temp.Add(atthelp);
                }
            }
            if (FileInMemory.Any())
            {
                temp.AddRange(FileInMemory);
            }
            var attachForm = new AttachmentForm(temp);

            if (attachForm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            if (attachForm.HelperAttachments.Any())
            {
                FileInMemory.Clear();
                FileInMemory.AddRange(attachForm.HelperAttachments);
            }
        }
Example #2
0
        void AddGrid(AttachHelp att)
        {
            int index = grid.Rows.Add();

            grid.Rows[index].Cells["ColumnName"].Value = att.Attach.Name;
            grid.Rows[index].Tag = att;
        }