protected void btnCreateChallan_Click(object sender, EventArgs e) { objBill aBill = new objBill(); string sms = ""; if (createBillButtonVerification()) { aBill.intBillId = Convert.ToInt32(lblBillNo.Text); aBill.dteDate = Convert.ToDateTime(txtBillDate.Text); aBill.strBOE = txtBOE.Text; aBill.strPartyName = drpChallanInName.Text; aBill.strPartyAddress = txtChallanInAddress.Text; aBill.strCurrency = drpCurrency.Text; aBill.strRemark = txtRemark.Text; sms = objBill.UpdateBill(aBill, hdnChallanNo.Text, lblTotal.InnerText); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('" + sms + "')", true); clearData(); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Fields can not be empty!!!.')", true); } }
public string UpdateBill(objBill aBill, string challans, string total) { try { updateBillTableAdapter adp = new updateBillTableAdapter(); insertToCashMemoTableAdapter adp2 = new insertToCashMemoTableAdapter(); insertIntoLedgerTableAdapter adp3 = new insertIntoLedgerTableAdapter(); adp.UpdateBill(aBill.intBillId, aBill.dteDate, aBill.strBOE, aBill.strPartyAddress, aBill.strCurrency, aBill.strRemark, challans); adp2.InsertToCashMemo(aBill.intBillId, aBill.strPartyName, Convert.ToDouble(total)); adp3.InsertIntoLedger(aBill.intBillId, aBill.strPartyName, aBill.dteDate, Convert.ToDouble(total), "BILL"); return("Bill is created successfully."); } catch (Exception e) { return("error"); } }