Exemplo n.º 1
0
        private void txtusername_TextChanged(object sender, EventArgs e)
        {
            db = new DCbankDataContext();
            var Query_User = db.sp_verifyusername(txtusername.Text);

            foreach (sp_verifyusernameResult entry in Query_User)
            {
                lblverifyUser.Text = "Username is taken";
            }
        }
Exemplo n.º 2
0
        public frmRegister()
        {
            InitializeComponent();

            db = new DCbankDataContext();
            var Query_User = db.sp_verifyusername(txtusername.Text);

            foreach (sp_verifyusernameResult entry in Query_User)
            {
                Username = entry.username.ToString();
            }
        }
Exemplo n.º 3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            db = new DCbankDataContext();
            if (txtuser.Text.Equals("") || txtpass.Text.Equals(""))
            {
                lblAction.Text = "Fill up Everything";
            }
            else
            {
                int count       = 0;
                var Query_Login = db.sp_verifyusernamepass(txtuser.Text, encrypt(txtpass.Text));
                foreach (sp_verifyusernamepassResult entry in Query_Login)
                {
                    if (entry.isactive.Equals("ACTIVE"))
                    {
                        Username   = entry.username.ToString();
                        UserType   = entry.usertype.ToString();
                        NameOfUser = entry.name.ToString();
                        Password   = entry.password.ToString();

                        this.Hide();
                        frmMain M = new frmMain();
                        M.Show();
                    }
                    else
                    {
                        lblAction.Text = "Your Account is not Active";
                    }
                    count++;
                }
                if (count.Equals(0))
                {
                    int count1     = 0;
                    var Query_User = db.sp_verifyusername(txtuser.Text);
                    foreach (sp_verifyusernameResult entry in Query_User)
                    {
                        lblAction.Text = "Incorrect Password";
                        count1++;
                    }
                    if (count1.Equals(0))
                    {
                        lblAction.Text = "Invalid Account";
                    }
                }
            }
        }