private async Task HandleBtn3Click(MouseEventArgs _, ConfirmResult confirmResult) { Config.Button3Props.Loading = false; await InvokeAsync(StateHasChanged); await Close(); ConfirmRef.TaskCompletionSource?.SetResult(confirmResult); }
public ConfirmDialogViewModel() { Result = ConfirmResult.Cancel; YesCommand = new RelayCommand(() => Result = ConfirmResult.Yes); CancelCommand = new RelayCommand(() => Result = ConfirmResult.Cancel); SaveCommand = new RelayCommand(() => Result = ConfirmResult.Save); }
public ConfirmDialogViewModel() { Result = ConfirmResult.Cancel; YesCommand = new RelayCommand(() => Result = ConfirmResult.Yes); CancelCommand = new RelayCommand(() => Result = ConfirmResult.Cancel); SaveCommand = new RelayCommand(() => Result = ConfirmResult.Save); }
private async Task HandleBtn2Click(MouseEventArgs e, ConfirmResult confirmResult) { if (ConfirmRef.IsCreateByModalService) { await HandleCancel(e); } else { Config.Button2Props.Loading = false; await InvokeAsync(StateHasChanged); await Close(); ConfirmRef.TaskCompletionSource?.SetResult(confirmResult); } }
public void OnNext(ConfirmResult res) { switch (res.Status) { case ConfirmResult.ConfirmStatus.Error: SelectPanel(SelectedPanel.Confirm); ConfirmationUI.ShowError(res.ErrorMessage); break; case ConfirmResult.ConfirmStatus.Resent: SelectPanel(SelectedPanel.Confirm); ConfirmationUI.ShowError("New code sent"); break; case ConfirmResult.ConfirmStatus.Success: ConfirmationUI.Reset(""); SelectPanel(SelectedPanel.Login); LoginUI.Reset(res.Username); LoginUI.ShowError("User confirmed, please sign in"); break; } }
private void Yes() { _result = ConfirmResult.Yes; _windowService.CloseContainingWindow(this); }
private void btnAux_Click(object sender, RoutedEventArgs e) { MyResult = ConfirmResult.Auxiliary; Close(); }
private void btnNo_Click(object sender, System.Windows.RoutedEventArgs e) { MyResult = ConfirmResult.Negative; Close(); }
private void btnConfirm_Click(object sender, EventArgs e) { DataGridViewRow selectedRow = null; foreach (DataGridViewRow row in dgvMaster.Rows) { if (Convert.ToBoolean(row.Cells[0].Value)) { selectedRow = row; break; } } if (selectedRow != null) { if (selectedRow.Cells["STATENAME"].Value.ToString() == "执行中") { if (DialogResult.OK == MessageBox.Show("此操作将零烟柜未作业的单据确认", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) { ConfirmResult result = null; string masterid = dgvMaster.SelectedRows[0].Cells["BILLMASTERID"].Value.ToString(); DataTable BillDetailTable = billDal.GetBillDetailMasterId(masterid); for (int i = 0; i < BillDetailTable.Rows.Count; i++) { try { IData dataInterface = WesContext.GetData(); result = dataInterface.UploadData(new BillDao().GetBill(BillDetailTable.Rows[i]["BILLMASTERID"].ToString()).Rows[0]["BILLCODE"].ToString(), BillDetailTable.Rows[i]["BILLID"].ToString(), BillDetailTable.Rows[i]["DETAILID"].ToString(), BillDetailTable.Rows[i]["OPERATECODE"].ToString(), Convert.ToInt32(BillDetailTable.Rows[i]["PIECE"].ToString()), 0, ""); } catch (Exception ex) { MessageBox.Show("零烟柜整单确认失败! 原因:" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } if (result.IsSuccess) { taskDal.GetTaskTypeDeleteTask(masterid); taskDal.CancelRetailTask(masterid); if (new ConfigUtil().GetConfig("DeviceType")["Device"] != "0") { new SendUDP().Send(); } billDal.GetUpdateBillDetailFewColum(result.State, result.Desc, Environment.MachineName, masterid); if (DialogResult.OK == MessageBox.Show("零烟柜整单确认已经完成!")) { DataTable table = billDal.GetRetailMaster(); dgvMaster.DataSource = table; if (table.Rows.Count == 0) { dgvDetail.DataSource = null; } } } } } else { MessageBox.Show("单据状态不为‘未执行’,请重新选择单据。", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("请选择需要进行整单完成的单据。", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information); } }