Ejemplo n.º 1
0
 private void ProductForm_VisibleChanged(object sender, EventArgs e)
 {
     if (Visible && productID == -1)
     {
         ProductGrid.ClearSelection();
     }
 }
Ejemplo n.º 2
0
        private void SaleItemPopup_Load(object sender, EventArgs e)
        {
            Left = MainForm.Location.X + (MainForm.Width / 2 - Width / 2);
            Top  = MainForm.Location.Y + (MainForm.Height / 2 - Height / 2);

            FilterButton_Click(sender, e);

            ProductGrid.ClearSelection();
        }
Ejemplo n.º 3
0
        private void FilterButton_Click(object sender, EventArgs e)
        {
            var filter = new ProductFilter
            {
                ID    = FilterIDTextBox.Text.AsInt(),
                Name  = FilterNameTextBox.Text,
                Scale = FilterScaleTextBox.Text.AsShort()
            };

            ProductGrid.DataSource = ProductRepository.GetProducts(filter);
            ProductGrid.ClearSelection();
        }
Ejemplo n.º 4
0
        private void CancelButton_Click(object sender, EventArgs e)
        {
            ProductErrorProvider.Clear();

            if (productID > 0)
            {
                ViewProductDetailTab(productID);
            }
            else
            {
                ViewProductListingTab();

                productID = -1;

                ProductGrid.ClearSelection();
            }
        }
Ejemplo n.º 5
0
        private void ViewComponentDetailTab(int id)
        {
            using (var repository = new ComponentTypeRepository())
            {
                var dropDown = repository.GetComponentTypeForDropDown();
                dropDown.Insert(0, new KeyValuePair <byte, string>(0, "<Vytvořit nový typ...>"));

                ComponentTypeDropDown.DataSource = dropDown;
            }

            if (id > 0)
            {
                IsWork     = false;
                RibbonMode = RibbonMode.Detail;

                ChangeControlsEnabled(DetailTab.Controls, false, false);

                var component = ComponentRepository.GetComponent(componentID);

                ComponentTypeDropDown.SelectedValue = component.ComponentTypeID;
                NameTextBox.Text = component.Name.ToString();

                ProductGrid.DataSource = ComponentRepository.GetProducts(componentID);

                ComponentTabControl.SelectedTab = DetailTab;

                ProductGrid.ClearSelection();
            }
            else
            {
                IsWork     = true;
                RibbonMode = RibbonMode.Edit;

                ChangeControlsEnabled(DetailTab.Controls, true, true);

                ComponentTabControl.SelectedTab = DetailTab;
            }
        }