Esempio n. 1
0
 public PenDetails(PRODUCT product)
 {
     InitializeComponent();
     using (var context = new Entities())
     {
         colours = new List <COLOUR>();
         foreach (COLOUR colour in context.COLOURS)
         {
             colours.Add(new COLOUR()
             {
                 COLOUR_ID = colour.COLOUR_ID, COLOUR_NAME = colour.COLOUR_NAME
             });
         }
         colourPen.ItemsSource = colours;
         p = context.PRODUCTS.Find(product.PRODUCT_ID);
         var pen = new PEN();
         pen              = context.PENS.Find(product.PRODUCT_ID);
         PenName.Text     = p.PRODUCT_NAME;
         PenInStock.Text  = p.PRODUCTS_IN_STOCK.ToString();
         discountPen.Text = p.DISCOUNT.ToString();
         pricePen.Text    = p.PRICE.ToString();
         producerPen.Text = p.PRODUCER;
         typePen.Text     = pen.PEN_TYPE;
         var c = context.COLOURS.Find(pen.COLOUR_ID);
         colourPen.SelectedItem = c;
     }
 }
 public CrayonDetails(PRODUCT product)
 {
     InitializeComponent();
     using (var context = new Entities())
     {
         colours = new List <COLOUR>();
         foreach (COLOUR colour in context.COLOURS)
         {
             colours.Add(new COLOUR()
             {
                 COLOUR_ID = colour.COLOUR_ID, COLOUR_NAME = colour.COLOUR_NAME
             });
         }
         colourCrayon.ItemsSource = colours;
         p = context.PRODUCTS.Find(product.PRODUCT_ID);
         var crayon = new CRAYON();
         crayon              = context.CRAYONS.Find(product.PRODUCT_ID);
         CrayonName.Text     = p.PRODUCT_NAME;
         CrayonsInStock.Text = p.PRODUCTS_IN_STOCK.ToString();
         discountCrayon.Text = p.DISCOUNT.ToString();
         priceCrayon.Text    = p.PRICE.ToString();
         producerCrayon.Text = p.PRODUCER;
         typeCrayon.Text     = crayon.CRAYON_TYPE;
         shapeCrayon.Text    = crayon.SHAPE;
         var c = context.COLOURS.Find(crayon.COLOUR_ID);
         colourCrayon.SelectedItem = c;
     }
 }
Esempio n. 3
0
 public InkDetails(PRODUCT product)
 {
     InitializeComponent();
     using (var context = new Entities())
     {
         colours = new List <COLOUR>();
         foreach (COLOUR colour in context.COLOURS)
         {
             colours.Add(new COLOUR()
             {
                 COLOUR_ID = colour.COLOUR_ID, COLOUR_NAME = colour.COLOUR_NAME
             });
         }
         colourInk.ItemsSource = colours;
         p = context.PRODUCTS.Find(product.PRODUCT_ID);
         var ink = new INK();
         ink              = context.INKS.Find(product.PRODUCT_ID);
         InkName.Text     = p.PRODUCT_NAME;
         InkInStock.Text  = p.PRODUCTS_IN_STOCK.ToString();
         discountInk.Text = p.DISCOUNT.ToString();
         priceInk.Text    = p.PRICE.ToString();
         producerInk.Text = p.PRODUCER;
         typeInk.Text     = ink.INT_TYPE;
         var c = context.COLOURS.Find(ink.COLOUR_ID);
         colourInk.SelectedItem = c;
     }
 }
Esempio n. 4
0
 public SetDetails(PRODUCT product)
 {
     InitializeComponent();
     using (var context = new Entities())
     {
         p = context.PRODUCTS.Find(product.PRODUCT_ID);
         var set = new SET();
         set              = context.SETS.Find(product.PRODUCT_ID);
         SetName.Text     = p.PRODUCT_NAME;
         SetInStock.Text  = p.PRODUCTS_IN_STOCK.ToString();
         discountSet.Text = p.DISCOUNT.ToString();
         priceSet.Text    = p.PRICE.ToString();
         producerSet.Text = p.PRODUCER;
         typeSet.Text     = set.TYPE;
     }
 }
 public PencilDetails(PRODUCT product)
 {
     InitializeComponent();
     using (var context = new Entities())
     {
         p = context.PRODUCTS.Find(product.PRODUCT_ID);
         var pencil = new PENCIL();
         pencil               = context.PENCILS.Find(product.PRODUCT_ID);
         productName.Text     = p.PRODUCT_NAME;
         productsInStock.Text = p.PRODUCTS_IN_STOCK.ToString();
         discount.Text        = p.DISCOUNT.ToString();
         price.Text           = p.PRICE.ToString();
         producer.Text        = p.PRODUCER;
         graphiteGrade.Text   = pencil.GRAPHITE_GRADE;
     }
 }
Esempio n. 6
0
 public CanvasDetails(PRODUCT product)
 {
     InitializeComponent();
     using (var context = new Entities())
     {
         p = context.PRODUCTS.Find(product.PRODUCT_ID);
         var canvas = new CANVAS();
         canvas               = context.CANVASES.Find(product.PRODUCT_ID);
         productName.Text     = p.PRODUCT_NAME;
         productsInStock.Text = p.PRODUCTS_IN_STOCK.ToString();
         discount.Text        = p.DISCOUNT.ToString();
         price.Text           = p.PRICE.ToString();
         producer.Text        = p.PRODUCER;
         canvasSize.Text      = canvas.CANVASE_SIZE;
         canvasMaterial.Text  = canvas.MATERIAL;
     }
 }
Esempio n. 7
0
 public PaperPadDetails(PRODUCT product)
 {
     InitializeComponent();
     using (var context = new Entities())
     {
         p = context.PRODUCTS.Find(product.PRODUCT_ID);
         var paperPad = new PAPERPAD();
         paperPad              = context.PAPERPADS.Find(product.PRODUCT_ID);
         PaperPadName.Text     = p.PRODUCT_NAME;
         PaperPadInStock.Text  = p.PRODUCTS_IN_STOCK.ToString();
         discountPaperPad.Text = p.DISCOUNT.ToString();
         pricePaperPad.Text    = p.PRICE.ToString();
         producerPaperPad.Text = p.PRODUCER;
         paperPadSize.Text     = paperPad.PAPER_PAD_SIZE;
         paperPadPages.Text    = paperPad.PAGES_NUMBER.ToString();
         grammagePaperPad.Text = paperPad.GRAMMAGE.ToString();
     }
 }
Esempio n. 8
0
 public NotebookDetails(PRODUCT product)
 {
     InitializeComponent();
     using (var context = new Entities())
     {
         p = context.PRODUCTS.Find(product.PRODUCT_ID);
         var notebook = new NOTEBOOK();
         notebook              = context.NOTEBOOKS.Find(product.PRODUCT_ID);
         NotebookName.Text     = p.PRODUCT_NAME;
         NotebookInStock.Text  = p.PRODUCTS_IN_STOCK.ToString();
         discountNotebook.Text = p.DISCOUNT.ToString();
         priceNotebook.Text    = p.PRICE.ToString();
         producerNotebook.Text = p.PRODUCER;
         paperType.Text        = notebook.PAPER_TYPE;
         notebookSize.Text     = notebook.NOTEBOOK_SIZE;
         notebookPages.Text    = notebook.NOTEBOOK_PAGES.ToString();
         grammage.Text         = notebook.GRAMMAGE.ToString();
         hardcover.Text        = notebook.HARDCOVER;
     }
 }