16,007,885 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by aspkiddy (Top 5 by date)
aspkiddy
1-Feb-11 16:49pm
View
How I can declare it at the top of the method ?
public partial class ConfirmationDonationForm : System.Web.UI.Page { private FormConfirmationPageState mFormConfirmationPageState; string cost; //!!!!!!!!!!!!!!!!!!!! int newVal; //!!!!!!!!!!!!!!!!!!!!
aspkiddy
1-Feb-11 15:30pm
View
Hi Nishant Sivakumar,
how can i declare it on top of the method ? which method ?
namespace TotoCommerce
{
///
/// Summary description for DonationForm.
///
public partial class ConfirmationDonationForm : System.Web.UI.Page
{
private FormConfirmationPageState mFormConfirmationPageState;
string cost; //!!!!!!!!!!!!!!!!!!!!
int newVal; //!!!!!!!!!!!!!!!!!!!!
protected void Page_Load(object sender, System.EventArgs e)
{
LoadPageState();
LoadLabels();
}
private void LoadPageState()
{
object pageState = Session["FormConfirmationPage"];
if (pageState != null)
{
mFormConfirmationPageState = (FormConfirmationPageState)pageState;
}
else
{
}
}
private void SavePageState()
{
Session["FormConfirmationPage"] = mFormConfirmationPageState;
}
private void LoadLabels()
{
object FormPageState = Session["FormPage"];
DonationForm.FormPageState s = (DonationForm.FormPageState)FormPageState;
mPrenomNomLabel.Text = s.FirstName + " " + s.LastName;
mAmountLabel.Text = s.AmountContribution; //!!!!!!!!!!!!!!!!!!!! 22.00
cost = s.AmountContribution;
double doubleVal = 0.0;
if (Double.TryParse(cost, out doubleVal))
{
int newVal = (int)doubleVal * 100;
mAmountLabel.Text = newVal.ToString();//!!!!!!!!!!!!!!!!!!!! 2200
// save this value
}
protected void SubscribeButton_Click(object sender, System.EventArgs e)
{
SubscribeButton.Enabled = false;
ButtonRectifier0.Enabled = false;
string strFacturation;
strFacturation = (string)Session["Facturation"];
if (strFacturation != "EnCours")
{
Session["Facturation"] = "EnCours";
object FormPageState = Session["FormPage"];
DonationForm.FormPageState s = (DonationForm.FormPageState)FormPageState;
string strParametre = "0?,A1" + newVal.ToString() + ",DT" + DateTime.Now.ToString("MMddyyyyHHmm"); //!!!!!!!!!!!!!!!!!!!! 0
aspkiddy
1-Feb-11 14:43pm
View
How I cant use easily Decimal to store the prices ?
aspkiddy
1-Feb-11 14:42pm
View
Hi Nishant,
It's work with
mPriceLabel.Text = newVal.ToString();
I see 2200 on mPriceLabel
it's great
How I can remove [If condition] ?
Beacouse I must sent this information on transaction serveur :
If I use :
string cost = s.AmountContribution;
double doubleVal = 0.0;
if (Double.TryParse(cost, out doubleVal))
{
int newVal = (int)doubleVal * 100;
//mPriceLabel.Text = newVal.ToString();
}
string strParametre = "0?,A1" + newVal.ToString() + ",DT" + DateTime.Now.ToString("MMddyyyyHHmm"); //line 223
I have this error :
Compiler Error Message: CS0103: The name 'newVal' does not exist in the current context : line 223
aspkiddy
1-Feb-11 14:24pm
View
Hi,
Now What I do ?
My code as like your code :
1st screen :
private void SetPageState()
{
int amountInt = int.Parse(mamountTextBox.Text);
mFormPageState.AmountContribution = amountInt.ToString("0.00");
SavePageState();
}
public struct FormPageState
{
public int amountInt;
public string AmountContribution;
}
and 2nd screen :
//(...)
mAmountLabel.Text = s.AmountContribution; // for user for exemple : 22.00
string cost = s.AmountContribution;
double doubleVal = 0.0;
if (Double.TryParse(cost, out doubleVal))
{
int newVal = (int)doubleVal * 100;
mPriceLabel.Text = newVal; // for check il I have 2200 or ...
}