protected void ViewButton_Click(object sender, EventArgs e)
        {
            var entitySysName = Storage.Select <Entity>(Frame.EntityListAudit.SelectedValue).SystemName;

            if (entitySysName == "__Empty" || string.IsNullOrEmpty(entitySysName))
            {
                entitySysName = string.Empty;
            }
            int userID;// = -1;

            if (string.IsNullOrEmpty(Frame.UserListAudit.SelectedValue))
            {
                userID = -1;
            }
            else
            {
                Int32.TryParse(Frame.UserListAudit.SelectedValue, out userID);
            }

            var dateFrom = Frame.DateFrom.Text.Replace("T", " ");

            var dateTo = Frame.DateTo.Text.Replace("T", " ");
            var query  = string.Format("set dateformat ymd;EXEC report.getAudit @entity ='{0}', @userID={1}, @from='{2}', @to='{3}'", entitySysName, userID, dateFrom, dateTo);
            var dt     = QueryToDB(query);

            Session["ViewAuditDataSource"] = dt;

            ViewAudit.DataSource = dt;
            ViewAudit.DataBind();
        }
 protected void ViewAudit_OnPageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     TrackPageIndex();
     ViewAudit.PageIndex  = PageIndex;
     ViewAudit.DataSource = Session["ViewAuditDataSource"];
     ViewAudit.DataBind();
 }