private void btnDetails_Click(object sender, EventArgs e) { if (CConstant.ORDER_MASTER_SEARCH.Equals(CTag)) { slipNumber = dgvData.SelectedRows[0].Cells["SLIP_NUMBER"].Value.ToString(); if (slipNumber != null) { resule = DialogResult.OK; this.Close(); } else { MessageBox.Show("请选择正确的行!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { if (dgvData.Rows.Count > 0) { DataGridViewRow row = dgvData.CurrentRow; string slipNumber = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value); if (!string.IsNullOrEmpty(slipNumber)) { FrmBase frm = new FrmProductionPlan(slipNumber); frm.CTag = CConstant.PRODUCTIONPLAN_OPERATE; frm.UserTable = _userInfo; if (DialogResult.OK == frm.ShowDialog()) { } frm.Dispose(); } else { MessageBox.Show("请先选择一条生产计划。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("请先选择一条生产计划。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void btnEdite_Click(object sender, EventArgs e) { if (dgvData.Rows.Count > 0) { DataGridViewRow row = dgvData.CurrentRow; string slipNumber = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value); // if (row.Cells["STATUS_FLAG"].Value.ToString() != "0") if (row.Cells["STATUS_FLAG"].Value.ToString().Equals("2")) { MessageBox.Show("请先选择一条未开始的生产计划数据。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (row.Cells["STATUS_FLAG"].Value.ToString().Equals("5")) { MessageBox.Show("请先选择一条未暂停的生产计划数据。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (!string.IsNullOrEmpty(slipNumber)) { FrmBase frm = new FrmProductionPlan(slipNumber); frm.CTag = CConstant.PRODUCTIONPLAN_MODIFY; frm.UserTable = _userInfo; if (DialogResult.OK == frm.ShowDialog()) { } frm.Dispose(); } else { MessageBox.Show("请先选择一条生产计划数据。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("没有生产计划数据。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } }