コード例 #1
0
 public Stock GetStock(string stockCode)
 {
     if (Stocks.Any(c => c.StockCode == stockCode))
     {
         return(Stocks.First(c => c.StockCode == stockCode));
     }
     return(null);
 }
コード例 #2
0
 private void gridControlProductLine_Click(object sender, EventArgs e)
 {
     if (!Stocks.Any())
     {
         return;
     }
     GCProductDisplay.DataSource =
         Stocks.First(s => s.Id == (Guid)gridViewStock.GetFocusedRowCellValue("Id"))
         .Products.Where(p => p.Id == (Guid)gridViewProductLine.GetFocusedRowCellValue("IdProduct"));
 }
コード例 #3
0
        public void AddStock(string symbol)
        {
            Stock newStock = new Stock()
            {
                Name = symbol
            };

            if (!Stocks.Contains(newStock))
            {
                Stocks.Add(newStock);
            }
            SelectedStock = Stocks.First(Stock => Stock.Name == newStock.Name);
        }
コード例 #4
0
        void ICollectionModifier <Stock> .Update(Stock entity)
        {
            var modified = Stocks.First(s => s.Id == entity.Id);

            modified.Type = entity.Type;
        }
コード例 #5
0
        private void Mail_Load(object sender, EventArgs e)
        {
            //  gridControl1.ForceInitialize();


            var repositoryStock   = new RepositoryStock();
            var repositoryProduit = new RepositoryProduct();

            _stockPresenter = new StockPresenterPage(this, repositoryStock, repositoryProduit);
            _stockPresenter.Display();

            gridControlStock.DataSource      = Stocks;
            gridViewStock.Columns[5].Visible = false;
            gridViewStock.Columns[7].Visible = false;

            var lignesProduits = Stocks.First().ProductLine;

            gridControlProductLine.DataSource      = lignesProduits;
            gridViewProductLine.Columns[0].Visible = false;
            gridViewProductLine.Columns[3].Visible = false;
            gridViewProductLine.Columns[4].Visible = false;
            gridViewProductLine.Columns[5].Visible = false;
            gridViewProductLine.Columns[1].Caption = Resources.Produit;
            gridViewProductLine.Columns[2].Caption = Resources.Quantité;
            gridViewStock.RowCellClick            += gridViewStock_CellClick;

            gridControlProduct.DataSource      = Products;
            gridViewProduct.Columns[0].Visible = false;
            gridViewProduct.Columns[3].Visible = false;
            gridViewProduct.Columns[4].Visible = false;
            gridViewProduct.Columns[6].Visible = false;
            gridViewProduct.Columns[7].Visible = false;
            gridViewProduct.Columns[8].Visible = false;

            GCProductDisplay.DataSource = Stocks.First().Products;

            /*LayoutViewProduct.TemplateCard.Width = 400;
             * LayoutViewProduct.TemplateCard.Height = 400;*/


            // LayoutViewProduct.OptionsBehavior.AutoPopulateColumns = false;
            LayoutViewProduct.Columns["Id"].Visible = false;

            /*
             * var fieldPhoto = LayoutViewProduct.Columns["Photo"].LayoutViewField;
             * var filedName = LayoutViewProduct.Columns["Nom"].LayoutViewField;
             * var filedCategorie = LayoutViewProduct.Columns["Categorie"].LayoutViewField;
             * var filedFournisseur = LayoutViewProduct.Columns["Fournisseur"].LayoutViewField;
             * var filedQuantite = LayoutViewProduct.Columns["QuantiteMin"].LayoutViewField;
             *
             *
             * var filedRemarque = LayoutViewProduct.Columns["Remarque"].LayoutViewField;
             * var fileReference = LayoutViewProduct.Columns["Reference"].LayoutViewField;
             *
             */


            /*LayoutControlGroup groupInfoPrin= LayoutViewProduct.TemplateCard.AddGroup("Information Principale",
             * fieldPhoto, InsertType.Top);
             * groupInfoPrin.Add(fieldPhoto);
             * groupInfoPrin.Add(filedName);
             * groupInfoPrin.Add(filedCategorie);
             * groupInfoPrin.Add(filedFournisseur);
             * groupInfoPrin.Add(filedQuantite);*/
            /*
             * filedName.TextSize = new Size(){Height = 12,Width = 15};
             * filedName.Move(new LayoutItemDragController(filedName, fieldPhoto, InsertLocation.After, LayoutType.Horizontal));
             * filedCategorie.Move(new LayoutItemDragController(filedCategorie, filedName, InsertLocation.After, LayoutType.Vertical));
             * filedFournisseur.Move(new LayoutItemDragController(filedFournisseur, filedCategorie, InsertLocation.After, LayoutType.Vertical));
             * filedQuantite.Move(new LayoutItemDragController(filedQuantite, filedFournisseur, InsertLocation.After, LayoutType.Vertical));
             *
             */

            /*LayoutControlGroup groupInfoSupp = LayoutViewProduct.TemplateCard.AddGroup("Information Supplémentaire", fieldPhoto, InsertType.Bottom);
             *
             * groupInfoSupp.Add(filedRemarque);
             * groupInfoSupp.Add(fileReference);*/


            var riPictureEdit = GCProductDisplay.RepositoryItems.Add("PictureEdit") as RepositoryItemPictureEdit;

            if (riPictureEdit != null)
            {
                riPictureEdit.SizeMode = PictureSizeMode.Squeeze;
                LayoutViewProduct.Columns["Photo"].ColumnEdit = riPictureEdit;
                //LayoutViewProduct.Columns["Photo"]
            }
            LayoutViewProduct.Columns["Photo"].LayoutViewField.TextVisible = false;

            LayoutViewProduct.CardMinSize = new Size(350, 200);
        }
コード例 #6
0
        public void Update(Stock entity)
        {
            Stock modified = Stocks.First(f => f.Id == entity.Id);

            modified.TypeOfStock = entity.TypeOfStock;
        }
コード例 #7
0
        public void Update(Stock entity)
        {
            var modified = Stocks.First(s => s.Id == entity.Id);

            modified.Type = entity.Type;
        }
コード例 #8
0
 private void comboBoxStock_SelectedIndexChanged(object sender, EventArgs e)
 {
     comboBoxStock.ValueMember  = "Name";
     comboBoxProduit.DataSource = Stocks.First(s => s.Name == (string)comboBoxStock.SelectedValue).GetProducts().ToList();
     IsOrderLineModified        = true;
 }