Пример #1
0
 private void btnWinesAXMLImport_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (AddWineFromXML())
         {
             MessageBox.Show("Wine added successfully");
             ForAdmin forAdminN = new ForAdmin();
             forAdminN.Show();
             this.Close();
         }
         else
         {
             MessageBox.Show("No wine added");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Wine with this product code is already in the store catalog");
     }
 }
Пример #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.forAdmin = ((WineStore.ForAdmin)(target));
                return;

            case 2:

            #line 23 "..\..\..\Windows\ForAdmin.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.exitAdmin_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.GridMain = ((System.Windows.Controls.Grid)(target));
                return;

            case 4:
                this.start = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 5:
                this.btnWinesA = ((System.Windows.Controls.Button)(target));

            #line 31 "..\..\..\Windows\ForAdmin.xaml"
                this.btnWinesA.Click += new System.Windows.RoutedEventHandler(this.ButtonA_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.btnWinesAAvail = ((System.Windows.Controls.Button)(target));

            #line 32 "..\..\..\Windows\ForAdmin.xaml"
                this.btnWinesAAvail.Click += new System.Windows.RoutedEventHandler(this.btnWinesAAvail_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.btnWinesAXMLImport = ((System.Windows.Controls.Button)(target));

            #line 33 "..\..\..\Windows\ForAdmin.xaml"
                this.btnWinesAXMLImport.Click += new System.Windows.RoutedEventHandler(this.btnWinesAXMLImport_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.btnWinesAXMLExport = ((System.Windows.Controls.Button)(target));

            #line 34 "..\..\..\Windows\ForAdmin.xaml"
                this.btnWinesAXMLExport.Click += new System.Windows.RoutedEventHandler(this.btnWinesAXMLExport_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.GridCursor = ((System.Windows.Controls.Grid)(target));
                return;
            }
            this._contentLoaded = true;
        }