private void button1_Click(object sender, EventArgs e) { try { ListItem selectedItem = this.categoryListBox.SelectedItem as ListItem; if (selectedItem == null) { MessageBox.Show("Please select a category first!"); return; } this.Hide(); this.controller.ShowPleaseWaitDialog(); this.controller.InitCategoryFacade(selectedItem.Value); //for category with both attributes and item specifics enabled, //we only use item specifics if (this.controller.CategoryFacade.ItemSpecificEnabled == ItemSpecificsEnabledCodeType.Enabled) { NameRecommendationTypeCollection itemSpecifics = this.controller.CategoryFacade.NameRecommendationsTypes; ItemSpecificsForm itemSpecificsForm = controller.FormTable[AttributesController.ITEM_SPECIFICS_FORM] as ItemSpecificsForm; itemSpecificsForm.DisplayItemSpecifics(itemSpecifics); itemSpecificsForm.Show(); itemSpecificsForm.BringToFront(); this.controller.HidePleaseWaitDialog(); return; } ReturnPolicyForm returnPolicyForm = controller.FormTable[AttributesController.RETURN_POLICY_FORM] as ReturnPolicyForm; returnPolicyForm.InitializeReturnPolicy(); returnPolicyForm.Show(); returnPolicyForm.BringToFront(); this.controller.HidePleaseWaitDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button1_Click(object sender, EventArgs e) { this.Hide(); if (this.controller.CategoryFacade.ItemSpecificEnabled == ItemSpecificsEnabledCodeType.Enabled) { ItemSpecificsForm itemSpecificsForm = controller.FormTable[AttributesController.ITEM_SPECIFICS_FORM] as ItemSpecificsForm; itemSpecificsForm.Show(); itemSpecificsForm.BringToFront(); } else { CategoryListForm categoryListForm = (CategoryListForm)controller.FormTable[AttributesController.CATEGORY_LIST_FORM]; categoryListForm.Show(); categoryListForm.BringToFront(); } }