Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            IUserService sevice = new UserService.UserService(new HashService(new SHA384Managed(), new RNGCryptoServiceProvider()), new UserDao());


            var t = sevice.Authorize("tesUser", "TestS9tring");
        }
Ejemplo n.º 2
0
        private void bLogin_Click(object sender, EventArgs e)
        {
            Hide();
            //var service = new UserService.UserService("Server=(local); Database= db_Browsing_history; Trusted_Connection = True;");
            var service = new UserService.UserService("Server=DESKTOP-U8HPG5P; Database= Бытовой прокат; Trusted_Connection = True;");
            //var service = new UserService.UserService("Бытовой прокат", tBoxLogin.Text, tBoxPass.Text);
            // сюда можешь вставить свой свитч
            /*if (service.GetCurrentRole() == "administrator")
            {
                new FormAdmin(this, service).ShowDialog();
                return;
            }*/

            new FormUser(this, service).ShowDialog();
        }
Ejemplo n.º 3
0
 public FormUser(Form backForm, UserService.UserService service)
 {
     InitializeComponent();
     _backForm = backForm;
     //_tablesList = tablesList;
     _service = service;
     //_role = service.GetCurrentRole();
     _role = "";
     if (_role == "user")
     {
         bQuery.Visible = false;
         bAdd.Visible = false;
         bDelete.Visible = false;
         bEdit.Visible = false;
     }
     foreach (var table in _service.Tables)
         listBoxTables.Items.Add(table.Name);
 }
Ejemplo n.º 4
0
        public FormEdit_Add_(UserService.UserService service, Form backForm, List<string> columns,
            string tableName, List<string> record = null)
        {
            _service = service;
            _backForm = backForm;
            _tableName = tableName;
            _record = record;

            InitializeComponent();
            dataGridView1.ColumnCount = columns.Count;
            for (var i = 0; i < columns.Count; i++)
                dataGridView1.Columns[i].Name = columns[i];
            if (record != null)
            {
                dataGridView1.Rows.Add();
                for (var i = 0; i < record.Count; i++)
                    dataGridView1.Rows[0].Cells[i].Value = record[i];
            }
            else
                dataGridView1.Rows.Add();
        }