Ejemplo n.º 1
0
        private void pnlChart_MouseClick(object sender, MouseEventArgs e)
        {
            int i = 0;
            for (int j = 0; j < top.Length; j++)
            {
                if (e.Y > top[top.Length-1])
                {
                    i = 7; break;
                }
                if (e.Y < top[j + 1])
                {
                    i = j;
                    break;
                }
            }
            int shelf = 0;
            if (currentPage == 1)
                shelf = i + 1;
            else if (currentPage == 2)
                shelf = i + top.Length+1;
            int column = (e.X - left) / cellWidth + 1;
            if (column == 19)
                return;
            if (column >= 20)
                column = column - 1;
            int row = (e.Y - (top[i]) +7) / cellHeight;

            string keys = "";
            if (shelf < 10)
            {
                keys = "0" + shelf.ToString();
            }
            else
            {
                keys = shelf.ToString();
            }
            if (column <= columns+1 && row <= rows)
            {
                DataRow[] cellRows = cellTable.Select(string.Format("Shelf={0} AND ColNum='{1}' AND RowNum='{2}'", keys, column, row));
                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]["QuantityJian"] + "����");
                    property.Add("��������", cellRows[0]["QuantityTiao"] + "����");
                    //property.Add("���ʱ��", cellRows[0]["INDATE"]);
                    properties.Add("��Ʒ��Ϣ", property);

                    property = new Dictionary<string, object>();
                    property.Add("�ֿ����", cellRows[0]["WareCode"]);
                    property.Add("�ֿ�����", cellRows[0]["WareName"]);
                    property.Add("��������", "��" + cellRows[0]["ShelfName"] + "�Ż���");
                    property.Add("�����", cellRows[0]["CellCode"]);
                    property.Add("�����", cellRows[0]["CellName"]);
                    property.Add("��", "��" + column + "��");
                    property.Add("��", "��" + row + "��");
                    property.Add("�Ƿ����", cellRows[0]["IsActive"]);
                    properties.Add("�ֿ���Ϣ", property);

                    CellDialog cellDialog = new CellDialog(properties);
                    cellDialog.ShowDialog();
                }
            }
        }
Ejemplo n.º 2
0
        private void pnlChart_MouseClick(object sender, MouseEventArgs e)
        {
            int i = 0;

            for (int j = 0; j < top.Length; j++)
            {
                if (e.Y > top[top.Length - 1])
                {
                    i = 7; break;
                }
                if (e.Y < top[j + 1])
                {
                    i = j;
                    break;
                }
            }
            int shelf = 0;

            if (currentPage == 1)
            {
                shelf = i + 1;
            }
            else if (currentPage == 2)
            {
                shelf = i + top.Length + 1;
            }
            int column = (e.X - left) / cellWidth + 1;

            if (column == 19)
            {
                return;
            }
            if (column >= 20)
            {
                column = column - 1;
            }
            int row = (e.Y - (top[i]) + 7) / cellHeight;

            string keys = "";

            if (shelf < 10)
            {
                keys = "0" + shelf.ToString();
            }
            else
            {
                keys = shelf.ToString();
            }
            if (column <= columns + 1 && row <= rows)
            {
                DataRow[] cellRows = cellTable.Select(string.Format("Shelf={0} AND ColNum='{1}' AND RowNum='{2}'", keys, column, row));
                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]["QuantityJian"] + "件烟");
                    property.Add("卷烟条数", cellRows[0]["QuantityTiao"] + "条烟");
                    //property.Add("入库时间", cellRows[0]["INDATE"]);
                    properties.Add("产品信息", property);

                    property = new Dictionary <string, object>();
                    property.Add("仓库编码", cellRows[0]["WareCode"]);
                    property.Add("仓库名称", cellRows[0]["WareName"]);
                    property.Add("货架名称", "第" + cellRows[0]["ShelfName"] + "排货架");
                    property.Add("货位编码", cellRows[0]["CellCode"]);
                    property.Add("货位名称", cellRows[0]["CellName"]);
                    property.Add("列", "第" + column + "列");
                    property.Add("层", "第" + row + "层");
                    property.Add("是否可用", cellRows[0]["IsActive"]);
                    properties.Add("仓库信息", property);

                    CellDialog cellDialog = new CellDialog(properties);
                    cellDialog.ShowDialog();
                }
            }
        }