protected void gvPmtHistory_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.ToUpper() == "VOID") { GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int index = gvr.RowIndex; Label lblTransactionNumber = (Label)gvPmtHistory.Rows[index].FindControl("lblTransactionNumber"); BusLogic objBuslogic = new BusLogic(); string strReturn = objBuslogic.VoidPayment(txtaccountno.Text.Trim(), lblTransactionNumber.Text.Trim()); if (strReturn.ToUpper() == "OK") { ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "javascript:alert('Payment Voided Successfully ' );", true); PaymentHistory(); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "javascript:alert('Payment Void Failed, Plesae try after sometime! ' );", true); } } else if (e.CommandName.ToUpper() == "REVERSE") { GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int index = gvr.RowIndex; Label lblTransactionNumber = (Label)gvPmtHistory.Rows[index].FindControl("lblTransactionNumber"); BusLogic objBuslogic = new BusLogic(); string strReturn = objBuslogic.ReversePayment(txtaccountno.Text.Trim(), lblTransactionNumber.Text.Trim()); if (strReturn.ToUpper() == "OK") { ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "javascript:alert('Payment Reversed Successfully ' );", true); PaymentHistory(); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "javascript:alert('Payment Reverse Failed, Plesae try after sometime! ' );", true); } } }