public void BindData(BindType bindType) { if (bindType == BindType.Form) { var queryargument = new QueryArgument(UserContext.DataBaseInfo) { Key = CountryId, filter1 = Constants.CountryType, BindType = bindType, QueryType = Constants.TableMCatHeader, SubFilterKey = Constants.TableMCatDetls }; var countries = _controlPanel.GetCountry(queryargument); if (countries == null) { return; } var country = countries.FirstOrDefault(); if (country != null) { CountryId = country.CountryId; CountryName = country.CountryName.Trim(); CurrencyCode = country.CurrencyCode.Trim(); CurrencyName = country.CurrencyName.Trim(); CurrencySymbol = country.CurrencySymbol.Trim(); Denomination = country.Denomination.Trim(); } lnkSubmit.Visible = hidAction.Value != Constants.ViewAction; var state = country.States; GridViewState.DataSource = state; if (_newPageIndex >= 0) { GridViewState.PageIndex = _newPageIndex; } GridViewState.DataBind(); uplForm.Update(); } else { var queryargument = new QueryArgument(UserContext.DataBaseInfo) { Key = CountryId, filter1 = Constants.CountryType, BindType = bindType, QueryType = Constants.TableMCatHeader }; var countries = _controlPanel.GetCountry(queryargument); GridViewTable.DataSource = countries; if (_newPageIndex >= 0) { GridViewTable.PageIndex = _newPageIndex; } GridViewTable.DataBind(); uplView.Update(); } }
public void BindData(States state) { GridViewState.DataSource = state; if (_newPageIndex >= 0) { GridViewState.PageIndex = _newPageIndex; } GridViewState.DataBind(); uplView.Update(); }
private void ClearForm() { lnkAddState.Style.Add("cursor", "Pointer"); CountryId = string.Empty; CountryName = string.Empty; CurrencyCode = string.Empty; CurrencyName = string.Empty; CurrencySymbol = string.Empty; Denomination = string.Empty; hidAction.Value = Constants.InsertAction; GridViewState.DataSource = null; GridViewState.DataBind(); divStateDetails.Visible = false; uplForm.Update(); }