Пример #1
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        if (Session["userKey"] == null)
        {
            Response.Redirect("default.aspx");
        }
        //float amount = AmountTextBox.Text;

        decimal amount = Convert.ToDecimal(AmountTextBox.Text);
        //string explantion = GrantExplanationBox.Text;
        //int type = Convert.ToInt16(TypeKeyTextBox.Text);
        int userKey = (int)Session["userKey"];

        ServiceReference1.ServiceClient sc =
            new ServiceReference1.ServiceClient();

        ServiceReference1.Donation donation = new ServiceReference1.Donation();

        donation.DonationAmount = amount;
        //grant.GrantRequestExplanation = explantion;
        donation.DonationDate = DateTime.Now;
        //donation.DonationKey = type;
        donation.PersonKey = userKey;


        bool result = sc.Donate(donation);

        if (result)
        {
            Response.Redirect("GetDonation.aspx");
        }
        else
        {
            ErrorLabel.Text = "Invalid Login";
        }
    }