コード例 #1
0
    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        try
        {
            CommunityAssistEntities2 ca = new CommunityAssistEntities2();
            PassCodeGenerator        pg = new PassCodeGenerator();
            int          passcode       = pg.GetPassCode();
            PasswordHash ph             = new PasswordHash();
            Person       p = new Person();
            p.PersonFirstName     = txtfirst.Text;
            p.PersonLastName      = txtlast.Text;
            p.PersonUsername      = txtemail.Text;
            p.PersonPlainPassword = txtpassword.Text;
            p.Personpasskey       = passcode;
            p.PersonUserPassword  = ph.HashIt(txtconfirm.Text, passcode.ToString());


            ca.People.Add(p);
            ca.SaveChanges();

            Response.Redirect("Default.aspx");
        }
        catch (Exception ex)
        {
            lblerror.Text = ex.Message;
        }
    }
コード例 #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            CommunityAssistEntities2 ca = new CommunityAssistEntities2();

            Donation d   = new Donation();
            DateTime now = DateTime.Now;
            decimal  amt = decimal.Parse(txtamt.Text);
            d.DonationAmount = amt;
            d.DonationDate   = now;
            ca.Donations.Add(d);
            ca.SaveChanges();

            Response.Redirect("ThankYou.aspx");
        }
        catch (Exception ex)
        {
            lblerror.Text = ex.Message;
        }
    }
コード例 #3
0
ファイル: Grant.aspx.cs プロジェクト: acdickin/WebSite6
    protected void btnGrant_Click(object sender, EventArgs e)
    {
        try
        {
            CommunityAssistEntities2 ca = new CommunityAssistEntities2();

            ServiceGrant g   = new ServiceGrant();
            DateTime     now = DateTime.Now;
            decimal      amt = decimal.Parse(txtgamt.Text);
            g.GrantAmount = amt;

            g.GrantDate = now;
            ca.ServiceGrants.Add(g);
            ca.SaveChanges();

            Response.Redirect("ThankYou.aspx");
        }
        catch (Exception ex)
        {
            lblerror.Text = ex.Message;
        }
    }