123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Data.SqlClient;
- namespace proba
- {
- public partial class MainMenu : Form
- {
- DataBase dataBase = new DataBase();
- public MainMenu()
- {
- InitializeComponent();
- dataBase.openConnection();
- SqlCommand sqlCommand_role = new SqlCommand($"SELECT R.role From Employee E inner join Roles R ON E.id_role = R.id_role WHERE E.login = '{PosleVHODA.login}'", dataBase.GetConnection());
- string role = sqlCommand_role.ExecuteScalar().ToString();
- if (role == "Администратор")
- {
- pictureBox_Employee.Visible = true;
- label_editingEmployee.Visible = true;
- label_employee.Visible = true;
- }
- else if(role == "Кассир")
- {
- pictureBox_personal_area.Visible = true;
- label_personal_area.Visible = true;
- }
- dataBase.closeConnection();
- }
- private void ButtonPostavshiki_Click(object sender, EventArgs e)
- {
- this.Hide();
- Postavshiki postavshiki = new Postavshiki();
- postavshiki.Show();
- }
- private void ButtonNomenklatura_Click(object sender, EventArgs e)
- {
- this.Hide();
- Nomenklatura nomenklatura = new Nomenklatura();
- nomenklatura.ShowDialog();
- }
- public void global_FormClosed(object sender, EventArgs e)
- {
- Application.Exit();
- }
- private void button_nomenklaturaAdd_Click(object sender, EventArgs e)
- {
- this.Hide();
- Nomenklaturaadd nomenklatura_Add = new Nomenklaturaadd();
- nomenklatura_Add.ShowDialog();
- }
- private void ButtonProdaja_Click(object sender, EventArgs e)
- {
- this.Hide();
- Sales sales = new Sales();
- sales.ShowDialog();
- }
- private void label10_Click(object sender, EventArgs e)
- {
- this.Hide();
- Postavshiki_add postavshiki_Add = new Postavshiki_add();
- postavshiki_Add.ShowDialog();
- }
- private void button_Country_Click(object sender, EventArgs e)
- {
- this.Hide();
- Country country = new Country();
- country.ShowDialog();
- }
- private void button_Country_add_Click(object sender, EventArgs e)
- {
- this.Hide();
- CountryAdd countryAdd = new CountryAdd();
- countryAdd.ShowDialog();
- }
- private void button_salesList_Click(object sender, EventArgs e)
- {
- this.Hide();
- Form2 form2 = new Form2();
- form2.ShowDialog();
- }
- private void button_genre_Click(object sender, EventArgs e)
- {
- this.Hide();
- Genre genre = new Genre();
- genre.ShowDialog();
- }
- private void label_genre_add_Click(object sender, EventArgs e)
- {
- this.Hide();
- Genre_add genre_Add = new Genre_add();
- genre_Add.ShowDialog();
- }
- private void button_Performer_Click(object sender, EventArgs e)
- {
- this.Hide();
- Performer performer = new Performer();
- performer.ShowDialog();
- }
- private void label_performer_Click(object sender, EventArgs e)
- {
- this.Hide();
- Performer_add performer_Add = new Performer_add();
- performer_Add.ShowDialog();
- }
- private void button_edition_Click(object sender, EventArgs e)
- {
- this.Hide();
- Издатель издатель = new Издатель();
- издатель.ShowDialog();
- }
- private void label_efition_Click(object sender, EventArgs e)
- {
- this.Hide();
- EditionAdd editionAdd = new EditionAdd();
- editionAdd.ShowDialog();
- }
- private void label_personal_area_Click(object sender, EventArgs e)
- {
- this.Hide();
- PersonalArea personalArea = new PersonalArea();
- personalArea.ShowDialog();
- }
- private void pictureBox_personal_area_Click(object sender, EventArgs e)
- {
- this.Hide();
- PersonalArea personalArea = new PersonalArea();
- personalArea.ShowDialog();
- }
- private void label_editingEmployee_Click(object sender, EventArgs e)
- {
- this.Hide();
- Employee employee = new Employee();
- employee.ShowDialog();
- }
- private void pictureBox_Employee_Click(object sender, EventArgs e)
- {
- this.Hide();
- Employee employee = new Employee();
- employee.ShowDialog();
- }
- }
- }
|