private void ToolStripMenuItem1_Click(object sender, EventArgs e) { DataRow[] drs = cellTable.Select(string.Format("CellCode='{0}'", CellCode)); if (drs.Length > 0) { DataRow dr = drs[0]; frmCellOpDialog cellDialog = new frmCellOpDialog(dr); cellDialog.ShowDialog(); } }
private void ToolStripMenuItem1_Click(object sender, EventArgs e) { DataRow[] drs = cellTable.Select(string.Format("CellCode='{0}'", CellCode)); if (drs.Length > 0) { DataRow dr = drs[0]; frmCellOpDialog cellDialog = new frmCellOpDialog(dr); if (cellDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { cellTable = bll.FillDataTable("WCS.SelectCell"); bsMain.DataSource = cellTable; pnlChart.Invalidate(); } } }
private void pnlChart_MouseClick(object sender, MouseEventArgs e) { int Shelfleft = (int)adjustWidth + 6 * cellWidth + 200; int i = e.X < Shelfleft ? 0 : 1; string ShelfCode = "001001"; int column = (int)Math.Ceiling((e.X - left - adjustWidth) / cellWidth); if (i == 1) { column = (int)Math.Ceiling((e.X - left - adjustWidth - Shelfleft) / cellWidth); ShelfCode = "001002"; } int row = 6 - (int)Math.Ceiling((double)(e.Y - top) / cellHeight); if (column <= 6 && row <= 5 && row > 0 && column > 0) { string filter = string.Format("ShelfCode='{0}' AND CellColumn='{1}' AND CellRow='{2}'", ShelfCode, column, row); DataRow[] cellRows = cellTable.Select(filter); if (cellRows.Length != 0) { CellCode = cellRows[0]["CellCode"].ToString(); //if (e.Button == System.Windows.Forms.MouseButtons.Left) //{ // if (cellRows.Length != 0) // { // if (cellRows[0]["PalletBarCode"].ToString() != "") // { // frmCellInfo f = new frmCellInfo(cellRows[0]["PalletBarCode"].ToString(), CellCode); // f.ShowDialog(); // } // } //} if (e.Button == System.Windows.Forms.MouseButtons.Right) { DataTable dt = Program.dtUserPermission; string strPermission = "SubModuleCode='MNU_M00C_00D' and OperatorCode='2'"; DataRow[] drs = dt.Select(strPermission); if (drs.Length <= 0) { return; } drs = cellTable.Select(string.Format("CellCode='{0}'", CellCode)); if (drs.Length > 0) { DataRow dr = drs[0]; frmCellOpDialog cellDialog = new frmCellOpDialog(dr); if (cellDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { cellTable = bll.FillDataTable("WCS.SelectCell"); bsMain.DataSource = cellTable; pnlChart.Invalidate(); } } } } } }