private void btnOk_Click(object sender, EventArgs e) { try { btnOk.Enabled = false; var myView = this.gridView1; var selectedHandles = myView.GetSelectedRows().Where(x => x > -1).ToArray(); if (DXMessage.ShowYesNoAndWarning("确定将选择的交易记录关联到决策操作记录吗?") == System.Windows.Forms.DialogResult.Yes) { var recordIds = new List <int>(); for (var rowhandle = 0; rowhandle < selectedHandles.Length; rowhandle++) { recordIds.Add(int.Parse(myView.GetRowCellValue(selectedHandles[rowhandle], "RecordId").ToString())); } this._IDService.AddIDOperationRelatedRecords(ApplyNo, OperateNo, recordIds); DXMessage.ShowTips("交易记录关联操作成功!"); this.RefreshEvent?.Invoke(); this.Close(); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); btnOk.Enabled = true; } }
private void btnImport_Click(object sender, EventArgs e) { try { this.btnImport.Enabled = false; var source = this.gridControl2.DataSource as List <MIAccountPosition>; bool clearExisted = false; if (source != null && source.Any()) { if (DXMessage.ShowYesNoAndWarning("从交割单导入持仓将会清空现有的持仓信息。是否继续?") == System.Windows.Forms.DialogResult.No) { return; } else { clearExisted = true; } } _statementService.ImportPositionInfoFromDelivery(_currentAccountId, _currentYear, _currentMonth, clearExisted); BindAMIPosition(); } catch (Exception ex) { DXMessage.ShowError(ex.Message); } finally { this.btnImport.Enabled = true; } }
private void ExecuteComfirmProcess() { this._succeedFlag = false; if (this.chkNo.Checked) { DataTable dtRecords = this.gridControl1.DataSource as DataTable; if (dtRecords != null && dtRecords.Rows.Count > 0) { if (DXMessage.ShowYesNoAndWarning("该决策操作已经关联交易记录,继续处理将取消关联!") == System.Windows.Forms.DialogResult.No) { return; } } } var executeFlag = this.chkNo.Checked ? (int)EnumLibrary.IDOperationExecuteStatus.Unexecuted : (int)EnumLibrary.IDOperationExecuteStatus.Executed; var connString = System.Configuration.ConfigurationManager.ConnectionStrings["CTMContext"].ToString(); var commandText = $@"EXEC [dbo].[sp_IDOperationExecuteProcess] @ApplyNo = '{ApplyNo}',@OperateNo = '{OperateNo}' , @ExecuteFlag = {executeFlag}"; SqlHelper.ExecuteNonQuery(connString, CommandType.Text, commandText); DXMessage.ShowTips("执行状态更新成功!"); this._succeedFlag = true; }
/// <summary> /// 禁用账户 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDisable_Click(object sender, EventArgs e) { try { var myView = this.gridView1; var selectedHandles = myView.GetSelectedRows(); if (selectedHandles.Length == 0) { return; } selectedHandles = myView.GetSelectedRows().Where(x => x > -1).ToArray(); if (DXMessage.ShowYesNoAndWarning("确定禁用选择的账户吗?") == DialogResult.Yes) { var accountIds = new List <int>(); for (var rowhandle = 0; rowhandle < selectedHandles.Length; rowhandle++) { accountIds.Add(int.Parse(myView.GetRowCellValue(selectedHandles[rowhandle], colAccountId).ToString())); } this._accountService.DisableAccount(accountIds.ToArray()); RefreshForm(_industryId); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); } }
private void btnDelete_Click(object sender, EventArgs e) { try { var myView = this.gridView1; var selectedHandles = myView.GetSelectedRows(); if (selectedHandles.Length == 0) { return; } selectedHandles = myView.GetSelectedRows().Where(x => x > -1).ToArray(); if (DXMessage.ShowYesNoAndWarning("确定删除选择的申请单吗?") == DialogResult.Yes) { var serialNos = new List <string>(); for (var rowhandle = 0; rowhandle < selectedHandles.Length; rowhandle++) { serialNos.Add(myView.GetRowCellValue(selectedHandles[rowhandle], colSerialNo).ToString()); } this._IDService.DeleteInvestmentDecisionForm(serialNos.ToArray()); BindApplicationInfo(); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); } }
/// <summary> /// 删除交易记录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { try { this.btnDelete.Enabled = false; var myView = this.gridView1; var selectedHandles = myView.GetSelectedRows().Where(x => x > -1).ToArray(); if (DXMessage.ShowYesNoAndWarning("确定删除所选的交割单记录吗?") == DialogResult.Yes) { var recordIds = new List <int>(); for (var rowhandle = 0; rowhandle < selectedHandles.Length; rowhandle++) { recordIds.Add(int.Parse(myView.GetRowCellValue(selectedHandles[rowhandle], colRecordId).ToString())); } this._deliveryRecordService.DeleteDeliveryRecords(recordIds.ToArray()); myView.DeleteSelectedRows(); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); } finally { this.btnDelete.Enabled = true; } }
private void btnResetPwd_Click(object sender, EventArgs e) { try { this.btnResetPwd.Enabled = false; var myView = this.gridView1; var selectedHandles = myView.GetSelectedRows(); if (DXMessage.ShowYesNoAndWarning("确定重置选择的用户密码吗?") == DialogResult.Yes) { var userIds = new List <int>(); for (var rowhandle = 0; rowhandle < selectedHandles.Length; rowhandle++) { userIds.Add(int.Parse(myView.GetRowCellValue(selectedHandles[rowhandle], colId).ToString())); myView.UnselectRow(selectedHandles[rowhandle]); } this._userService.ResetPwd(userIds.ToArray()); DXMessage.ShowTips("密码重置成功!【新密码为用户编码】"); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); } }
private void riButtonEditOperate_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { e.Button.Enabled = false; var myView = this.gridView1; DataRow dr = myView.GetDataRow(myView.FocusedRowHandle); var serialNo = dr?[colSerialNo.FieldName]?.ToString(); if (string.IsNullOrEmpty(serialNo)) { return; } var buttonTag = e.Button.Tag.ToString().Trim(); if (string.IsNullOrEmpty(buttonTag)) { return; } if (buttonTag == "Delete") { if (DXMessage.ShowYesNoAndWarning("确定删除该记录所有投资人员的分析信息吗?") == DialogResult.Yes) { this._IDService.DeletePSAInfo(serialNo); BindPSAInfo(); } } else if (buttonTag == "Edit") { DisplayPSAEdit(dr); } else if (buttonTag == "View") { DisplayPSAResult(dr); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); } finally { e.Button.Enabled = true; } }
private void btnDelete_Click(object sender, EventArgs e) { try { this.btnDelete.Enabled = false; var myView = this.gvContent; var selectedHandles = myView.GetSelectedRows(); if (selectedHandles.Length == 0) { DXMessage.ShowTips("请选择要删除的行!"); return; } if (DXMessage.ShowYesNoAndWarning("确定删除选择的行吗?") == DialogResult.Yes) { var contentIds = new List <int>(); for (var rowhandle = 0; rowhandle < selectedHandles.Length; rowhandle++) { contentIds.Add(int.Parse(myView.GetRowCellValue(selectedHandles[rowhandle], colId).ToString())); } this._IDService.DeleteIDReasonContent(contentIds.ToArray()); var focusedNode = this.tlCategory.FocusedNode; var categoryId = Convert.ToInt32(focusedNode.GetValue(tcId)); RefreshForm(categoryId); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); } finally { this.btnDelete.Enabled = true; } }
private void btnDelete_Click(object sender, EventArgs e) { try { this.btnDelete.Enabled = false; var myView = this.gridView1; var selectedHandles = myView.GetSelectedRows(); if (selectedHandles.Length == 0) { return; } selectedHandles = myView.GetSelectedRows().Where(x => x > -1).ToArray(); if (DXMessage.ShowYesNoAndWarning("确定删除所选的信息么?") == System.Windows.Forms.DialogResult.Yes) { var ids = new List <int>(); foreach (var rowhandle in selectedHandles) { ids.Add(int.Parse(myView.GetRowCellValue(selectedHandles[rowhandle], colId).ToString())); } this._marginService.DeleteMarginTradingInfo(ids); BindTodayMarginInfo(); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); } finally { this.btnDelete.Enabled = true; } }
private void btnRemove_Click(object sender, EventArgs e) { try { this.btnRemove.Enabled = false; var myView = this.gridView1; var selectedHandles = myView.GetSelectedRows(); if (selectedHandles.Length == 0) { return; } selectedHandles = myView.GetSelectedRows().Where(x => x > -1).ToArray(); if (DXMessage.ShowYesNoAndWarning("确定删除选择的成员吗?") == DialogResult.Yes) { var ids = new List <int>(); for (var rowhandle = 0; rowhandle < selectedHandles.Length; rowhandle++) { ids.Add(int.Parse(myView.GetRowCellValue(selectedHandles[rowhandle], colId).ToString())); } this._IDService.DeleteIDCommittee(ids.ToArray()); RefreshForm(); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); this.btnRemove.Enabled = true; } }
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { e.Button.Enabled = false; var myView = this.gridView2; if (myView.FocusedRowHandle < 0) { return; } var buttonTag = e.Button.Tag.ToString().Trim(); if (!string.IsNullOrEmpty(buttonTag) && buttonTag == "Delete") { if (DXMessage.ShowYesNoAndWarning("确定删除该股票持仓信息吗?") == System.Windows.Forms.DialogResult.Yes) { var positionId = Convert.ToInt32(myView.GetRowCellValue(myView.FocusedRowHandle, colPositionId)); this._statementService.DeleteMIAccountPosition(new int[] { positionId }); BindAMIPosition(); } } } catch (Exception ex) { DXMessage.ShowError(ex.Message); } finally { e.Button.Enabled = true; } }
private void btnDelete_Click(object sender, EventArgs e) { try { this.btnDelete.Enabled = false; var selectedHandles = this.bandedGridView1.GetSelectedRows(); if (selectedHandles.Any()) { selectedHandles = selectedHandles.Where(x => x > -1).ToArray(); } if (DXMessage.ShowYesNoAndWarning("确定删除选择的分析记录吗?") == System.Windows.Forms.DialogResult.Yes) { var ids = new List <int>(); for (var rowhandle = 0; rowhandle < selectedHandles.Length; rowhandle++) { ids.Add(int.Parse(this.bandedGridView1.GetRowCellValue(selectedHandles[rowhandle], colId).ToString())); } _IDService.DeleteInvestmentPlanRecord(ids); BindIPR(); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); } finally { this.btnDelete.Enabled = true; } }
private void btnEnable_Click(object sender, EventArgs e) { try { this.btnEnable.Enabled = false; var myView = this.gridView1; var selectedHandles = myView.GetSelectedRows(); if (selectedHandles.Any()) { selectedHandles = selectedHandles.Where(x => x > -1).ToArray(); } if (DXMessage.ShowYesNoAndWarning("确定启用选择的用户吗?") == DialogResult.Yes) { var userIds = new List <int>(); for (var rowhandle = 0; rowhandle < selectedHandles.Length; rowhandle++) { userIds.Add(int.Parse(myView.GetRowCellValue(selectedHandles[rowhandle], colId).ToString())); myView.UnselectRow(selectedHandles[rowhandle]); } this._userService.EnableUser(userIds.ToArray()); RefreshForm(this._departmentId); } } catch (Exception ex) { DXMessage.ShowError(ex.Message); } }