예제 #1
0
파일: Log.aspx.cs 프로젝트: tayduivn/GNDN
        //Xoá toàn bộ dữ liệu trong gridview ở trang hiện thời
        protected void btnDeleteLog_Click(object sender, EventArgs e)
        {
            int           _id             = 0;
            List <object> _lstCurrentPage = new List <object>();

            try
            {
                //Lấy ra toàn bộ key trong gridview ở trang hiện thời
                _lstCurrentPage = GrdLog.GetCurrentPageRowValues(new string[] { GrdLog.KeyFieldName });
                if (_lstCurrentPage.Count != 0 && _lstCurrentPage != null)
                {
                    for (int i = 0; i < _lstCurrentPage.Count; i++)
                    {
                        _id = int.Parse(_lstCurrentPage[i].ToString());
                        _ISYS_LogService.DeleteSYS_Logstr(_id);
                    }
                    _DataBind();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("btnDeleteLog_Click.Delete: {0}", ex.Message));
            }
        }