private void novaKompanika_Klik(object sender, EventArgs e) { if (sender.Equals(this.potvrdiBtn)) { this.VnesiFirma(); daliIzlezi = true; this.Close(); } else if (sender.Equals(this.dodadiProizvoiBtn)) { AddProductsToCompany nova; this.VnesiFirma(); daliIzlezi = true; if (daliDolu) { System.Threading.Thread.Sleep(500); nova = new AddProductsToCompany("Company", this.novoImeTextBox.Text, true); } else { System.Threading.Thread.Sleep(500); nova = new AddProductsToCompany("Company", this.companyNameTextBox.Text, true); } nova.MdiParent = this.MdiParent; nova.Show(); this.Close(); } else { this.Close(); } }
public void klik(object sender, EventArgs e) { Type pom; pom = sender.GetType(); if (this.proveriAktivniFormi()) { if (pom.Name == "ToolStripMenuItem") { ToolStripMenuItem nov = ((ToolStripMenuItem)sender); if (nov.Tag == "Product") { AddProduct nova = new AddProduct(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "Company") { AddCompany nova = new AddCompany(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag=="Group") { ProductGroup nova = new ProductGroup(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "ProductC") { AddProductsToCompany nova = new AddProductsToCompany("Company", true); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "CompanyP") { AddProductsToCompany nova = new AddProductsToCompany("Product", true); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SProduct") { AddProductsToCompany nova = new AddProductsToCompany("Product", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SCompany") { AddProductsToCompany nova = new AddProductsToCompany("Company", false ); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SGroup") { AddProductsToCompany nova = new AddProductsToCompany("Group", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } } else { ToolStripButton nov = ((ToolStripButton)sender); if (nov.Tag == "Product") { AddProduct nova = new AddProduct(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "Company") { AddCompany nova = new AddCompany(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag=="Group") { ProductGroup nova = new ProductGroup(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "ProductC") { AddProductsToCompany nova = new AddProductsToCompany("Company", true); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "CompanyP") { AddProductsToCompany nova = new AddProductsToCompany("Product", true); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SProduct") { AddProductsToCompany nova = new AddProductsToCompany("Product", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SCompany") { AddProductsToCompany nova = new AddProductsToCompany("Company", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SGroup") { AddProductsToCompany nova = new AddProductsToCompany("Group", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } } } else MessageBox.Show("You can not open new form,because there is active one: \n - " + this.ActiveMdiChild.Name.ToString(), "Active Form - " + this.ActiveMdiChild.Name.ToString()); }
private void novaKompanika_Klik(object sender, EventArgs e) { if (sender.Equals(this.potvrdiBtn)) { this.VnesiFirma(); daliIzlezi = true; this.Close(); } else if (sender.Equals(this.dodadiProizvoiBtn)) { AddProductsToCompany nova; this.VnesiFirma(); daliIzlezi = true; if (daliDolu) { System.Threading.Thread.Sleep(500); nova = new AddProductsToCompany("Company", this.novoImeTextBox.Text, true); } else { System.Threading.Thread.Sleep(500); nova = new AddProductsToCompany("Company", this.companyNameTextBox.Text, true); } nova.MdiParent = this.MdiParent; nova.Show(); this.Close(); } else this.Close(); }
public void klik(object sender, EventArgs e) { Type pom; pom = sender.GetType(); if (this.proveriAktivniFormi()) { if (pom.Name == "ToolStripMenuItem") { ToolStripMenuItem nov = ((ToolStripMenuItem)sender); if (nov.Tag == "Product") { AddProduct nova = new AddProduct(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "Company") { AddCompany nova = new AddCompany(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "Group") { ProductGroup nova = new ProductGroup(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "ProductC") { AddProductsToCompany nova = new AddProductsToCompany("Company", true); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "CompanyP") { AddProductsToCompany nova = new AddProductsToCompany("Product", true); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SProduct") { AddProductsToCompany nova = new AddProductsToCompany("Product", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SCompany") { AddProductsToCompany nova = new AddProductsToCompany("Company", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SGroup") { AddProductsToCompany nova = new AddProductsToCompany("Group", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } } else { ToolStripButton nov = ((ToolStripButton)sender); if (nov.Tag == "Product") { AddProduct nova = new AddProduct(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "Company") { AddCompany nova = new AddCompany(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "Group") { ProductGroup nova = new ProductGroup(); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "ProductC") { AddProductsToCompany nova = new AddProductsToCompany("Company", true); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "CompanyP") { AddProductsToCompany nova = new AddProductsToCompany("Product", true); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SProduct") { AddProductsToCompany nova = new AddProductsToCompany("Product", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SCompany") { AddProductsToCompany nova = new AddProductsToCompany("Company", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } else if (nov.Tag == "SGroup") { AddProductsToCompany nova = new AddProductsToCompany("Group", false); nova.MdiParent = this; this.ActivateMdiChild(nova); nova.Show(); } } } else { MessageBox.Show("You can not open new form,because there is active one: \n - " + this.ActiveMdiChild.Name.ToString(), "Active Form - " + this.ActiveMdiChild.Name.ToString()); } }