private void btnProductGetAll_Click(object sender, EventArgs e) { this.Hide(); GetForm forma = new GetForm(Type.Product, null, ID); forma.ShowDialog(); }
private void btnEmployeeGetAll_Click(object sender, EventArgs e) { this.Hide(); GetForm forma = new GetForm(Type.Employee, null, ID); forma.ShowDialog(); }
private void GetProductReducedPriceBtn_Click(object sender, EventArgs e) { this.Hide(); GetForm forma = new GetForm(Type.ReducedPriceProduct, null, ID); forma.ShowDialog(); }
private void button7_Click(object sender, EventArgs e) { //obrisi proizvode kojima je istekao rok trajanja this.Hide(); GetForm forma = new GetForm(Type.ProductExpDate, null, ID); forma.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { //group box2 ok button this.Hide(); switch (button.Name) { case "button4": { GetForm forma = new GetForm(Type.ProductSold, dateTimePicker1.Value.Date.ToString(), ID); forma.ShowDialog(); } break; case "button1": { GetForm forma = new GetForm(Type.ProductExpDate, dateTimePicker1.Value.Date.ToString(), ID); forma.ShowDialog(); } break; } }
private void btnOk_Click(object sender, EventArgs e) { if (textBox1.Text != "") { switch (button.Name) { case "btnEmployeeDelete": { if (DataProviders.EmployeeProvider.DeleteEmployee(textBox1.Text, ID)) { MessageBox.Show("Izbrisan"); } else { MessageBox.Show("Nemoguće brisanje!"); } } break; case "btnEmployeeGet": { this.Hide(); GetForm forma = new GetForm(Type.Employee, textBox1.Text, ID); forma.ShowDialog(); } break; case "btnProductDelete": { var product = DataProviders.ProductProvider.GetProduct(textBox1.Text, ID); if (product != null) { DataProviders.ProductProvider.DeleteProduct(textBox1.Text, ID); DataProviders.ProductExpirationDateProvider.DeleteProduct(product.ExpirationDate, ID, textBox1.Text); // DataProviders.ProductSoldProvider.DeleteProduct(product.ExpirationDate,ID, textBox1.Text); MessageBox.Show("Izbrisan"); } else { MessageBox.Show("Nemoguće brisanje!"); } } break; case "btnProductGet": { this.Hide(); GetForm forma = new GetForm(Type.Product, textBox1.Text, ID); forma.ShowDialog(); } break; case "ReducePriceBtn": { var products = DataProviders.ProductExpirationDateProvider.ExpirationDate(ID, dateTimePicker1.Value); foreach (var product in products) { DataProviders.ProductProvider.UpdateCostOfProduct(product.ID, product.MarketID, (Int32.Parse(product.Cost) * (1 - (float.Parse(textBox1.Text.ToString()) / 100))).ToString()); } lblGroupBox2.Text = "Unesite barkod:"; button2.Visible = true; } break; } } else { MessageBox.Show("Nije popunjeno polje ID"); } groupBox1.Visible = false; groupBox2.Visible = false; PopustGroupBox.Visible = false; }