protected void btnupd_Click(object sender, EventArgs e) { System.Text.StringBuilder xmlexchrate = new System.Text.StringBuilder(); xmlexchrate.Append("'<exchrate>"); foreach (GridViewRow gr in GridViewExch.Rows) { double exchamount = 0; if (double.TryParse(((TextBox)gr.Cells[2].FindControl("txtrate")).Text, out exchamount)) { } xmlexchrate.Append("<component currcode= \"" + Convert.ToInt32(GridViewExch.DataKeys[gr.RowIndex]["Curr_code"].ToString()) + "\"" + " "); xmlexchrate.Append(" Base_curr=\"" + Convert.ToInt32(GridViewExch.DataKeys[gr.RowIndex]["bcurr"].ToString()) + "\"" + " "); xmlexchrate.Append(" Exch_rate=\"" + exchamount + "\"" + " "); xmlexchrate.Append(" idloop=\"" + gr.RowIndex + "\"" + " />"); } xmlexchrate.Append("</exchrate>'"); BLL_Infra_ExchangeRate objExch = new BLL_Infra_ExchangeRate(); try { objExch.ACC_Ins_Exchrate_XML(xmlexchrate.ToString()); } catch { } }
protected void DDLCurrency_SelectedIndexChanged(object sender, EventArgs e) { BLL_Infra_ExchangeRate objexch = new BLL_Infra_ExchangeRate(); hdfExchrate.Value = objexch.ACC_Get_ExchRate_By_Code(DDLCurrency.SelectedItem.Text).ToString(); string CalculateTotal = String.Format("CalculateTotal();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "CalculateTotal", CalculateTotal, true); }