So I duplicated a web service that generates pricing for things at our work to add on to the new service for testing before we make any changes. So I made a simple change to this new web service. We have a formula class file. I made one change:
Formula.cs:
public Formula()
{
}
public Formula(int material)
{
switch (material)
{
case 0:
this.V26 = 50;
break;
case 1:
this.V26 = 30;
break;
default: this.V26 = 50; break;
}
}
I added the option to leave out a material id b/c the old code uses one material so I want backwards compatibility.
This is the code I wrote into the web service, which before, just didn't have the integer in it.
WebService.amsx.cs
public static void _Quote(int dbQuoteId, int[] quantity, double resinType, double layerThickness, int gl_material, out double quoteAmount)
{
Formula quote = new Formula(1);
It still calls the first function of the Formula class. It refuses to call the second method I wrote. Why? I mean logic should FORCE it to at this point. I am telling it to use the second method, however it uses the first...
Question
sathenzar
So I duplicated a web service that generates pricing for things at our work to add on to the new service for testing before we make any changes. So I made a simple change to this new web service. We have a formula class file. I made one change:
Formula.cs:
public Formula() { } public Formula(int material) { switch (material) { case 0: this.V26 = 50; break; case 1: this.V26 = 30; break; default: this.V26 = 50; break; } }I added the option to leave out a material id b/c the old code uses one material so I want backwards compatibility.
This is the code I wrote into the web service, which before, just didn't have the integer in it.
WebService.amsx.cs
public static void _Quote(int dbQuoteId, int[] quantity, double resinType, double layerThickness, int gl_material, out double quoteAmount) { Formula quote = new Formula(1);It still calls the first function of the Formula class. It refuses to call the second method I wrote. Why? I mean logic should FORCE it to at this point. I am telling it to use the second method, however it uses the first...
Link to comment
Share on other sites
16 answers to this question
Recommended Posts