private void DBGrid_DoubleClick(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid.CurrentRow == null) { return; } modWarehouseInoutForm mod = (modWarehouseInoutForm)DBGrid.CurrentRow.DataBoundItem; EditWarehouseInout frm = new EditWarehouseInout(); frm.EditItem(mod.Id); if (frm.ShowDialog() == DialogResult.OK) { LoadData(); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void toolNew_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; EditWarehouseInout frm = new EditWarehouseInout(); frm.AddItem(Util.retValue1); if (frm.ShowDialog() == DialogResult.OK) { rbStatus0.Checked = true; LoadData(); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void DBGrid_DoubleClick(object sender, EventArgs e) { if (DBGrid.CurrentRow == null) { return; } if (_selection) { Util.retValue1 = DBGrid.CurrentRow.Cells[0].Value.ToString(); if (DBGrid.ColumnCount >= 2) { Util.retValue2 = DBGrid.CurrentRow.Cells[1].Value.ToString(); } if (DBGrid.ColumnCount >= 3) { Util.retValue3 = DBGrid.CurrentRow.Cells[2].Value.ToString(); } if (DBGrid.ColumnCount >= 4) { Util.retValue4 = DBGrid.CurrentRow.Cells[3].Value.ToString(); } if (DBGrid.ColumnCount >= 5) { Util.retValue5 = DBGrid.CurrentRow.Cells[4].Value.ToString(); } this.DialogResult = DialogResult.OK; this.Dispose(); } else { if (DBGrid.ColumnCount > 0) { bool formtype = false, formid = false; for (int i = 0; i < DBGrid.ColumnCount; i++) { if (DBGrid.Columns[i].Name.ToLower().CompareTo("formtype") == 0) { formtype = true; } if (DBGrid.Columns[i].Name.ToLower().CompareTo("formid") == 0) { formid = true; } } if (formtype && formid) { switch (DBGrid.CurrentRow.Cells["formtype"].Value.ToString()) { case "送货单": case "收营单": case "退货单": EditSalesShipment frmss = new EditSalesShipment(); frmss.EditItem(DBGrid.CurrentRow.Cells["formid"].Value.ToString()); frmss.ShowDialog(); break; case "采购收货": case "采购退货": EditPurchaseList frmpur = new EditPurchaseList(); frmpur.EditItem(DBGrid.CurrentRow.Cells["formid"].Value.ToString()); frmpur.ShowDialog(); break; case "生产领料出库": case "损耗出库": case "借入物出库": case "借出物出库": case "生产商品入库": case "溢余入库": case "借入物入库": case "借出物入库": EditWarehouseInout frmio = new EditWarehouseInout(); frmio.EditItem(Convert.ToInt32(DBGrid.CurrentRow.Cells["formid"].Value)); frmio.ShowDialog(); break; } } } } }