示例#1
0
        /// <summary>
        /// 修改文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (dgList.SelectedItem != null)
            {
                WorkFileInfo selectfile = dgList.SelectedItem as WorkFileInfo;
                if (!string.IsNullOrEmpty(selectfile.GUID))
                {
                    int selectindex = dgList.SelectedIndex;

                    WorkFileManage modifyfile = new WorkFileManage(selectfile);
                    modifyfile.WindowTitle     = "修改工作文件";
                    modifyfile.AfterSaveEvent += (file) =>
                    {
                        MessageBox.Show("保存成功");
                        GetWorkFiles();
                        dgList.SelectedIndex = selectindex;
                    };
                    modifyfile.ShowDialog();
                }
                else
                {
                    MessageBox.Show(string.Format("{0}不包含文件,请先添加文件", SelectedCatalogItem.Value.Name));
                }
            }
        }
示例#2
0
 /// <summary>
 /// 添加工作文件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     if (SelectedCatalogItem != null)
     {
         WorkFileInfo file = new WorkFileInfo();
         file.IssuePerson  = CO_IA.Client.RiasPortal.Current.UserSetting.UserName;
         file.GUID         = System.Guid.NewGuid().ToString();
         file.Catalog.Guid = SelectedCatalogItem.Value.Guid;
         file.Catalog.Name = SelectedCatalogItem.Value.Name;
         file.SendState    = SendStateEnum.草拟;
         WorkFileManage dialog = new WorkFileManage(file);
         dialog.WindowTitle     = "添加工作文件";
         dialog.AfterSaveEvent += (newfile) =>
         {
             MessageBox.Show("保存成功");
             GetWorkFiles();
         };
         dialog.ShowDialog(this);
     }
     else
     {
         MessageBox.Show("请先选择目录");
     }
 }