Exemplo n.º 1
0
        private void getExistingShowPiecesSold()
        {
            //Open connection if not already
            if (connection.State == ConnectionState.Closed)
            {
                connection.Open();
            }
            try
            {
                string       selectStatement = "SELECT * FROM ShowPieces WHERE ShowNo = " + show.showNo + " AND Sold = " + true + " ;";
                OleDbCommand selectCmd       = new OleDbCommand(selectStatement, connection);
                //execute reader and close reader
                OleDbDataReader reader = selectCmd.ExecuteReader();

                while (reader.Read())
                {
                    showPiece temp = new showPiece();
                    temp.itemNo      = Convert.ToInt32(reader["ItemNo"]);
                    temp.patternName = Convert.ToString(reader["PatternName"]);
                    temp.pieceName   = Convert.ToString(reader["PieceName"]);
                    temp.showNo      = Convert.ToInt32(reader["ShowNo"]);
                    temp.pieceSize   = Convert.ToDecimal(reader["PieceSize"]);
                    temp.sold        = Convert.ToBoolean(reader["Sold"]);
                    getShowPieceSold(temp, false);
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.ToString());
            }
            connection.Close();
        }
Exemplo n.º 2
0
 private void btnMoveToTaken_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow row in dgvSold.SelectedRows)
     {
         showPiece temp = new showPiece();
         temp.showNo      = show.showNo;
         temp.itemNo      = Convert.ToInt32((this.dgvSold.Rows[row.Index].Cells[0].Value).ToString());
         temp.pieceName   = Convert.ToString((this.dgvSold.Rows[row.Index].Cells[1].Value).ToString());
         temp.patternName = Convert.ToString((this.dgvSold.Rows[row.Index].Cells[2].Value).ToString());
         temp.pieceSize   = Convert.ToDecimal((this.dgvSold.Rows[row.Index].Cells[3].Value).ToString());
         temp.sold        = false;
         piecesSold.RemoveAt(row.Index);
         dgvSold.Rows.Remove(row);
         getShowPieceTaken(temp);
     }
 }
Exemplo n.º 3
0
        private void getShowPieceTaken(showPiece pPiece)
        {
            showPiece temp = new showPiece();

            temp.showNo      = pPiece.showNo;
            temp.itemNo      = pPiece.itemNo;
            temp.sold        = pPiece.sold;
            temp.pieceName   = pPiece.pieceName;
            temp.patternName = pPiece.patternName;
            temp.pieceSize   = pPiece.pieceSize;
            piecesTaken.Add(temp);
            DataGridViewRow newRow = new DataGridViewRow();

            newRow.CreateCells(dgvPiecesTaken);
            newRow.Cells[0].Value = temp.itemNo;
            newRow.Cells[1].Value = temp.pieceName;
            newRow.Cells[2].Value = temp.patternName;
            newRow.Cells[3].Value = temp.pieceSize;
            dgvPiecesTaken.Rows.Add(newRow);
        }
Exemplo n.º 4
0
        public void getShowPieceTaken(LineItem pItem)
        {
            showPiece temp = new showPiece();

            temp.showNo      = show.showNo;
            temp.itemNo      = takenPieces;
            temp.sold        = false;
            temp.pieceName   = DatabaseAccess.GetPieceByNo(pItem.pieceNo).pieceName;
            temp.patternName = DatabaseAccess.GetPatternByNo(pItem.patternNo).patternName;
            temp.pieceSize   = DatabaseAccess.GetPieceSizeByNo(pItem.pieceNo, pItem.sizeNo).totalPounds;
            piecesTaken.Add(temp);
            DataGridViewRow newRow = new DataGridViewRow();

            newRow.CreateCells(dgvPiecesTaken);
            newRow.Cells[0].Value = temp.itemNo;
            newRow.Cells[1].Value = temp.pieceName;
            newRow.Cells[2].Value = temp.patternName;
            newRow.Cells[3].Value = temp.pieceSize;
            dgvPiecesTaken.Rows.Add(newRow);
            updateShowPieces();
            takenPieces++;
        }
Exemplo n.º 5
0
        private void getShowPieceSold(showPiece pPiece, bool newPieceSold)
        {
            showPiece temp = new showPiece();

            temp.showNo      = pPiece.showNo;
            temp.itemNo      = pPiece.itemNo;
            temp.sold        = pPiece.sold;
            temp.pieceName   = pPiece.pieceName;
            temp.patternName = pPiece.patternName;
            temp.pieceSize   = pPiece.pieceSize;
            piecesSold.Add(temp);
            DataGridViewRow newRow = new DataGridViewRow();

            newRow.CreateCells(dgvSold);
            newRow.Cells[0].Value = temp.itemNo;
            newRow.Cells[1].Value = temp.pieceName;
            newRow.Cells[2].Value = temp.patternName;
            newRow.Cells[3].Value = temp.pieceSize;
            dgvSold.Rows.Add(newRow);
            if (newPieceSold)
            {
                updateShowPieces();
            }
        }