示例#1
0
        //删除
        private void delAttach_Click(object sender, RoutedEventArgs e)
        {
            if (DEVDialog.ConfirmDelete() == DialogResult.Cancel)
            {
                return;
            }
            SysAttachInfo sysAttach = (SysAttachInfo)gridView.GetFocusedRow();

            _wsClient.UseService(s => s.DelSysAttachInfo(sysAttach.PKNO));
            BindGridView();
        }
示例#2
0
        private void btnDownLoad_Click_1(object sender, RoutedEventArgs e)
        {
            SysAttachInfo tempAttachInfo = (SysAttachInfo)gridView.GetFocusedRow();

            if (tempAttachInfo == null)
            {
                return;
            }

            Microsoft.Win32.SaveFileDialog dlg0 = new Microsoft.Win32.SaveFileDialog();
            dlg0.FileName   = tempAttachInfo.ATTACHNAME;
            dlg0.DefaultExt = tempAttachInfo.ATTACHFORMATE;

            if (dlg0.ShowDialog() != true)
            {
                return;
            }

            this.Cursor = System.Windows.Input.Cursors.Wait;

            string filename = dlg0.FileName;

            try
            {
                SysAttachInfo sysAttachInfo = _wsClient.UseService(s => s.GetSysAttachInfoById(tempAttachInfo.PKNO));
                if (sysAttachInfo == null)
                {
                    this.Cursor = System.Windows.Input.Cursors.Arrow;
                    return;
                }

                FileHelper.BytesToFile(sysAttachInfo.ATTACHINFO, filename);
                this.Cursor = System.Windows.Input.Cursors.Arrow;

                NotificationInvoke.NewNotification("提示", "文件成功下载到:" + filename);
            }
            catch (Exception)
            {
                this.Cursor = System.Windows.Input.Cursors.Arrow;
                DEVDialog.ShowError("下载失败");
            }
        }