Example #1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            ProductForm productForm = new ProductForm();

            if (productForm.ShowDialog() == DialogResult.OK)
            {
                CRUDManager crudManager = new CRUDManager();
                crudManager.InsertRecord(DatabaseStrings.ProductTable, productForm.Product);
            }
            UpdateGrid();
        }
Example #2
0
 private void ShowProductBtn_Click(object sender, EventArgs e)
 {
     if (ProductList.SelectedItem is Product)
     {
         Product     prod        = ProductList.SelectedItem as Product;
         ProductForm productForm = new ProductForm(prod);
         if (productForm.ShowDialog() == DialogResult.OK)
         {
             ;
         }
     }
 }
Example #3
0
        private void ButtonAddProductClick(object sender, EventArgs e)
        {
            var form = new ProductForm(new Product());

            if (form.ShowDialog() == DialogResult.OK)
            {
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoWork;
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoFilteringWork;
                AnimatedThreadWorker.DoWork += AnimatedThreadWorkerDoWork;

                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
		protected override void RadGridView1_DoubleClick(object sender, EventArgs e)
		{
			if (SelectedItem != null)
			{
				var editForm = new ProductForm(SelectedItem.Product);
				if (editForm.ShowDialog() == DialogResult.OK)
				{
					var subs = GetListViewSubItems(SelectedItem);
					for (int i = 0; i < subs.Count; i++)
						radGridView1.SelectedRows[0].Cells[i].Value = subs[i].Text;
				}
			}
		}
Example #5
0
        private void Button2_Click(object sender, EventArgs e)
        {
            var form = new ProductForm(new Product());

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (textBoxPartNumber.Text != "")
                {
                    metroProgressSpinner1.Visible = true;
                    Task.Run(() => DoWork())
                    .ContinueWith(task => Complete(), TaskScheduler.FromCurrentSynchronizationContext());
                }
            }
        }
Example #6
0
 private void addnewProduct()
 {
         ProductForm pf = new ProductForm();
         pf.Title = "New Product for " + supplier.CompanyName;
         if (pf.ShowDialog().Value)
         {
             Product newProd = new Product();
             newProd.ProductName = pf.productName.Text;
             newProd.QuantityPerUnit = pf.quantityPerUnit.Text;
             newProd.UnitPrice = Decimal.Parse(pf.unitPrice.Text);
             this.supplier.Products.Add(newProd);
             this.productsInfo.Add(newProd);
             saveChanges.IsEnabled = true;
         }
 }
Example #7
0
        public void EditAction(ProductIdParameter parameter)
        {
            Product product = Products.GetInstance().GetProduct(parameter.Id);
            ProductDataParameters productParameters = new ProductDataParameters()
            {
                Id      = product.Id,
                Article = product.Article,
                Title   = product.Title,
                Price   = product.Price
            };

            ProductForm form = Application.OpenForms["ProductForm"] == null ? new ProductForm() : (ProductForm)Application.OpenForms["ProductForm"];

            form.productParameters = productParameters;
            form.ShowDialog();
        }
Example #8
0
        public void Update()
        {
            prodsAdapter.FillBy(prods, Node.Id);

            if (prods.Rows.Count != 1)
            {
                throw new Exception();
            }

            var         row  = prods.Rows[0];
            ProductForm form = new ProductForm(Convert.ToInt32(row[2]), Convert.ToInt32(row[3]));

            form.ShowDialog();

            int     product;
            int     copies;
            decimal cost;

            if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                product = form.Product;
                copies  = form.Copies;
                cost    = form.Cost;
            }
            else
            {
                return;
            }

            UpdateProdSales(Node.Id, product, copies, cost);

            prodShowAdapter.FillByPSaleId(prodShow, Node.Id);
            UpdateParentDeal(false);

            if (prodShow.Rows.Count != 1)
            {
                throw new Exception();
            }

            row       = prodShow.Rows[0];
            Node.Text = Convert.ToString(row[2]);
        }
Example #9
0
        public void Add()
        {
            ProductForm form = new ProductForm();

            form.ShowDialog();

            int     product;
            int     copies;
            decimal cost;

            if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                product = form.Product;
                copies  = form.Copies;
                cost    = form.Cost;
            }
            else
            {
                return;
            }

            int id = InsertIntoProdSales(Node.Id, product, copies, cost);

            prodShowAdapter.FillByPSaleId(prodShow, id);
            UpdateParentDeal(true);

            if (prodShow.Rows.Count != 1)
            {
                throw new Exception();
            }

            var        row     = prodShow.Rows[0];
            CustomNode newNode =
                new CustomNode(text: Convert.ToString(row[2]), type: CustomNode.PRODUCT, id: Convert.ToInt32(row[1]),
                               pId: Convert.ToInt32(row[0]));

            newNode.ContextMenu =
                new CustomMenu(new Controller().GetProductsMenuItems(), newNode);


            Node.Nodes.Add(newNode);
        }
Example #10
0
        private void product_Click(object sender, EventArgs e)
        {
            ProductForm productForm = new ProductForm();

            productForm.ShowDialog();
        }
Example #11
0
        private void newProductToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ProductForm frm = new ProductForm(new MasterProduct(), this);

            frm.ShowDialog();
        }
Example #12
0
        public override void EditSelectedItem()
        {
            ProductForm frm = new ProductForm(_selectedProId, MdiParentForm);

            frm.ShowDialog();
        }
Example #13
0
        private void ButtonAddProduct_Click(object sender, EventArgs e)
        {
            var form = new ProductForm(new Product());

            form.ShowDialog();
        }
Example #14
0
        private void editProduct(Product product)
        {
            ProductForm pf = new ProductForm();
            pf.Title = "Edit Product Details";
            pf.productName.Text = product.ProductName;
            pf.quantityPerUnit.Text = product.QuantityPerUnit;
            pf.unitPrice.Text = product.UnitPrice.ToString();

            if (pf.ShowDialog().Value)
            {
                product.ProductName = pf.productName.Text;
                product.QuantityPerUnit = pf.quantityPerUnit.Text;
                product.UnitPrice = Decimal.Parse(pf.unitPrice.Text);
                saveChanges.IsEnabled = true;
            }
        }
Example #15
0
 private void listControl1_DoubleClick(object sender, EventArgs e)
 {
     ProductInfo pi = SelectedProduct;
     if (pi == null) return;
     ProductForm form = new ProductForm(DataService.Instance.IsAdmin);
     form.InitialData(pi);
     form.ShowDialog(this);
 }