private void LoadData(string SortExp, string direction) { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); //int VesselPrefix = Convert.ToInt32(ddlVesselPrefix.SelectedValue); string Location = string.IsNullOrEmpty(TxtLocation.Text) ? "" : TxtLocation.Text.Trim(); string LineName = string.IsNullOrEmpty(txtLine.Text) ? "" : txtLine.Text.Trim(); //int vesselFlag = // int countryId=Convert.ToInt32(ddlLocation.SelectedValue); lblErrorMsg.Text = ""; if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null)) { SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; if (!ReferenceEquals(searchCriteria, null)) { BuildSearchCriteria(searchCriteria); gvwLoc.PageIndex = searchCriteria.PageIndex; if (searchCriteria.PageSize > 0) { gvwLoc.PageSize = searchCriteria.PageSize; } try { //System.Data.DataSet ds = dbinteract.GetFreeDays(-1, Location, LineName, searchCriteria); //System.Data.DataView dv = new System.Data.DataView(ds.Tables[0]); //if (!string.IsNullOrEmpty(SortExp) && !string.IsNullOrEmpty(direction) && SortExp != "Location") // dv.Sort = SortExp + " " + direction; //gvwLoc.DataSource = dv; gvwLoc.DataSource = dbinteract.GetFreeDays(-1, Location, LineName, searchCriteria); gvwLoc.DataBind(); } catch (Exception ex) { gvwLoc.DataSource = null; lblErrorMsg.Text = "Error Occured.Please try again."; } gvwLoc.DataBind(); } } }
private void LoadData(string FreeLinkID) { ClearText(); SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; BLL.DBInteraction dbinteract = new BLL.DBInteraction(); int intServTaxId = 0; if (FreeLinkID == "" || !Int32.TryParse(FreeLinkID, out intServTaxId)) { return; } System.Data.DataSet ds = dbinteract.GetFreeDays(FreeLinkID.ToInt(), "", "", searchCriteria); if (!ReferenceEquals(ds, null) && ds.Tables[0].Rows.Count > 0) { txtFreeDays.Text = ds.Tables[0].Rows[0]["DefaultFreeDays"].ToString(); ddlLoc.SelectedValue = ds.Tables[0].Rows[0]["fk_LocationID"].ToString(); ddlLine.SelectedValue = ds.Tables[0].Rows[0]["fk_NVOCCID"].ToString(); //ddlStatus.SelectedIndex = Convert.ToString(ds.Tables[0].Rows[0]["LinkStatus"]) == "Active" ? 1 : 0; } }