コード例 #1
0
ファイル: LoginForm.cs プロジェクト: alexsalo/CafeSystem
        private void yes_btn_Click(object sender, EventArgs e)
        {
            IQueryable<worker> userQuery = from w in cafeContext.worker
                                           where w.name + w.surname == login_tb.Text
                                           select w;
            if (userQuery.Any())
            {
                foreach (worker w in userQuery)
                    switch (m_departmentCallFrom)
                    {
                        case Constants.CASHIERDEP_ID:
                            if (w.department_id == Constants.CASHIERDEP_ID
                                || w.department_id == Constants.MANAGERDEP_ID)
                                if (MD5cheksum.verifyMd5Hash(pass_tb.Text, w.password))
                                {
                                    CashierFrom m_cashierForm = new CashierFrom(m_mainform);
                                    m_cashierForm.Show();
                                    this.Close();
                                }
                                else MessageBox.Show("Incorrect password");
                            else
                                MessageBox.Show("You don't have permission");
                            break;

                        case Constants.MANAGERDEP_ID:
                            if (w.department_id == Constants.MANAGERDEP_ID)
                                if (MD5cheksum.verifyMd5Hash(pass_tb.Text, w.password))
                                {
                                    ManagerForm m_managerForm = new ManagerForm(m_mainform);
                                    m_managerForm.Show();
                                    this.Close();
                                }
                                else MessageBox.Show("Incorrect password");
                            else
                                MessageBox.Show("You don't have permission");
                            break;
                        case Constants.COOCKERDEP_ID:
                            if (w.department_id == Constants.COOCKERDEP_ID)
                                if (MD5cheksum.verifyMd5Hash(pass_tb.Text, w.password))
                                {
                                    CookerForm m_cookerForm = new CookerForm(m_mainform);
                                    m_cookerForm.Show();
                                    this.Close();
                                }
                                else MessageBox.Show("Incorrect password");
                            else
                                MessageBox.Show("You don't have permission");
                            break;
                    }
            }
            else
                MessageBox.Show("No such login");
        }
コード例 #2
0
ファイル: Recipes.cs プロジェクト: alexsalo/CafeSystem
 public Recipes(ManagerForm f)
 {
     InitializeComponent();
     m_manageForm = f;
 }
コード例 #3
0
ファイル: ShowAllTables.cs プロジェクト: alexsalo/CafeSystem
 public ShowAllTables(ManagerForm F)
 {
     InitializeComponent();
     m_mangerForm = F;
 }