/// <summary> /// 详细信息 /// </summary> private void btnOperate_Click(object sender, EventArgs e) { if (dgvData.SelectedRows.Count > 0) { DataGridViewRow row = dgvData.SelectedRows[0]; string slipNumber = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value); FrmBase frm = new FrmOrdersEntry(slipNumber); frm.CTag = CConstant.ORDER_SEARCH; 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); // } //} #endregion #region 生成销售订单 private void btnOrder_Click(object sender, EventArgs e) { DataGridViewRow row = dgvData.CurrentRow; string slipNumber = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value); if (!string.IsNullOrEmpty(slipNumber)) { FrmOrdersEntry frm = new FrmOrdersEntry(slipNumber); frm.CTag = CConstant.ORDER_QOUTATION; frm.UserTable = _userInfo; if (DialogResult.OK == frm.ShowDialog()) { BindData(this.pgControl.GetCurrentPage()); } frm.Dispose(); } else { MessageBox.Show("请先选择一张订单。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// 执行操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOperate_Click(object sender, EventArgs e) { if (dgvData.SelectedRows.Count > 0) { DataGridViewRow row = dgvData.SelectedRows[0]; string slipNumber = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value); string companyCode = CConvert.ToString(row.Cells["COMPANY_CODE"].Value); decimal amountIncludedTax = CConvert.ToDecimal(row.Cells["AMOUNT_INCLUDED_TAX"].Value); DateTime slipDate = CConvert.ToDateTime(row.Cells["SLIP_DATE"].Value); //在库引当 if (CConstant.ORDER_ALLOATION.Equals(CTag) && companyCode.Equals(_userInfo.COMPANY_CODE)) { FrmBase frm = new FrmAlloation(slipNumber); frm.UserTable = _userInfo; if (frm.ShowDialog(this) == DialogResult.OK) { BindData(this.pgControl.GetCurrentPage()); } frm.Dispose(); } //修理输入 else if (CConstant.ORDER_SERVICE.Equals(CTag) && companyCode.Equals(_userInfo.COMPANY_CODE)) { FrmBase frm = new FrmOrderService(slipNumber); frm.UserTable = _userInfo; if (frm.ShowDialog(this) == DialogResult.OK) { BindData(this.pgControl.GetCurrentPage()); } frm.Dispose(); } else { FrmBase frm = new FrmOrdersEntry(slipNumber); frm.CTag = CTag; frm.UserTable = _userInfo; //详细信息 if (CConstant.ORDER_SEARCH.Equals(CTag)) { if (DialogResult.OK == frm.ShowDialog()) { } frm.Dispose(); } //订单修正 else if (CConstant.ORDER_MODIFY.Equals(CTag) && companyCode.Equals(_userInfo.COMPANY_CODE)) { //承认后不能修改 //if (CConstant.VERIFY.Equals(CConvert.ToInt32(row.Cells["VERIFY_FLAG"].Value))) //{ // MessageBox.Show("订单己经承认,不能修改。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); //} if (CConstant.COMPLETE_SHIPMENT.Equals(CConvert.ToInt32(row.Cells["SHIPMENT_FLAG"].Value))) { MessageBox.Show("订单己经出库完了,不能修正。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (CConstant.PART_SHIPMENT.Equals(CConvert.ToInt32(row.Cells["SHIPMENT_FLAG"].Value))) { MessageBox.Show("订单己经有出库,不能修正。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (DialogResult.OK == frm.ShowDialog()) { BindData(this.pgControl.GetCurrentPage()); } frm.Dispose(); } } //订单承认 else if (CConstant.ORDER_VERIFY.Equals(CTag) && companyCode.Equals(_userInfo.COMPANY_CODE)) { if (CConstant.COMPLETE_SHIPMENT.Equals(CConvert.ToInt32(row.Cells["SHIPMENT_FLAG"].Value))) { MessageBox.Show("订单己经出库完了,不能修改承认状态。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (CConstant.PART_SHIPMENT.Equals(CConvert.ToInt32(row.Cells["SHIPMENT_FLAG"].Value))) { MessageBox.Show("订单己经有出库,不能修改承认状态。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (DialogResult.OK == frm.ShowDialog()) { BindData(this.pgControl.GetCurrentPage()); } frm.Dispose(); } //复制订单 else if (CConstant.ORDER_COPY.Equals(CTag)) { if (DialogResult.OK == frm.ShowDialog()) { BindData(this.pgControl.GetCurrentPage()); } frm.Dispose(); } //详细信息 else if (CConstant.ORDER_MASTER_SEARCH.Equals(CTag)) { orderTable.SLIP_NUMBER = slipNumber; orderTable.AMOUNT_INCLUDED_TAX = amountIncludedTax; orderTable.SLIP_DATE = slipDate; this.DialogResult = DialogResult.OK; frm.Dispose(); } } } else { MessageBox.Show("请先选择一张订单。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } }