-8
protected void btn_redeem_Click(object sender, EventArgs e)
{
int lol = int.Parse(lbl_TotalPrice.Text,System.Globalization.NumberStyles.Currency);
double nprice = lol * 0.05;
int newpoints=0 ;
if (int.Parse(Session["points"].ToString()) >= 1000)
{
double redeem = lol - nprice;
lbl_TotalPrice.Text = redeem.ToString("C");
newpoints = int.Parse(Session["points"].ToString()) - 1000;
}
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["HealthDBContext"].ConnectionString);
conn.Open();
string queryStr = "UPDATE Users SET Points ='" + newpoints + "'WHERE UserName=" + Session["New"].ToString();
SqlCommand com = new SqlCommand(queryStr, conn);
conn.Close();
}
你可以至少給的什麼是不工作的一些跡象。發生什麼錯誤/異常?代碼中的哪個位置? –
沒有例外消息?我們無法讀懂你的想法... – 2016-07-06 08:10:13
它沒有更新用戶的要點 –