protected void dgEmployees_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { string strSQL = ""; clsGeneral General = new clsGeneral(); int intEmployeeID = e.Keys[0].GetValueOrDefault<int>(); if (!(intEmployeeID == 0)) { //Check to see if Child records exist strSQL = "DELETE FROM tblSchedule "; strSQL += "WHERE EmployeeID = " + intEmployeeID; General.DeleteRecord(strSQL); } }
private void DeleteUser(int intEmployeeID) { clsGeneral General = new clsGeneral(); strSQL = "DELETE FROM tblUsers "; strSQL += "WHERE EmployeeID = " + intEmployeeID; General.DeleteRecord(strSQL); }