コード例 #1
0
        private void MemberHB_Click(object sender, EventArgs e)
        {
            MemberAccount mb = new MemberAccount();

            mb.Show();
            this.Hide();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Uresha/PensionSheme
        private void Login_Click(object sender, EventArgs e)
        {
            try
            {
                //MySqlConnection con = new MySqlConnection(@DBStr.connectionString);//"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Kasun\source\WebSites\WebSite4\App_Data\Database.mdf;Integrated Security=True");
                //MySqlDataAdapter sql = new MySqlDataAdapter("select count(*) from Admin where LoginName='" + UserName.Text + "' AND AdminPassword='******'", con);

                //DataTable dt = new DataTable();
                //DataTable type = new DataTable();
                //sql.Fill(dt);

                bool x = mem.CheckAdminPassword(UserName.Text, AdminPassword.Text);


                if (x)//dt.Rows[0][0].ToString() == "1"
                {
                    AdminVO ad = mem.LoginAdmin(UserName.Text, AdminPassword.Text);
                    //MySqlDataAdapter check = new MySqlDataAdapter("select AccountType,OperatingEmployeeID from Admin where LoginName='" + UserName.Text + "' AND AdminPassword='******'", con);

                    //check.Fill(type);
                    Log.LoginName         = UserName.Text;
                    Log.OperatingEmployee = ad.OperatingEmployeeID.ToString(); //type.Rows[0][1].ToString();
                    Log.Type = ad.AccountType.ToString();                      //type.Rows[0][0].ToString();
                    int type = ad.AccountType;
                    if (type == 1)
                    {
                        this.Hide();
                        Payment p = new Payment();
                        p.Show();
                    }
                    else if (type == 2)
                    {
                        this.Hide();
                        Contribution c = new Contribution();
                        c.Show();
                    }

                    else if (type == 3)
                    {
                        this.Hide();
                        MemberAccount m = new MemberAccount();
                        m.Show();
                    }
                    else if (type == 4)
                    {
                        this.Hide();
                        MainAdmin m = new MainAdmin();
                        m.Show();
                    }
                    else
                    {
                        MessageBox.Show("You Do not have system privilleges");
                    }
                }
                else
                {
                    MessageBox.Show("Check your username or password");
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
            }
        }