public static bool dgRowDeleting(int _OpCode, string SpName, string _RecFieldID, ref GridView dg, ref GridViewDeleteEventArgs e, ref HtmlGenericControl DivError, ref Label _LblError) { bool _isretval = false; try { string g_strErrorMessage = ""; if (GeneralBL.isEmptyorNull(dg.DataKeys[e.RowIndex].Value) != "") { GeneralBL.Delete(_OpCode, SpName, _RecFieldID, Convert.ToInt32(dg.DataKeys[e.RowIndex].Value), ref g_strErrorMessage, ""); if (g_strErrorMessage.Length > 0) { DivError.Visible = true; _LblError.Text = g_strErrorMessage.Replace("Error : ", ""); } else { _isretval = true; } } else { DivError.Visible = true; _LblError.Text = "No Record Found to delete."; } } catch (Exception exp) { DivError.Visible = true; _LblError.Text = exp.Message; } return(_isretval); }