Ejemplo n.º 1
0
 /// <summary>
 /// btn_Catalog_Click()
 /// When user hits catalog button, a form opens displaying all products in database
 /// User can select products and return to order form to modify quantities
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn_Catalog_Click(object sender, EventArgs e)
 {
     errorProvider.SetError(btn_Catalog,"");//clear error
     this.Enabled = false;//disable order form (gets enabled when catalog form is closed)
     FrmCatalog catalog = new FrmCatalog(business);//create catalog object
     catalog.MdiParent = this.MdiParent;
     catalog.eventProductChosen += new FrmCatalog.ProductChosen(productReturned);//register with delegate for event
     catalog.Text = this.Text;
     catalog.Show();//show catalog and pass this form as parent
 }
 /// <summary>
 /// btnCatalog_Click()
 /// Shows a catalog in which users can select a product from in order to get details and update if desired.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCatalog_Click(object sender, EventArgs e)
 {
     FrmCatalog catalog = new FrmCatalog(business);//create catalog object
     catalog.MdiParent = this.MdiParent;//set parent
     catalog.Text = this.Text;
     catalog.eventProductChosen += new FrmCatalog.ProductChosen(productChosen);//register handler with delegate for event
     catalog.Show();
 }