protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e) { string strMsg = string.Empty; if (e.CommandName == "cmdedit") { Response.Redirect("Quotation.aspx?q=" + e.CommandArgument, true); } if (e.CommandName == "cmddelete") { Int64 UserIdno = Convert.ToInt64(Session["UserIdno"]); QuotationDAL obj = new QuotationDAL(); Int32 intValue = obj.DeleteQuotation(Convert.ToInt32(e.CommandArgument), UserIdno, ApplicationFunction.ConnectionString()); obj = null; if (intValue > 0) { this.BindGrid(); strMsg = "Record deleted successfully."; txtQutNo.Focus(); } else { if (intValue == -1) { strMsg = "Record can not be deleted. It is in use."; } else { strMsg = "Record not deleted."; } } ScriptManager.RegisterStartupScript(this, this.GetType(), "alertstrMsg", "PassMessage('" + strMsg + "')", true); } }
public bool DeleteQuotation(int quotationID, int modifiedBy) { return(quotationDAL.DeleteQuotation(quotationID, modifiedBy)); }