Beispiel #1
0
 /// <summary>
 /// 附件修改(内存)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void menuAttachmentEdit_Click(object sender, EventArgs e)
 {
     if (lvAttachment.SelectedItems.Count > 0)
     {
         ProductAttachment att = (ProductAttachment)lvAttachment.SelectedItems[0].Tag;
         using (ProductAttachmentEditDialog dlg = new ProductAttachmentEditDialog(Product.ProductAttachmentList, att))
         {
             if (dlg.ShowDialog() == DialogResult.OK)
             {
                 // 刷新界面
                 ResetAttachmentList();
             }
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// 附件增加(内存)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuAttachmentAdd_Click(object sender, EventArgs e)
        {
            ProductAttachment tmpAtt = new ProductAttachment(Product.Id, AttachmentType.磁盘路径, string.Empty, null);

            using (ProductAttachmentEditDialog dlg = new ProductAttachmentEditDialog(Product.ProductAttachmentList, tmpAtt))
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    // 增加对象
                    Product.ProductAttachmentList.Add(tmpAtt);
                    // 刷新界面
                    ResetAttachmentList();
                }
            }
        }