public async Task OnCommandClicked(CommandClickEventArgs <OrderMasterAdapterModel> args) { OrderMasterAdapterModel item = args.RowData as OrderMasterAdapterModel; if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdEdit) { #region 點選 修改紀錄 按鈕 CurrentRecord = item.Clone(); EditRecordDialogTitle = "修改紀錄"; IsShowEditRecord = true; isNewRecordMode = false; #endregion } else if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdDelete) { #region 點選 刪除紀錄 按鈕 CurrentNeedDeleteRecord = item; #region 檢查關聯資料是否存在 var checkedResult = await CurrentService .BeforeDeleteCheckAsync(CurrentNeedDeleteRecord); await Task.Delay(100); if (checkedResult.Success == false) { MessageBox.Show("400px", "200px", "警告", ErrorMessageMappingHelper.Instance.GetErrorMessage(checkedResult.MessageId)); await Task.Yield(); thisView.NeedRefresh(); return; } #endregion ConfirmMessageBox.Show("400px", "200px", "警告", "確認要刪除這筆紀錄嗎?"); #endregion } else if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdShowDetailOfMaster) { #region 點選 開啟多筆 CRUD 對話窗 按鈕 IsShowMoreDetailsRecord = true; ShowMoreDetailsRecordDialogTitle = MagicHelper.訂單明細管理功能名稱; MasterRecord masterRecord = new MasterRecord() { Id = item.Id }; Header = masterRecord; if (ShowMoreDetailsGrid != null) { await Task.Delay(100); // 使用延遲,讓 Header 的資料綁定可以成功 ShowMoreDetailsGrid.RefreshGrid(); } #endregion } }
public async Task OnCommandClicked(CommandClickEventArgs <OrderItemAdapterModel> args) { OrderItemAdapterModel item = args.RowData as OrderItemAdapterModel; if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdEdit) { #region 點選 修改紀錄 按鈕 CurrentRecord = item.Clone(); EditRecordDialogTitle = "修改紀錄"; IsShowEditRecord = true; isNewRecordMode = false; #endregion } else if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdDelete) { #region 點選 刪除紀錄 按鈕 CurrentNeedDeleteRecord = item; #region 檢查關聯資料是否存在 var checkedResult = await CurrentService .BeforeDeleteCheckAsync(CurrentNeedDeleteRecord); await Task.Delay(100); if (checkedResult.Success == false) { MessageBox.Show("400px", "200px", "警告", ErrorMessageMappingHelper.Instance.GetErrorMessage(checkedResult.MessageId), MessageBox.HiddenAsync); await Task.Yield(); await thisView.NeedRefreshAsync(); return; } #endregion #region 刪除這筆紀錄 await Task.Yield(); var checkTask = ConfirmMessageBox.ShowAsync("400px", "200px", "警告", "確認要刪除這筆紀錄嗎?", ConfirmMessageBox.HiddenAsync); await thisView.NeedRefreshAsync(); var checkAgain = await checkTask; if (checkAgain == true) { var verifyRecordResult = await CurrentService.DeleteAsync(CurrentNeedDeleteRecord.Id); await TranscationResultHelper.CheckDatabaseResult(MessageBox, verifyRecordResult); dataGrid.RefreshGrid(); } #endregion #endregion } }
private void chMain_CommandClick(object sender, CommandClickEventArgs e) { if (e.Command == cUndo) { txtScript.Undo(); } else if (e.Command == cRedo) { txtScript.Redo(); } else if (e.Command == cCut) { txtScript.Cut(); } else if (e.Command == cCopy) { txtScript.Copy(); } else if (e.Command == cPaste) { txtScript.Paste(); } else if (e.Command == cDelete) { txtScript.SelectedText = string.Empty; } else if (e.Command == cSelectAll) { txtScript.SelectAll(); } else { // insert menu text C1Command item = e.Command; txtScript.SelectedText = item.Text; // position cursor int openPar = item.Text.IndexOf("("); int asterisk = item.Text.IndexOf("*"); if (openPar > -1) { txtScript.SelectionStart -= (item.Text.Length - openPar - 1); } else if (asterisk > -1) { txtScript.SelectionStart -= (item.Text.Length - asterisk); txtScript.SelectionLength = 1; } } }
private void CommandClickHandler(object sender, CommandClickEventArgs e) { string cmdData = e.Command.UserData as string; switch (cmdData) { case "file_new": this.richTextBox1.Text = string.Empty; this.Text = "New document"; break; case "file_open": OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Text files|*.txt|Rich text files|*.rtf|All files|*.*"; if (ofd.ShowDialog() == DialogResult.OK) { switch (ofd.FilterIndex) { case 1: this.richTextBox1.LoadFile(ofd.FileName, RichTextBoxStreamType.PlainText); break; case 2: this.richTextBox1.LoadFile(ofd.FileName, RichTextBoxStreamType.RichText); break; default: this.richTextBox1.LoadFile(ofd.FileName); break; } this.Text = ofd.FileName; } break; case "exit": foreach (Form f in s_forms) { f.Close(); } break; case "window_new": (new Form1()).Show(); break; default: break; } }
public void OnCommandClicked(CommandClickEventArgs <OutlineAdapterModel> args) { OutlineAdapterModel item = args.RowData as OutlineAdapterModel; if (args.CommandColumn.ButtonOption.Content == "修改") { CurrentRecord = item; EditRecordDialogTitle = "修改紀錄"; IsShowEditRecord = true; isNewRecordMode = false; } else if (args.CommandColumn.ButtonOption.Content == "刪除") { #region 檢查關聯資料是否存在 #endregion CurrentNeedDeleteRecord = item; ConfirmMessageBox.Show("400px", "200px", "警告", "確認要刪除這筆紀錄嗎?"); } }
public async Task OnCommandClicked(CommandClickEventArgs <ProductAdapterModel> args) { ProductAdapterModel item = args.RowData as ProductAdapterModel; if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdEdit) { #region 點選 修改紀錄 按鈕 CurrentRecord = item.Clone(); EditRecordDialogTitle = "修改紀錄"; IsShowEditRecord = true; isNewRecordMode = false; #endregion } else if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdDelete) { #region 點選 刪除紀錄 按鈕 CurrentNeedDeleteRecord = item; #region 檢查關聯資料是否存在 var checkedResult = await CurrentService .BeforeDeleteCheckAsync(CurrentNeedDeleteRecord); await Task.Delay(100); if (checkedResult.Success == false) { MessageBox.Show("400px", "200px", "警告", ErrorMessageMappingHelper.Instance.GetErrorMessage(checkedResult.MessageId)); await Task.Yield(); thisView.NeedRefresh(); return; } #endregion ConfirmMessageBox.Show("400px", "200px", "警告", "確認要刪除這筆紀錄嗎?"); #endregion } }
private void c1CommandHolder1_CommandClick(object sender, CommandClickEventArgs e) { if (e.Command == c1Command_ViewErrorList) { c1TabPage_ErrorList.DockTo(c1DockingTab1); } else if (e.Command == c1Command_ViewOutput) { c1TabPage_Output.Visible = true; } else if (e.Command == c1Command_ViewProperties) { c1TabPage_Properties.DockTo(c1DockingTab1); } else if (e.Command == c1Command_ViewServerExplorer) { c1TabPage_ServerExplorer.DockTo(c1DockingTab1); } else if (e.Command == c1Command_ViewSolutionExplorer) { c1TabPage_SolutionExplorer.DockTo(c1DockingTab1); } else if (e.Command == c1Command_ViewStartPage) { c1TabPage_StartPage.DockTo(c1DockingTab1); } else if (e.Command == c1Command_ViewTaskList) { c1TabPage_TaskList.DockTo(c1DockingTab1); } else if (e.Command == c1Command_ViewToolbox) { c1TabPage_Toolbox.DockTo(c1DockingTab1); } else if (e.Command == c1Command_Save) { c1CommandHolder1.LayoutSaveInAppConfig(); } }
public async Task OnCommandClicked(CommandClickEventArgs <PolicyHeaderAdapterModel> args) { PolicyHeaderAdapterModel item = args.RowData as PolicyHeaderAdapterModel; if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdEdit) { #region 點選 修改紀錄 按鈕 CurrentRecord = item.Clone(); EditRecordDialogTitle = "修改紀錄"; IsShowEditRecord = true; isNewRecordMode = false; #endregion } else if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdDelete) { #region 點選 刪除紀錄 按鈕 CurrentNeedDeleteRecord = item; #region 檢查關聯資料是否存在 var checkedResult = await CurrentService .BeforeDeleteCheckAsync(CurrentNeedDeleteRecord); await Task.Delay(100); if (checkedResult.Success == false) { MessageBox.Show("400px", "200px", "警告", ErrorMessageMappingHelper.Instance.GetErrorMessage(checkedResult.MessageId), MessageBox.HiddenAsync); await Task.Yield(); thisView.NeedRefresh(); return; } #endregion #region 刪除這筆紀錄 await Task.Yield(); var checkTask = ConfirmMessageBox.ShowAsync("400px", "200px", "警告", "確認要刪除這筆紀錄嗎?", ConfirmMessageBox.HiddenAsync); thisView.NeedRefresh(); var checkAgain = await checkTask; if (checkAgain == true) { var verifyRecordResult = await CurrentService.DeleteAsync(CurrentNeedDeleteRecord.Id); await TranscationResultHelper.CheckDatabaseResult(MessageBox, verifyRecordResult); dataGrid.RefreshGrid(); } #endregion #endregion } else if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdShowDetailOfMaster) { #region 點選 開啟多筆 CRUD 對話窗 按鈕 IsShowMoreDetailsRecord = true; ShowMoreDetailsRecordDialogTitle = MagicHelper.簽核流程政策明細; MasterRecord masterRecord = new MasterRecord() { Id = item.Id }; Header = masterRecord; if (ShowMoreDetailsGrid != null) { await Task.Delay(100); // 使用延遲,讓 Header 的資料綁定可以成功 ShowMoreDetailsGrid.RefreshGrid(); } #endregion } }
public Task OnCommandClicked(CommandClickEventArgs <TModel> args) { return(OnCommand.InvokeAsync(args)); }
private void TestHandler(object sender, CommandClickEventArgs e) { }
public async Task OnCommandClicked(CommandClickEventArgs <FlowMasterAdapterModel> args) { FlowMasterAdapterModel item = args.RowData as FlowMasterAdapterModel; if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdEdit) { #region 點選 修改紀錄 按鈕 CurrentRecord = item.Clone(); EditRecordDialogTitle = "修改紀錄"; IsShowEditRecord = true; IsNewRecordMode = false; #endregion } else if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdDelete) { #region 點選 刪除紀錄 按鈕 CurrentNeedDeleteRecord = item; #region 檢查關聯資料是否存在 var checkedResult = await CurrentService .BeforeDeleteCheckAsync(CurrentNeedDeleteRecord); await Task.Delay(100); thisView.NeedRefresh(); if (checkedResult.Success == false) { var checkTask1 = ConfirmMessageBox.ShowAsync("400px", "200px", "警告", $"你確定真的要刪除與這筆紀錄相關紀錄嗎?例如:收件匣、簽呈使用者、簽成歷史紀錄 ({checkedResult.Message})", ConfirmMessageBox.HiddenAsync); thisView.NeedRefresh(); var checkAgain1 = await checkTask1; if (checkAgain1 == true) { var verifyRecordResult = await CurrentService.DeleteAsync(CurrentNeedDeleteRecord.Id); await TranscationResultHelper.CheckDatabaseResult(MessageBox, verifyRecordResult); dataGrid.RefreshGrid(); } await Task.Yield(); thisView.NeedRefresh(); return; } #endregion #region 刪除這筆紀錄 await Task.Yield(); var checkTask = ConfirmMessageBox.ShowAsync("400px", "200px", "警告", "確認要刪除這筆紀錄嗎?", ConfirmMessageBox.HiddenAsync); thisView.NeedRefresh(); var checkAgain = await checkTask; if (checkAgain == true) { var verifyRecordResult = await CurrentService.DeleteAsync(CurrentNeedDeleteRecord.Id); await TranscationResultHelper.CheckDatabaseResult(MessageBox, verifyRecordResult); dataGrid.RefreshGrid(); } #endregion #endregion } else if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdShowFlowUser) { #region 點選 稽核使用者 對話窗 按鈕 IsShowFlowUserRecord = true; ShowMoreDetailsRecordDialogTitle = MagicHelper.簽核使用者明細; MasterRecord masterRecord = new MasterRecord() { Id = item.Id }; Header = masterRecord; if (ShowFlowUserGrid != null) { await Task.Delay(100); // 使用延遲,讓 Header 的資料綁定可以成功 ShowFlowUserGrid.RefreshGrid(); } #endregion } else if (args.CommandColumn.ButtonOption.IconCss == ButtonIdHelper.ButtonIdShowFlowHistory) { #region 點選 開啟多筆 CRUD 對話窗 按鈕 IsShowFlowHistoryRecord = true; ShowMoreDetailsRecordDialogTitle = MagicHelper.簽核歷史紀錄; MasterRecord masterRecord = new MasterRecord() { Id = item.Id }; Header = masterRecord; if (ShowFlowHistoryGrid != null) { await Task.Delay(100); // 使用延遲,讓 Header 的資料綁定可以成功 ShowFlowHistoryGrid.RefreshGrid(); } #endregion } }
private void chMain_CommandClick(object sender, CommandClickEventArgs e) { if (e.Command == c*K) { _scriptEditor0.SetCurrentScriptItem(null, Forms.ScriptEditorControl.SetCurrentScriptItemContext.CloseWindow); _scriptEditor1.SetCurrentScriptItem(null, Forms.ScriptEditorControl.SetCurrentScriptItemContext.CloseWindow); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } else if (e.Command == cCancel) { // todo - maybe show it anyway? _scriptEditor1.SetCurrentScriptItem(null, true); this.DialogResult = _scriptWritten ? DialogResult.OK : DialogResult.Cancel; this.Close(); } else if (e.Command == cSwitchWindow) { SetActiveScriptEditor(_activeScriptEditor == _scriptEditor1); _activeScriptEditor.TextBox.Focus(); } else if (e.Command == cHistBack) { _activeScriptEditor.HistoryGoBack(); } else if (e.Command == cHistForward) { _activeScriptEditor.HistoryGoForward(); } else if (e.Command == cUndo) { _activeScriptEditor.TextBox.Undo(); } else if (e.Command == cRedo) { _activeScriptEditor.TextBox.Redo(); } else if (e.Command == cCut) { _activeScriptEditor.TextBox.Cut(); } else if (e.Command == cCopy) { _activeScriptEditor.TextBox.Copy(); } else if (e.Command == cPaste || e.Command == cPasteAlt) // cPasteAlt is only to catch Shift+Ins in addition to Ctrl+V { // We do not want any formatting as it screws up syntax highlighting and generally can result in unreadable text: DataFormats.Format textFormat = DataFormats.GetFormat(DataFormats.Text); if (_activeScriptEditor.TextBox.CanPaste(textFormat)) { _activeScriptEditor.TextBox.Paste(textFormat); } } else if (e.Command == cDelete) { _activeScriptEditor.TextBox.SelectedText = string.Empty; } else if (e.Command == cSelectAll) { _activeScriptEditor.TextBox.SelectAll(); } else { if (e.Command.UserData == s_rbnInsertTextTag) { _insertTemplate(_activeScriptEditor, e.Command.Text); } } }
private void c1CommandHolder1_CommandClick(object sender, CommandClickEventArgs e) { //c1command click event label1.Text = e.Command.Text + " clicked"; }