private void pnlChart_MouseClick(object sender, MouseEventArgs e) { int i = e.Y < top[1] ? 0 : 1; int shelf = currentPage * 2 + i - 1; int column = columns - (e.X - left) / cellWidth; int row = rows - (e.Y - top[i]) / cellHeight + 1; if (column <= columns && row <= rows) { DataRow[] cellRows = cellTable.Select(string.Format("ShelfCode='{0}' AND CellColumn='{1}' AND CellRow='{2}'", ShelfCode[shelf], column, row)); if (cellRows.Length != 0) { CellCode = cellRows[0]["CellCode"].ToString(); } if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (cellRows.Length != 0) { Dictionary <string, Dictionary <string, object> > properties = new Dictionary <string, Dictionary <string, object> >(); Dictionary <string, object> property = new Dictionary <string, object>(); property.Add("货架编号", ShelfCode[shelf]); property.Add("列", column); property.Add("层", row); property.Add("托盘编号", cellRows[0]["PalletCode"]); property.Add("任务号", cellRows[0]["TaskID"]); property.Add("入库时间", cellRows[0]["InDate"]); string strState = "正常"; if (cellRows[0]["ErrorFlag"].ToString() == "1") { strState = "异常(" + cellRows[0]["MEMO"].ToString() + ")"; } ; property.Add("状态", strState); properties.Add("货位信息", property); if (cellRows[0]["PalletCode"].ToString().Length > 0) { frmCellDialog cellDialog = new frmCellDialog(properties); cellDialog.ShowDialog(); } } } else if (e.Button == System.Windows.Forms.MouseButtons.Right) { contextMenuStrip1.Show(MousePosition.X, MousePosition.Y); } } }
private void pnlChart_MouseClick(object sender, MouseEventArgs e) { int i = e.Y < top[1] ? 0 : 1; int shelf = currentPage * 2 + i - 1; int column = (e.X - left) / cellWidth + 1; int row = rows - (e.Y - top[i]) / cellHeight + 1; if (column <= columns && row <= rows) { DataRow[] cellRows = cellTable.Select(string.Format("ShelfCode='{0}' AND CellColumn='{1}' AND CellRow='{2}'", ShelfCode[shelf], column, row)); if (cellRows.Length != 0) { CellCode = cellRows[0]["CellCode"].ToString(); } if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (cellRows.Length != 0) { Dictionary <string, Dictionary <string, object> > properties = new Dictionary <string, Dictionary <string, object> >(); Dictionary <string, object> property = new Dictionary <string, object>(); property.Add("产品编号", cellRows[0]["ProductCode"]); property.Add("产品名称", cellRows[0]["ProductName"]); property.Add("入库类型", cellRows[0]["BillTypeName"]); property.Add("产品规格", cellRows[0]["Spec"]); property.Add("条码", cellRows[0]["Barcode"]); property.Add("重量", cellRows[0]["Weight"]); //property.Add("托盘", cellRows[0]["PalletCode"]); property.Add("单据号", cellRows[0]["BillNo"]); property.Add("入库时间", cellRows[0]["InDate"]); properties.Add("产品信息", property); property = new Dictionary <string, object>(); property.Add("库区名称", cellRows[0]["AreaName"]); property.Add("货架名称", cellRows[0]["ShelfName"]); property.Add("列", column); property.Add("层", row); string strState = "正常"; if (cellRows[0]["IsLock"].ToString() == "0") { strState = "正常"; } else { strState = "锁定"; } if (cellRows[0]["ErrorFlag"].ToString() == "1") { strState = "异常"; } if (cellRows[0]["IsActive"].ToString() == "0") { strState = "禁用"; } property.Add("状态", strState); properties.Add("货位信息", property); if (cellRows[0]["ProductCode"].ToString().Length > 0) { frmCellDialog cellDialog = new frmCellDialog(properties); cellDialog.ShowDialog(); } } } else if (e.Button == System.Windows.Forms.MouseButtons.Right) { contextMenuStrip1.Show(MousePosition.X, MousePosition.Y); } } }
private void pnlChart_MouseClick(object sender, MouseEventArgs e) { int i = e.Y < top[1] ? 0 : 1; int shelf = currentPage * 2 + i - 1; int column = (e.X - left) / cellWidth +1; int row = rows - (e.Y - top[i]) / cellHeight + 1; if (column <= columns && row <= rows) { DataRow[] cellRows = cellTable.Select(string.Format("ShelfCode='{0}' AND CellColumn='{1}' AND CellRow='{2}'", ShelfCode[shelf], column, row)); if (cellRows.Length != 0) CellCode = cellRows[0]["CellCode"].ToString(); if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (cellRows.Length != 0) { Dictionary<string, Dictionary<string, object>> properties = new Dictionary<string, Dictionary<string, object>>(); Dictionary<string, object> property = new Dictionary<string, object>(); property.Add("产品编号", cellRows[0]["ProductCode"]); property.Add("产品名称", cellRows[0]["ProductName"]); property.Add("入库类型", cellRows[0]["BillTypeName"]); property.Add("产品规格", cellRows[0]["Spec"]); property.Add("条码", cellRows[0]["Barcode"]); property.Add("重量", cellRows[0]["Weight"]); //property.Add("托盘", cellRows[0]["PalletCode"]); property.Add("单据号", cellRows[0]["BillNo"]); property.Add("入库时间", cellRows[0]["InDate"]); properties.Add("产品信息", property); property = new Dictionary<string, object>(); property.Add("库区名称", cellRows[0]["AreaName"]); property.Add("货架名称", cellRows[0]["ShelfName"]); property.Add("列", column); property.Add("层", row); string strState = "正常"; if (cellRows[0]["IsLock"].ToString() == "0") strState = "正常"; else strState = "锁定"; if (cellRows[0]["ErrorFlag"].ToString() == "1") strState = "异常"; if (cellRows[0]["IsActive"].ToString() == "0") strState = "禁用"; property.Add("状态", strState); properties.Add("货位信息", property); if (cellRows[0]["ProductCode"].ToString().Length > 0) { frmCellDialog cellDialog = new frmCellDialog(properties); cellDialog.ShowDialog(); } } } else if (e.Button == System.Windows.Forms.MouseButtons.Right) { contextMenuStrip1.Show(MousePosition.X, MousePosition.Y); } } }