protected void btnSubmit_Click(object sender, EventArgs e) { ProductData productdata = new ProductData(); Product product = new Product(); int Result = 0; Result = productdata.AddBillSequence(0, Convert.ToInt32(dpRoute.SelectedItem.Value), 0); foreach (ListItem li in SortedList.Items) { string str = li.Value; if (str.Contains('A')) { string str1 = str.Substring(1); int id = Convert.ToInt32(str1); int routeid = Convert.ToInt32(dpRoute.SelectedItem.Value); int flag = 1; // Result = productdata.AddBankInfo(product); Result = productdata.AddBillSequence(id, routeid, flag); } else if (str.Contains('E')) { string str1 = str.Substring(1); int id = Convert.ToInt32(str1); int routeid = Convert.ToInt32(dpRoute.SelectedItem.Value); int flag = 2; //Result = productdata.AddBankInfo(product); Result = productdata.AddBillSequence(id, routeid, flag); } } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Bill Sequence Submitted Successfully')", true); SortedList.Items.Clear(); FirstList.Items.Clear(); chkEmp.Checked = false; dpRoute.ClearSelection(); }