private void LoadData(string NVOCCId) { ClearText(); int intNVOCCId = 0; if (NVOCCId == "" || !Int32.TryParse(NVOCCId, out intNVOCCId)) { return; } BLL.DBInteraction dbinteract = new BLL.DBInteraction(); System.Data.DataSet ds = dbinteract.GetNVOCCLine(Convert.ToInt32(NVOCCId), ""); if (!ReferenceEquals(ds, null) && ds.Tables[0].Rows.Count > 0) { txtLineName.Text = ds.Tables[0].Rows[0]["NVOCCName"].ToString(); txtFreeDays.Text = Convert.ToString(ds.Tables[0].Rows[0]["DefaultFreeDays"]); txtContact.Text = Convert.ToString(ds.Tables[0].Rows[0]["ContAgentCode"]); txtImpCommsn.Text = Convert.ToString(ds.Tables[0].Rows[0]["ImportCommission"]); txtExportCommission.Text = Convert.ToString(ds.Tables[0].Rows[0]["ExportCommission"]); txtRBuffer.Text = Convert.ToString(ds.Tables[0].Rows[0]["XChgRateBuffer"]); string exp = Convert.ToString(ds.Tables[0].Rows[0]["ExportBooking"]); ddlExpBook.SelectedValue = exp == "1" ? "y" : "n"; imgLogo.ImageUrl = string.IsNullOrEmpty(Convert.ToString(ds.Tables[0].Rows[0]["LogoPath"])) ? "~/MasterModule/Image/Defaultlogo.png" : ds.Tables[0].Rows[0]["LogoPath"].ToString(); hdnLogo.Value = imgLogo.ImageUrl; } }
private void PopulateLine() { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); DataSet ds = dbinteract.GetNVOCCLine(-1, string.Empty); ddlLine.DataValueField = "pk_NVOCCID"; ddlLine.DataTextField = "NVOCCName"; ddlLine.DataSource = ds; ddlLine.DataBind(); ddlLine.Items.Insert(0, new ListItem(Constants.DROPDOWNLIST_DEFAULT_TEXT, Constants.DROPDOWNLIST_DEFAULT_VALUE)); }
private void PopulateLine() { BLL.DBInteraction dbinteract = new BLL.DBInteraction(); DataSet ds = dbinteract.GetNVOCCLine(-1, string.Empty); ddlLine.DataValueField = "pk_NVOCCID"; ddlLine.DataTextField = "NVOCCName"; ddlLine.DataSource = ds; ddlLine.DataBind(); ddlLine.Items.Insert(0, new ListItem("All", "0")); }
private void LoadData(string SortExp, string direction) { string nvocc = string.IsNullOrEmpty(txtLine.Text) ? "" : txtLine.Text.Trim(); 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; } BLL.DBInteraction dbinteract = new BLL.DBInteraction(); try { DataSet ds = dbinteract.GetNVOCCLine(-1, nvocc); System.Data.DataView dv = new System.Data.DataView(ds.Tables[0]); if (!string.IsNullOrEmpty(SortExp) && !string.IsNullOrEmpty(direction)) { dv.Sort = SortExp + " " + direction; } gvwLoc.DataSource = dv; } catch (Exception ex) { gvwLoc.DataSource = null; lblErrorMsg.Text = "Error Occured.Please try again."; } gvwLoc.DataBind(); } } }