Exemplo n.º 1
0
        private void LvDataContent_AfterLabelEdit(object sender, LabelEditEventArgs e)
        {
            string newText = e.Label;

            if (string.IsNullOrEmpty(newText) || newText == _oldText)
            {
                e.CancelEdit = true;
                return;
            }
            TDataInfoDTO dto = (LvDataContent.Items[e.Item] as ListViewItemEx).ItemData;

            dto.DataName       = newText;
            dto.LastModifyTime = DateTime.Now;
            dto.ParentId       = dto.ParentId == null ? string.Empty : dto.ParentId;
            bool success = _client.TDataInfoUpdate(dto);

            if (success)
            {
                UpdateViewItem(dto, LvDataContent.Items[e.Item] as ListViewItemEx);
            }
        }
Exemplo n.º 2
0
 private void _bgwork_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if ((bool)e.Result == false)
     {
         ReportError();
     }
     else
     {
         Hide();
         if (OpareteType == OpareteTypeEnum.Download)
         {
             ItemData.DownloadTimes += 1;
             bool success = _client.TDataInfoUpdate(ItemData);
             if (success)
             {
                 this.ToolTipText = string.Format("文件名称:{0}\r\n文件大小:{1}M\r\n上传时间:{2}\r\n上传人:{3}\r\n修改时间:{4}\r\n下载次数:{5}\r\n文件描述:{6}", ItemData.DataName, CommomHelper.ParseMB(ItemData.FileSize), ItemData.CreateTime, ItemData.UploadPeople, ItemData.LastModifyTime, ItemData.DownloadTimes, ItemData.DataDescription);
             }
         }
     }
 }