public int PersonLogin(string user, string password)
    {
        int key    = 0;
        int result = cae.usp_Login(user, password);

        if (result != -1)
        {
            var ukey = (from p in cae.People
                        where p.PersonEmail.Equals(user)
                        select p.PersonKey).FirstOrDefault();
            key = (int)ukey;
        }
        return(key);
    }
Пример #2
0
    public int Login(string user, string password)
    {
        int key    = 0;
        int result = db.usp_Login(user, password);

        if (result != -1)
        {
            var userKey = (from k in db.People
                           where k.PersonKey.Equals(user)
                           select k.PersonKey).FirstOrDefault();
            key = (int)userKey;
        }
        return(key);
    }
Пример #3
0
    public int Login(string email, string password)
    {
        int key    = 0;
        int result = db.usp_Login(email, password);

        if (result != -1)
        {
            var personKey = (from k in db.People
                             where k.PersonEmail.Equals(email)
                             select k.PersonKey).FirstOrDefault();
            key = (int)personKey;
        }
        return(key);
    }
Пример #4
0
    //login and PersonKey

    public int Login(string email, string password)
    {
        //just like the login we did in the last assignment
        int key    = 0;
        int result = db.usp_Login(email, password);

        if (result != -1)
        {
            var userKey = (from p in db.People
                           where p.PersonEmail.Equals(email)
                           select p.PersonKey).FirstOrDefault();
            key = (int)userKey;
        }

        return(key);
    }
Пример #5
0
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        Community_AssistEntities cae = new Community_AssistEntities();
        int result = cae.usp_Login(UserNameTextBox.Text, PasswordTextBox.Text);

        if (result != -1)
        {
            string email = UserNameTextBox.Text;
            var    key   = (from p in cae.People where p.PersonEmail.Equals(email) select p.PersonKey).FirstOrDefault();
            int    pKey  = (int)key;
            Session["userKey"] = key;
            Response.Redirect("Donate.aspx");
        }
        else
        {
            ErrorLabel.Text = "Invalid login";
        }
    }
Пример #6
0
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        int key = 0;
        Community_AssistEntities db = new Community_AssistEntities();
        int success = db.usp_Login(UserEmailTextBox.Text, PasswordTextBox.Text);

        if (success != -1)
        {
            var uKey = (from k in db.People
                        where k.PersonEmail.Equals(UserEmailTextBox.Text)
                        select k.PersonKey).FirstOrDefault();
            key = (int)uKey;
            Session["userKey"] = key;
            Response.Redirect("Donate.aspx");
        }
        else
        {
            ResultLabel.Text = "Invalid Login";
        }
    }
Пример #7
0
    protected void LogInButton_Click(object sender, EventArgs e)
    {
        int key = 0;
        Community_AssistEntities db = new Community_AssistEntities();
        int success = db.usp_Login(UserTextBox.Text, passwordTextBox.Text);

        if (success != -1)
        {
            var ukey = (from k in db.People
                        where k.PersonEmail.Equals(UserTextBox.Text)
                        select k.PersonKey).FirstOrDefault();

            key = (int)ukey;
            Session["PersonKey"] = key;
            Response.Redirect("donation.aspx");
        }
        else
        {
            Response.Redirect("Register.aspx");
        }
    }
Пример #8
0
    public int Login(string email, string password)
    {
        {
            int key    = 0;
            int result = db.usp_Login(email, password);

            //Community_AssistEntities db = new Community_AssistEntities();
            //int success = db.usp_Login(email, password);

            if (result != -1)
            {
                var uKey = (from k in db.People
                            where k.PersonEmail.Equals(email)
                            select k.PersonKey).FirstOrDefault();

                key = (int)uKey;
            }

            return(key);
        }
    }
Пример #9
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        string user     = UserTextBox.Text;
        string first    = FirstNameTextBox.Text;
        string last     = LastNameTextBox.Text;
        string email    = EmailTextBox.Text;
        string password = ConfirmTextBox.Text;


        Community_AssistEntities db = new Community_AssistEntities();
        int result = db.usp_Login(user, first, last, email, password);

        if (result != -1)
        {
            Response.Redirect("Default.aspx");
        }
        else
        {
            ErrorLabel.Text = "Something went terribly wrong";
        }
    }
Пример #10
0
    protected void LogInButton1_click(object sender, EventArgs e)
    {
        int key = 0;
        Community_AssistEntities db = new Community_AssistEntities();
        int success = db.usp_Login(UserTextBox.Text, PasswordTextBox.Text);

        if (success != -1)
        {
            var userKey = (from K in db.People
                           where K.PersonEmail.Equals(UserTextBox.Text)
                           select K.PersonKey).FirstOrDefault();

            key = (int)userKey;
            Session["userKey"] = key;
            ResultLabel1.Text  = "Welcome";
        }
        else
        {
            ResultLabel1.Text = "Invalid Login";
        }
    }
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        clientServiceReference.IcommunityServiceClient sc = new clientServiceReference.IcommunityServiceClient();

        int result = sc.Login(UserTextBox.Text, PasswordTextBox.Text);

        if (result != 0)

        {
            Session["userkey"] = result;
            ResultLabel.Text   = " welcome";
        }
        else
        {
            ResultLabel.Text = "invalid login";
        }


        int key = 0;
        Community_AssistEntities db = new Community_AssistEntities();
        int success = db.usp_Login(UserTextBox.Text, PasswordTextBox.Text);

        if (success != -1)

        {
            var ukey = (from k in db.People
                        where k.PersonEmail.Equals(UserTextBox.Text)
                        select k.PersonKey).FirstOrDefault();

            key = (int)ukey;
            Session["userkey"] = key;
            Response.Redirect("GrantView.aspx");
        }

        else
        {
            ResultLabel.Text = " Invalid login Please Register;";
        }
    }
Пример #12
0
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        int key = 0;
        Community_AssistEntities db = new Community_AssistEntities();
        int success = db.usp_Login(UserTextBox.Text, PasswordTextBox.Text);

        if (success != -1)

        {
            var ukey = (from k in db.People
                        where k.PersonEmail.Equals(UserTextBox.Text)
                        select k.PersonKey).FirstOrDefault();

            key = (int)ukey;
            Session["userkey"] = key;
        }

        else
        {
            ResultLabel.Text = " Invalid login Please Register;";
        }
    }