private void Search() { txtCount.Text = txtCount.Text == "0" ? txtCount.Text = "20" : txtCount.Text; txtPage.Text = txtPage.Text == "0" ? txtPage.Text = "1" : txtPage.Text; DTO.ResponseService <DTO.GBHoliday[]> res = biz.SearchHoliday(txtSearch.Text, txtPage.Text.ToInt(), txtCount.Text.ToInt()); if (res.ErrorMsg == null) { GVholiday.DataSource = res.DataResponse; GVholiday.DataBind(); if (res.DataResponse.Count() != 0) { lblCount.Text = res.DataResponse.First() == null ? "" : res.DataResponse.First().COUNT.ToString(); lblPage.Text = Math.Ceiling((double)res.DataResponse.First().COUNT / txtCount.Text.ToInt()).ToString(); pnPage.Visible = true; } else { pnPage.Visible = false; txtCount.Text = "20"; txtPage.Text = "1"; } } else { UCModalError1.ShowMessageError = res.ErrorMsg; UCModalError1.ShowModalError(); } }
private void BindGrid() { txtCount.Text = txtCount.Text == "0" ? txtCount.Text = "20" : txtCount.Text; txtPage.Text = txtPage.Text == "0" ? txtPage.Text = "1" : txtPage.Text; DTO.ResponseService <DTO.GBHoliday[]> res = biz.GETGBHoliday(txtPage.Text == ""?1:txtPage.Text.ToInt(), txtCount.Text == ""?20:txtCount.Text.ToInt()); GVholiday.DataSource = res.DataResponse; GVholiday.DataBind(); if (res.DataResponse.Count() != 0) { lblCount.Text = res.DataResponse.First() == null ? "" : res.DataResponse.First().COUNT.ToString(); lblPage.Text = Math.Ceiling((double)res.DataResponse.First().COUNT / txtCount.Text.ToInt()).ToString(); pnPage.Visible = true; } else { pnPage.Visible = false; txtCount.Text = "20"; txtPage.Text = "1"; } }