Пример #1
0
        private void Enter_emp_bt_Click(object sender, EventArgs e)
        {
            try
            {
                string company_name     = Company_name_tb.Text.Trim();
                string password         = company_pass_tb.Text;
                bool   IsValid          = true;
                var    Employer_details = _db.Employer_details.FirstOrDefault(q => q.Company_name == company_name && q.Password == password);

                if (Employer_details == null)
                {
                    IsValid = false;
                    MessageBox.Show("Invalid user name and password entered");
                }

                if (IsValid)
                {
                    MessageBox.Show("Welcome ");

                    Employer_accountview Employer_accountview = new Employer_accountview();

                    Employer_accountview.Show();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Please re-enter username and password");
                //throw;
            }
        }
Пример #2
0
        private void Enter_emp_bt_Click(object sender, EventArgs e)
        {
            try
            {
                // SHA256 sha = SHA256.Create();

                string company_name = Company_name_tb.Text.Trim();
                string password     = company_pass_tb.Text;
                bool   IsValid      = true;

                var hashed_password = Utils.HashedPassword(password);

                var Employer_details = _db.Employer_details.FirstOrDefault(q => q.Company_name == company_name && q.Password == hashed_password);

                if (Employer_details == null)
                {
                    IsValid = false;
                    MessageBox.Show("Invalid user name and password entered");
                }

                if (IsValid)
                {
                    MessageBox.Show("Welcome" + " " + Employer_details.Company_name);



                    var EmployerID = Employer_details.id;
                    this.Hide();
                    var Employer_accountview = new Employer_accountview(EmployerID);


                    Employer_accountview.ShowDialog();
                    this.Close();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Please re-enter username and password");
                //throw;
            }
        }