Reputation: 57
I'm using making an money transfer application and API is used to store my data in Server and have my Db in local system,when customer have permission to change their mobile number, the changes will be done in my local system not in Server,but when i do a transaction for that customer, the customer mobile number is to be checked where any modification has been done or not, if so then the changes should be updated in the server and then the transaction should be done.
My Solution:
I had placed a field called modify in my DB if its flag is set to 1,it identify that the changes has been done, and try to update in server,
My problem:
I need to get my customer details from my edit page and need to provide in my transaction page,so can any one say how can i bring my customer details..
Thanks in Advance.
I think to use session,but it wont works..so can any one say how can i get the customer details..
My Code:
txtFname.Text = dt.Rows[0]["FirstName"].ToString();
Session.Add("txtFname", txtFname.Text);
txtLname.Text = dt.Rows[0]["LastName"].ToString();
Session.Add("txtLname", txtLname.Text);
txtEmail.Text = dt.Rows[0]["Email"].ToString();
Session.Add("txtEmail", txtEmail.Text);
txtMobile.Text = dt.Rows[0]["MobilePhone"].ToString();
lblMobile.Text = dt.Rows[0]["MobilePhone"].ToString();
Session.Add("txtMobile", txtMobile.Text);
Upvotes: 0
Views: 183
Reputation: 1553
try to use this way:
txtFname.Text = dt.Rows[0]["FirstName"].ToString();
Session["txtFname"] = txtFname.Text;
txtLname.Text = dt.Rows[0]["LastName"].ToString();
Session["txtLname"] = txtLname.Text;
txtEmail.Text = dt.Rows[0]["Email"].ToString();
Session["txtEmail"] = txtEmail.Text;
txtMobile.Text = dt.Rows[0]["MobilePhone"].ToString();
lblMobile.Text = dt.Rows[0]["MobilePhone"].ToString();
Session["txtMobile"] = txtMobile.Text;
Session["lblMobile"] = lblMobile.Text;
then at another page calling all the session:
lblMobile.text = Session["lblMobile"].ToString();
txtMobile.text = Session["txtMobile"].ToString();
lblEmail.text = Session["txtEmail"].ToString();
lblLName.text = Session["txtLname"].ToString();
lblFName.text = Session["txtFname"].ToString();
hope this can help you.
Upvotes: 1
Reputation: 113
You can save information in a XML file.Name XML with SessionId or LogIn User ID.
using (XmlWriter writer = XmlWriter.Create(<FilePath>)) {
writer.WriteStartDocument();
writer.WriteStartElement("UserInfo");
writer.WriteElementString("FirstName", "ABC");
writer.WriteElementString("Email", "[email protected]");
-----
writer.WriteEndElement();
writer.WriteEndDocument();
}
And then Read XML in in next page... NOTE Name The XML as LogIn UserId So you can access the file correct file .... If you working on money transfer apis i thinks using a XML is best option.... Ask question if u having any doubt.
Upvotes: 1