protected void btnUpdate_Click(object sender, EventArgs e) { itemRate = new ItemRate(); purchaseData = new PurchaseData(); itemRate.ItemRatesId = Convert.ToInt32(hfItemRatesId.Value); itemRate.VendorId = Convert.ToInt32(dpVendor1.SelectedItem.Value); itemRate.ItemId = Convert.ToInt32(dpItem.SelectedItem.Value); itemRate.Quantity = string.IsNullOrEmpty(txtQuantity.Text.ToString()) ? 0 : Convert.ToDouble(txtQuantity.Text); itemRate.UnitId = Convert.ToInt32(dpUnit.SelectedItem.Value); itemRate.Quantity = string.IsNullOrEmpty(txtQuantity.Text.ToString()) ? 0 : Convert.ToDouble(txtQuantity.Text); itemRate.Price = string.IsNullOrEmpty(txtPrice.Text.ToString()) ? 0 : Convert.ToDecimal(txtPrice.Text); itemRate.Shipping = string.IsNullOrEmpty(txtShipping.Text.ToString()) ? 0 : Convert.ToDecimal(txtShipping.Text); itemRate.Excise = string.IsNullOrEmpty(txtExcise.Text.ToString()) ? 0 : Convert.ToDouble(txtExcise.Text); itemRate.CST = string.IsNullOrEmpty(txtCst.Text.ToString()) ? 0 : Convert.ToDouble(txtCst.Text); itemRate.VAT = string.IsNullOrEmpty(txtVat.Text.ToString()) ? 0 : Convert.ToDouble(txtVat.Text); itemRate.Insurance = string.IsNullOrEmpty(txtInsurance.Text.ToString()) ? 0 : Convert.ToDecimal(txtInsurance.Text); itemRate.Freight = string.IsNullOrEmpty(txtFreight.Text.ToString()) ? 0 : Convert.ToDecimal(txtFreight.Text); itemRate.TotalPrice = string.IsNullOrEmpty(txtTotalPrice.Text.ToString()) ? 0 : Convert.ToDecimal(txtTotalPrice.Text); itemRate.Flag = 2; //1 for Update int Result = 0; Result = purchaseData.ItemRatesDML(itemRate); if (Result > 0) { // ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "$('.modal-backdrop').removeClass(.modal-backdrop);", true); divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Item Rate Updated Successfully"; ClearTextBox(); pnlError.Update(); UpdateList(itemRate.VendorId); upMain.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }