protected void m_grid_RowDeleting(object sender, GridViewDeleteEventArgs e) { string message = ""; try { MediaGroups m_MediaGroups = new MediaGroups(); m_MediaGroups.MediaGroupId = System.Int16.Parse(m_grid.DataKeys[e.RowIndex].Value.ToString()); m_MediaGroups.Delete(); } catch (Exception ex) { sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name); } ShowGrid(); }
protected void lbDelete_Click(object sender, EventArgs e) { try { MediaGroups m_MediaGroups = new MediaGroups(); foreach (GridViewRow m_Row in m_grid.Rows) { CheckBox chkAction = (CheckBox)m_Row.FindControl("chkAction"); if (chkAction != null) { if (chkAction.Checked) { m_MediaGroups.MediaGroupId = System.Int16.Parse(m_grid.DataKeys[m_Row.RowIndex].Value.ToString()); m_MediaGroups.Delete(); } } } ShowGrid(); } catch (Exception ex) { sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name); } }