private void btnAddUser_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(tbLogin.Text)) { sB.Info("Введите логин"); } else if (string.IsNullOrEmpty(tbPassword.Text)) { sB.Info("Введите пароль"); } else if (string.IsNullOrEmpty(cbRole.Text)) { sB.Info("Введите роль"); } else { dataBaseQuery.SqlQuery("INSERT INTO dbo.[User] (Login, Password, IdRole) " + $"VALUES ('{tbLogin.Text}', '{tbPassword.Text}', (SELECT Id FROM dbo.[Role] " + $"WHERE NameRole = '{cbRole.Text}'))", "Данные успешно добавлены", "Пользователь с таким логином уже есть"); tbLogin.Clear(); tbPassword.Clear(); cbRole.SelectedItem = null; dG.Loader("SELECT * FROM dbo.[UserRole]"); } }
private void tbSearch_TextChanged(object sender, TextChangedEventArgs e) { dG.Loader("SELECT FirstName + N' ' + LastName as Recipient, " + "Address, PhoneNumber, Email FROM dbo.Recipient " + $"WHERE[FirstName] LIKE '%{tbSearch.Text}%' or" + $"[LastName] LIKE '%{tbSearch.Text}%'"); }
private void tbSearch_TextChanged(object sender, TextChangedEventArgs e) { dG.Loader("SELECT FirstName + N' ' + LastName as Client, " + "Address, PhoneNumber, Email FROM dbo.Client " + $"WHERE[FirstName] LIKE '%{tbSearch.Text}%' or" + $"[LastName] LIKE '%{tbSearch.Text}%'"); tbEditAddress.Clear(); tbEditFirstName.Clear(); tbEditLastName.Clear(); tbEditEmail.Clear(); tbEditPhoneNumber.Clear(); }
public ProductView() { InitializeComponent(); dG = new DG(dgProduct, snack, snackMessage); sB = new SB(snack, snackMessage); dataBaseQuery = new DataBaseQuery(snack, snackMessage); comboBoxAddStrength = new CB(cbStrength, snack, snackMessage); comboBoxEditStrength = new CB(cbEditStrength, snack, snackMessage); comboBoxAddStrength.Loader("Strength", "NameStrength"); comboBoxEditStrength.Loader("Strength", "NameStrength"); this.Loaded += delegate { dG.Loader("SELECT * FROM dbo.[ProductStrength]"); }; snackMessage.ActionClick += delegate { dG.CloseSnackbar(); }; }
public DirectorRecipientView() { InitializeComponent(); dG = new DG(dgRecipient, snack, snackMessage); this.Loaded += delegate { dG.Loader("SELECT Id, FirstName + N' ' + LastName as Recipient," + " Address, PhoneNumber, Email FROM dbo.Recipient"); }; snackMessage.ActionClick += delegate { dG.CloseSnackbar(); }; }
public DirectorSupplierView() { InitializeComponent(); dG = new DG(dgSupplier, snack, snackMessage); this.Loaded += delegate { dG.Loader("SELECT * FROM dbo.[Supplier]"); }; snackMessage.ActionClick += delegate { dG.CloseSnackbar(); }; }
public DirectorProductView() { InitializeComponent(); dG = new DG(dgProduct, snack, snackMessage); this.Loaded += delegate { dG.Loader("SELECT * FROM dbo.[ProductStrength]"); }; snackMessage.ActionClick += delegate { dG.CloseSnackbar(); }; }
public SupplierView() { InitializeComponent(); dG = new DG(dgSupplier, snack, snackMessage); sB = new SB(snack, snackMessage); dataBaseQuery = new DataBaseQuery(snack, snackMessage); this.Loaded += delegate { dG.Loader("SELECT * FROM dbo.[Supplier]"); }; snackMessage.ActionClick += delegate { dG.CloseSnackbar(); }; }
public ClientView() { InitializeComponent(); dG = new DG(dgClient, snack, snackMessage); sB = new SB(snack, snackMessage); dataBaseQuery = new DataBaseQuery(snack, snackMessage); this.Loaded += delegate { dG.Loader("SELECT Id, FirstName + N' ' + LastName as Client," + " Address, PhoneNumber, Email FROM dbo.Client"); }; snackMessage.ActionClick += delegate { dG.CloseSnackbar(); }; }
private void tbSearch_TextChanged(object sender, TextChangedEventArgs e) { dG.Loader("SELECT * FROM dbo.[Supplier] " + $"WHERE [Name] LIKE '%{tbSearch.Text}%'"); }
private void tbSearch_TextChanged(object sender, TextChangedEventArgs e) { dG.Loader("SELECT * FROM dbo.[OrderView] " + $"WHERE [Article] LIKE '%{tbSearch.Text}%' " + $"and [Id] = '{App.IdUser}'"); }