Example #1
0
        public void AddSalesLine(GoodsIssueLine giNewLine)
        {
            Array.Resize<GoodsIssueLine>(ref aGoodsLines, aGoodsLines.Length + 1);
            aGoodsLines[aGoodsLines.Length - 1] = giNewLine;
            giNewLine.Top = 17 + ((iLineRowIndex) * 20);
            giNewLine.Left = 4;
            if (giNewLine.txtStore.Text == "")
            {
                giNewLine.txtStore.Text = Global.sDefaultStore;
            }
            giNewLine.TabIndex = 50 + aGoodsLines.Length;
            giNewLine.TabStop = true;

            giNewLine.iLineIndex = aGoodsLines.Length - 1;
            giNewLine.Name = "slNewLine_" + (aGoodsLines.Length - 1).ToString();

            this.pnlDetails.Controls.Add(giNewLine);
            giNewLine.BringToFront();
            iLineRowIndex++;
        }
Example #2
0
        public void InsertSalesLine(int iLineIndex, GoodsIssueLine giNewLine)
        {
            for (int iLines = 0; iLines < aGoodsLines.Length; iLines++)
            {
                GoodsIssueLine giThisline = aGoodsLines[iLines];

                if (giThisline.iLineIndex == iLineIndex)//start line
                {
                    Array.Resize<GoodsIssueLine>(ref aGoodsLines, aGoodsLines.Length + 1);//Add new row
                    iLineRowIndex++;
                    for (int iShiftLines = aGoodsLines.Length - 1; iShiftLines > iLines + 1; iShiftLines--)
                    {
                        aGoodsLines[iShiftLines] = aGoodsLines[iShiftLines - 1];
                        aGoodsLines[iShiftLines].Location = new Point(aGoodsLines[iShiftLines - 1].Location.X, aGoodsLines[iShiftLines - 1].Location.Y + 20); // move location of control to new position
                        aGoodsLines[iShiftLines].iLineIndex++;//sync the lineindex of the control array
                    }
                    aGoodsLines[iLines + 1] = giNewLine;
                    giNewLine.Top = 17 + ((iLineIndex + 1) * 20);
                    giNewLine.Left = 4;
                    if (giNewLine.txtStore.Text == "")
                    {
                        giNewLine.txtStore.Text = Global.sDefaultStore;
                    }
                    giNewLine.TabIndex = 50 + aGoodsLines.Length;
                    giNewLine.TabStop = true;
                    giNewLine.iLineIndex = iLines + 1;
                    giNewLine.Name = "slNewLine_" + (aGoodsLines.Length - 1).ToString();
                    this.pnlDetails.Controls.Add(giNewLine);
                    giNewLine.BringToFront();
                    return;
                }
            }
        }