Exemplo n.º 1
0
        public override void Initialize(TaskArgumentsHolder args, ViewSettings settings)
        {
            ProductDS products = StoreController.GetCatalogProducts();

            catalogGrid.DataSource = products;
            catalogGrid.DataMember = "product";
            DataGridTableStyle style = new DataGridTableStyle();

            style.ReadOnly    = true;
            style.MappingName = "product";

            PropertyDescriptorCollection descriptors = this.BindingContext[products, "product"].GetItemProperties();

            DataGridColumnStyle productId = new DataGridTextBoxColumn(descriptors["ProductID"]);

            productId.MappingName = "ProductID";
            productId.HeaderText  = "Product ID";
            productId.ReadOnly    = true;
            style.GridColumnStyles.Add(productId);

            DataGridColumnStyle categoryID = new DataGridTextBoxColumn(descriptors["CategoryID"]);

            categoryID.MappingName = "CategoryID";
            categoryID.HeaderText  = "Category ID";
            categoryID.ReadOnly    = true;
            style.GridColumnStyles.Add(categoryID);

            DataGridColumnStyle modelNumber = new DataGridTextBoxColumn(descriptors["ModelNumber"]);

            modelNumber.MappingName = "ModelNumber";
            modelNumber.HeaderText  = "Model Number";
            modelNumber.ReadOnly    = true;
            style.GridColumnStyles.Add(modelNumber);

            DataGridColumnStyle modelName = new DataGridTextBoxColumn(descriptors["ModelName"]);

            modelName.MappingName = "ModelName";
            modelName.HeaderText  = "Model Name";
            modelName.ReadOnly    = true;
            style.GridColumnStyles.Add(modelName);

            DataGridColumnStyle unitCost = new DataGridTextBoxColumn(descriptors["UnitCost"], "c");

            unitCost.MappingName = "UnitCost";
            unitCost.HeaderText  = "Unit Cost";
            unitCost.ReadOnly    = true;
            style.GridColumnStyles.Add(unitCost);

            DataGridColumnStyle description = new DataGridTextBoxColumn(descriptors["Description"]);

            description.MappingName = "Description";
            description.HeaderText  = "Description";
            description.ReadOnly    = true;
            style.GridColumnStyles.Add(description);

            catalogGrid.TableStyles.Add(style);
        }
Exemplo n.º 2
0
        public decimal?Count_ByLocation(int LocationID, int ProductID, DateTime TransDate)
        {
            ProductDS ProductDS = new ProductDS();

            ProductDS.BeginInit();

            Cognitivo.Reporting.Data.ProductDSTableAdapters.QueriesTableAdapter QueriesTableAdapter = new Cognitivo.Reporting.Data.ProductDSTableAdapters.QueriesTableAdapter();

            //fill data
            decimal?i = QueriesTableAdapter.GetStock_ByLocation(entity.CurrentSession.Id_Company, LocationID, TransDate, ProductID);

            ProductDS.EndInit();

            return(i);
        }