private void skinCheckBoxZone_CheckedChanged(object sender, EventArgs e) { try { if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } CJBasic.CbGeneric cb = new CJBasic.CbGeneric(this.DoSelected); cb.BeginInvoke(null, null); ShowProgressForm(); } catch (Exception ex) { CommonGlobalUtil.ShowError(ex); } finally { CompleteProgressForm(); UnLockPage(); } }
private void baseButtonImport_Click(object sender, EventArgs e) { path = CJBasic.Helpers.FileHelper.GetFileToOpen("请选择导入文件"); if (String.IsNullOrEmpty(path)) { return; } string fileExt = Path.GetExtension(path); if (fileExt != ".xlsx" && fileExt != ".xls") { ShowMessage("你所选择文件格式不正确,请重新上传文件!"); return; } if (GlobalMessageBox.Show("是否开始导入" + System.IO.Path.GetFileName(path), "友情提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { path = null; return; } /* if (NPOIHelper.IsFileInUse(path)) * { * ShowMessage("你所选择文件已被打开,请关闭后再重新导入!"); * return; * } */ try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } CJBasic.CbGeneric cb = new CJBasic.CbGeneric(this.DoImport); cb.BeginInvoke(null, null); } catch (Exception ex) { GlobalUtil.ShowError(ex); } }
private void ShowUnCheck() { try { if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } CJBasic.CbGeneric cb = new CJBasic.CbGeneric(this.DoShowUnCheck); cb.BeginInvoke(null, null); ShowProgressForm(); } catch (Exception ex) { CommonGlobalUtil.ShowError(ex); } finally { CompleteProgressForm(); UnLockPage(); } }
private void Button_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(FileName)) { GlobalMessageBox.Show("请设置FileName属性!"); return; } path = CJBasic.Helpers.FileHelper.GetPathToSave("保存文件", FileName + new Date(DateTime.Now).ToDateInteger() + ".xls", Environment.GetFolderPath(Environment.SpecialFolder.Personal)); if (String.IsNullOrEmpty(path)) { return; } try { if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } CJBasic.CbGeneric cb = new CJBasic.CbGeneric(this.DoExport); cb.BeginInvoke(null, null); } catch (Exception ex) { CommonGlobalUtil.ShowError(ex); } }