void ucDataGridView1_ItemClick(object sender, DataGridViewEventArgs e) { if (ItemClick != null) { ItemClick((sender as IDataGridViewRow).DataSource, null); } }
private void dgv_Cards_ItemClick(object sender, DataGridViewEventArgs e) { if (dgv_Cards.SelectRow == null || dgv_Cards.SelectRow.DataSource == null) { _currentCard = null; return; } var card = dgv_Cards.SelectRow.DataSource as Card; if (card == null) { _currentCard = null; return; } _currentCard = card; if (_currentCard.CardType == CardType.储值卡) { tsm_AddMoney.Visible = true; tsm_RemovePoints.Visible = false; tsm_PointsExChange.Visible = false; tsm_ChangeToMoney.Visible = false; tsm_ChangeToPoint.Visible = true; } else { tsm_AddMoney.Visible = false; tsm_RemovePoints.Visible = true; tsm_PointsExChange.Visible = true; tsm_ChangeToMoney.Visible = true; tsm_ChangeToPoint.Visible = false; } contextMenuStrip.Show(MousePosition); }
/// <summary> /// Rows the source changed. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param> void RowSourceChanged(object sender, DataGridViewEventArgs e) { if (SourceChanged != null) { SourceChanged(sender, e); } }
/// <summary> /// Sets the select row. /// </summary> /// <param name="item">The item.</param> /// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param> private void SetSelectRow(Control item, DataGridViewEventArgs e) { try { if (item == null) { return; } if (item.Visible == false) { return; } this.FindForm().ActiveControl = this; this.FindForm().ActiveControl = item; if (m_selectRow != item) { if (m_selectRow != null) { m_selectRow.SetSelect(false); } m_selectRow = item as IDataGridViewRow; m_selectRow.SetSelect(true); if (this.panRow.Controls.Count > 0) { if (item.Location.Y < 0) { this.panRow.AutoScrollPosition = new Point(0, Math.Abs(this.panRow.Controls[this.panRow.Controls.Count - 1].Location.Y) + item.Location.Y); } else if (item.Location.Y + m_rowHeight > this.panRow.Height) { this.panRow.AutoScrollPosition = new Point(0, Math.Abs(this.panRow.AutoScrollPosition.Y) + item.Location.Y - this.panRow.Height + m_rowHeight); } } } if (ItemClick != null) { ItemClick(item, e); } } catch (Exception ex) { } }
private void UcDataGridView2_ItemClick(object sender, DataGridViewEventArgs e) { ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor = Color.LightSlateGray; ProductionStatusInfoPanel.Controls.Find("control002", false).First().BackColor = Color.LightSlateGray; ProductionStatusInfoPanel.Controls.Find("control003", false).First().BackColor = Color.LightSlateGray; var controls = panel10.Controls.Find("scanOnlineForm", false); if (controls.Any()) { controls[0].Dispose(); } if (!HasExitProductTask()) { ProductNameTxt.Clear(); ProductIDTxt.Clear(); CurrentProcessTxt.Clear(); QCTimeTxt.Clear(); var dataGridViewRow = ucDataGridView2.SelectRow; var dataSource = dataGridViewRow.DataSource; if (dataSource is C_CheckTask checktask) { var dialogResult = FrmDialog.ShowDialog(this, $"确定上线选中产品[{checktask.ProductBornCode}]吗", "手检上线", true); if (dialogResult == DialogResult.OK) { if (!DoneAllThreeCoordinate(checktask.ProductBornCode)) { FrmDialog.ShowDialog(this, "该产品尚有三坐标质检任务未完成,请先完成!"); return; } var scanOnlineForm = new ScanOnlineForm(_staffId, _staffCode, _staffName, checktask.ProductBornCode, _workshopId, _workshopCode, _workshopName, _equipmentId, _equipmentCode, _equipmentName) { DisplayInfoToMainPanel = (s1, s2, s3, s4) => { ProductIDTxt.Text = s1; ProductNameTxt.Text = s2; CurrentProcessTxt.Text = s3; QCTimeTxt.Text = s4; }, ChangeBgColor = () => { ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor = Color.MediumSeaGreen; ProductionStatusInfoPanel.Controls.Find("control002", false).First().BackColor = Color.LightSlateGray; ProductionStatusInfoPanel.Controls.Find("control003", false).First().BackColor = Color.LightSlateGray; } }; if (scanOnlineForm.CheckTaskValidity(checktask.ProcedureCode)) { scanOnlineForm.AddCntLogicPro(checktask.ProcedureCode); { //操作人员确认 if (scanOnlineForm.WorkerConfirm()) { //转档 检验任务表=>检验过程表 scanOnlineForm.CheckProcessTurnArchives(); //完善检验任务表 诸如任务状态 ; 修改人修改时间 scanOnlineForm.PerfectCheckTask(); //控制点转档 scanOnlineForm.CntLogicTurn(); InialToDoTasks(); } } } } } } else { ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor = Color.MediumSeaGreen; ReportUploadJudge(); } }
void m_ucPanel_ItemClick(object sender, DataGridViewEventArgs e) { _frmAnchor.Hide(); SelectSource = sender; }
private void UcDataGridView2_ItemClick(object sender, DataGridViewEventArgs e) { ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor = Color.LightSlateGray; ProductionStatusInfoPanel.Controls.Find("control002", false).First().BackColor = Color.LightSlateGray; var controls = panel10.Controls.Find("scanOnlineForm", false); if (controls.Any()) { controls[0].Dispose(); } if (!HasExitProductTask()) { ProductNameTxt.Clear(); ProductIDTxt.Clear(); CurrentProcessTxt.Clear(); OnlineTimeTxt.Clear(); var dataGridViewRow = ucDataGridView2.SelectRow; var dataSource = dataGridViewRow.DataSource; if (dataSource is APS_ProcedureTaskDetail apsProcedureTaskDetail) { var dialogResult = FrmDialog.ShowDialog(this, $"确定上线选中产品[{apsProcedureTaskDetail.ProductBornCode}]吗", "热压上线", true); if (dialogResult == DialogResult.OK) { var scanOnlineForm = new ScanOnlineForm(_staffId, _staffCode, _staffName, apsProcedureTaskDetail.ProductBornCode, _workshopId, _workshopCode, _workshopName, _equipmentId, _equipmentCode, _equipmentName) { DisplayInfoToMainPanel = (s1, s2, s3, s4) => { ProductIDTxt.Text = s1; ProductNameTxt.Text = s2; CurrentProcessTxt.Text = s3; OnlineTimeTxt.Text = s4; }, ChangeBgColor = () => { ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor = Color.MediumSeaGreen; ProductionStatusInfoPanel.Controls.Find("control002", false).First().BackColor = Color.LightSlateGray; } }; if (scanOnlineForm.CheckTaskValidity(apsProcedureTaskDetail.ProcedureCode)) { //判断机加工任务是否全部完成 var doneMachiningOrNot = DoneMachiningOrNot(apsProcedureTaskDetail); if (!doneMachiningOrNot) { FrmDialog.ShowDialog(this, "尚有机加工环节未执行,请先执行机加工任务!"); return; } scanOnlineForm.AddCntLogicPro(); //先判断一下本产品出生证的有没有待检验的前序质检任务没做 // var hasSelfQcTask = scanOnlineForm.HasSelfQcTask(); //转档 工序任务明细表=>产品加工过程表 scanOnlineForm.ProcessTurnArchives(); //完善工序任务明细表中的数据 诸如任务状态 ; 修改人修改时间 scanOnlineForm.PerfectApsDetail(); //完善计划产品出生证表 // scanOnlineForm.PerfectPlanProductInfo(); //转档 scanOnlineForm.CntLogicTurn(); FrmDialog.ShowDialog(this, $"产品{ProductIDTxt.Text}热压上线成功!", "热压上线成功"); InialToDoTasks(); } } } } else { ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor = Color.MediumSeaGreen; } }