public Export(ForAdmin forAdmin) { InitializeComponent(); this.forAdmin = forAdmin; try { string XMLcode = XMLExport(); XMLcode = XMLcode.Replace("<WineData>", "<WineData>\n"); XMLcode = XMLcode.Replace("</WineData>", "</WineData>\n"); XMLcode = XMLcode.Replace("<Wine>", "<Wine>\n"); XMLcode = XMLcode.Replace("</Wine>", "</Wine>\n"); XMLcode = XMLcode.Replace("</ID>", "</ID>\n"); XMLcode = XMLcode.Replace("</PRODUCT_CODE>", "</PRODUCT_CODE>\n"); XMLcode = XMLcode.Replace("</TITLE>", "</TITLE>\n"); XMLcode = XMLcode.Replace("</VOLUME>", "</VOLUME>\n"); XMLcode = XMLcode.Replace("</PRICE>", "</PRICE>\n"); XMLcode = XMLcode.Replace("</VINTAGE>", "</VINTAGE>\n"); XMLcode = XMLcode.Replace("</AVAILABLE>", "</AVAILABLE>\n"); XMLcode = XMLcode.Replace("</TYPE>", "</TYPE>\n"); XMLcode = XMLcode.Replace("</COUNTRY>", "</COUNTRY>\n"); XMLcode = XMLcode.Replace("</COTEGORY>", "</COTEGORY>\n"); XMLcode = XMLcode.Replace("</FOTO>", "</FOTO>\n"); XMLView.Text = XMLcode; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void AddWine_Click(object sender, RoutedEventArgs e) { try { if (AddWinesSP(codeWines.Text, nameWines.Text, categoryWines.Text, typeWines.Text, countryWines.Text, Int32.Parse(VintageWines.Text), Int32.Parse(PriceWines.Text), Double.Parse(VolumeWines.Text), Int32.Parse(AvailableWines.Text), FotoWines.Text)) { MessageBox.Show("Wine added successfully"); ForAdmin forAdminN = new ForAdmin(); forAdminN.Show(); forAdmin.Close(); } else { MessageBox.Show("No wine added"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void AlterWine_Click(object sender, RoutedEventArgs e) { try { if (AlterWinesSP(CodeWines.Text, Int32.Parse(PriceWines.Text), Int32.Parse(AvailableWines.Text))) { MessageBox.Show("Wine altered successfully"); ForAdmin forAdminN = new ForAdmin(); forAdminN.Show(); forAdmin.Close(); } else { MessageBox.Show("No wine altered"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnLogin_Click(object sender, RoutedEventArgs e) { if (txbLogin.Text == "admin" && txbPassword.Password == "admin") { ForAdmin AdminWindow = new ForAdmin(); AdminWindow.Show(); Close(); return; } try { if (txbLogin.Text != String.Empty && txbPassword.Password != String.Empty) { if (UserVerification(txbLogin.Text, txbPassword.Password)) { MainWindow mainWindow = new MainWindow(); mainWindow.Show(); Close(); } else { MessageBox.Show("No such user!"); txbLogin.Text = ""; txbPassword.Password = ""; } } else { MessageBox.Show("Fill in all the fields!"); txbLogin.Text = ""; txbPassword.Password = ""; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public AddWines(ForAdmin forAdmin) { InitializeComponent(); this.forAdmin = forAdmin; }