Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple Multi-Tier example in C#?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
Jet/Access Engine
Divers
Thread ID:
01074638
Message ID:
01075121
Vues:
18
Cecil,

OK, as Gary said, you need to have a constructor in your Biz_Tier class that takes two paramters if you want to instantiate your Biz_Tier class this way. But, I bet what you really want is just to call a method on the Biz_Tier class that returns your TotalPrice, rather than pass those two parms into the constructor of the class. So, your code would be something like this:
        private void addButton_Click(object sender, EventArgs e)
        {
            //Instantiate a business tier object.
            Biz_Tier aOrder = new Biz_Tier();

            //Get the total price
            this.TotalPriceTextBox.Text = aOrder.GetTotalPrice(this.unitPriceTextBox.Text, this.unitsTextBox.Text);
        }
~~Bonnie


>Well, it is middle tier. I am in a C# class in whcih we were given very little of any guidance and were only told to have a business tier, a very simple one. We obtain the data in the first form from an ACCESS database wherein we display a Price and the number of units and the number of untis times that price to get a total price for clkeanign a home's carpets.
>
>We call the biz_tier with two parameters inside the parens such as:
>(From the main form called JobForm).
>
>
>        private void quoteButton_Click(object sender, EventArgs e)
>        {
>            quoteForm openForm = new quoteForm(); // instantiate the openForm object from the quoteForm form.
>            openForm.Show();
>        }
>
>        private void addButton_Click(object sender, EventArgs e)
>        {
>            //Instantiate a business tier object.
>
>            Biz_Tier aOrder = new
>                Biz_Tier(this.unitPriceTextBox.Text, this.unitsTextBox.Text);
>        }
>
>
>We (our group) have two buttons, one being the add button mentioned above.
>
>We want to display the value of the number of units times the price of those untis multiplied.
>
>I keep getting an error thqt says: "No overload for method Biz_Tier, takes 2 arguments."
>
>Cecil
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform