private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { DataGridViewRow row = dgvData.Rows[e.RowIndex]; if (e.ColumnIndex == dgvData.Columns["ATTACHED_NAME"].Index) { if (CConvert.ToInt32(row.Cells["ATTACHED_FLAG"].Value) > 0) { string attachedDirectory = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_ORDER); string slipNumber = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value); FrmAttached frm = new FrmAttached(slipNumber, attachedDirectory, true); frm.ShowDialog(this); frm.Dispose(); } } else if (e.ColumnIndex == dgvData.Columns["UPDATED_COUNT"].Index) { if (CConvert.ToInt32(row.Cells["UPDATED_COUNT"].Value) > 0) { FrmHistoryOrderList frm = new FrmHistoryOrderList(CConvert.ToString(row.Cells["SLIP_NUMBER"].Value)); if (DialogResult.OK == frm.ShowDialog(this)) { FrmBase frmOrder = new FrmOrdersEntry(frm.historySlipNumber); frmOrder.CTag = CConstant.ORDER_HISTORY; frmOrder.UserTable = _userInfo; frmOrder.ShowDialog(); } } } } }
private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { DataGridViewRow row = dgvData.Rows[e.RowIndex]; if (e.ColumnIndex == dgvData.Columns["ATTACHED_NAME"].Index) { //if (CConvert.ToInt32(row.Cells["ATTACHED_FLAG"].Value) > 0) //{ // string attachedDirectory = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_ORDER); // string slipNumber = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value); // FrmAttached frm = new FrmAttached(slipNumber, attachedDirectory, true); // frm.ShowDialog(this); // frm.Dispose(); //} if (CConvert.ToString(row.Cells["SLIP_NUMBER"].Value) != "") { Czzd.Common.Library.FTPOperate myftp = new Czzd.Common.Library.FTPOperate("112.82.245.2", "YS_ERP\\order\\" + row.Cells["SLIP_NUMBER"].Value, "FTP_user", "czzd", 21); string[] files = myftp.Dir("\\YS_ERP\\order\\" + row.Cells["SLIP_NUMBER"].Value); // 附件 if (files.Length > 1) { string attachedDirectory = CCacheData.GetAttacheDirectory(CConstant.ATTACHE_DIRECTORY_ORDER); string slipNumber = CConvert.ToString(row.Cells["SLIP_NUMBER"].Value); FrmAttached frm = new FrmAttached(slipNumber, attachedDirectory, true); frm.CTag = CConstant.ORDER_MODIFY; frm.ShowDialog(this); frm.Dispose(); } } } else if (e.ColumnIndex == dgvData.Columns["UPDATED_COUNT"].Index) { if (CConvert.ToInt32(row.Cells["UPDATED_COUNT"].Value) > 0) { FrmHistoryOrderList frm = new FrmHistoryOrderList(CConvert.ToString(row.Cells["SLIP_NUMBER"].Value)); if (DialogResult.OK == frm.ShowDialog(this)) { FrmBase frmOrder = new FrmOrdersEntry(frm.historySlipNumber); frmOrder.CTag = CConstant.ORDER_HISTORY; frmOrder.UserTable = _userInfo; frmOrder.ShowDialog(); } } } else if (e.ColumnIndex == dgvData.Columns["CHECK"].Index) { if (Convert.ToBoolean(dgvData.Rows[e.RowIndex].Cells["CHECK"].Value)) { dgvData.Rows[e.RowIndex].Cells["CHECK"].Value = false; } else { dgvData.Rows[e.RowIndex].Cells["CHECK"].Value = true; } } } }
/// <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); } }